From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id aa172619 for ; Sat, 24 Aug 2019 20:26:16 +0000 (UTC) Received: (qmail 2472 invoked by alias); 24 Aug 2019 20:26:08 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: List-Unsubscribe: X-Seq: 24182 Received: (qmail 6443 invoked by uid 1010); 24 Aug 2019 20:26:08 -0000 X-Qmail-Scanner-Diagnostics: from mail-wr1-f41.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25545. spamassassin: 3.4.2. Clear:RC:0(209.85.221.41):SA:0(-2.0/5.0):. Processed in 3.787445 secs); 24 Aug 2019 20:26:08 -0000 X-Envelope-From: cristiano.demichele@uniroma1.it X-Qmail-Scanner-Mime-Attachments: |_subversion_patch.gz| X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.221.41 as permitted sender) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=uniroma1.it; s=google; h=from:message-id:mime-version:subject:date:in-reply-to:cc:to :references; bh=FIp0Zvwk/mgvhXgIA+HA4xTXAYif3gjLbyqBGBEbVFg=; b=lT874ncmV8BTk277wa5DB+F7tv7Qt+C32i+NSDXcbJb5/tllm95EAzxWEPLbDjCS1K +3H2Gzjkdt1Qsd6FbNggy6e81gJPwln5NwevN6Y6JWpjtYpsdw70VC6oZbJpE3caY7Gg DIynlAvFU/B10ch13VG7+pDcPgT+mqfKOzk3pIuPcmfDVq8M3umnMotvFLehHNhEdgva /GpSIQGzlf3wWFdOTcwekbj0wBzCcsmYOyPkQ/F/IdVxuH0aFgqxCIeb+4d4Gou9n+52 FhArlZCLvHzYq0KGURGq20h5P3R8yZCHrnqH65yv9I7/VDoDIE1RYKCMPhRSGyXvt+Fo 7KIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:mime-version:subject:date :in-reply-to:cc:to:references; bh=FIp0Zvwk/mgvhXgIA+HA4xTXAYif3gjLbyqBGBEbVFg=; b=HPz74OGw2LsffAJjaE9y5R+rWY6Ab9+0qMLril/bDWzxbZE8WK5v8oZPSbWS5R74Nn 4YzqiGKKM88pfDZQirsR9fJBraYd6OxXvKny1DucuCnEsv+SWagyekTPiguvdsn0dPif JjE4vv8UF6sCtBleMUNbEFKwrjj3dvsKeylx4ridiY6OuavtSWAIbnOauoaXehnRZr48 nS34ZkSL/XJVeJHNnB8J3TS8l2ayj7WjGWYrmbA0UgnRZfe0/Wj50GAg9oCaowvtZs3D o26N1S6wY7bYQiivI3mEpjqoDG7t3Q0FU7mUlVKHKaBtX4p+8rDXdP0QfkHhsNtexZ3T hTRA== X-Gm-Message-State: APjAAAWb+EQmEIxyQoRZ4ArEDZsKIHAfq3XtYOi13cHTW0lbpdnaPo/U l9ADK8gVQtp3MJ4jdYWpTtIGM0d5cAI= X-Google-Smtp-Source: APXvYqzZKhfoxa+f37Pm6lJEABgoCyOPSjSNe6/o8zF1xWPD30BeLnab+jI+J3t16/IEjQiYj+7TRw== X-Received: by 2002:a5d:4284:: with SMTP id k4mr12952354wrq.6.1566678328531; Sat, 24 Aug 2019 13:25:28 -0700 (PDT) From: Cristiano De Michele Message-Id: <7E7BD433-3D39-4D86-9EAA-6DE282B5CFAF@uniroma1.it> Content-Type: multipart/alternative; boundary="Apple-Mail=_03F33B6E-D39B-45E2-9E41-216A42EF1721" Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: subversion complete functions obsolete Date: Sat, 24 Aug 2019 22:25:26 +0200 In-Reply-To: <20190824172433.c4v252jc4czjsyay@tarpaulin.shahaf.local2> Cc: Cristiano De Michele , zsh-users@zsh.org To: Daniel Shahaf References: <5521481D-C84A-449A-BBF7-0C429868247B@uniroma1.it> <20190824172433.c4v252jc4czjsyay@tarpaulin.shahaf.local2> X-Mailer: Apple Mail (2.3445.104.11) --Apple-Mail=_03F33B6E-D39B-45E2-9E41-216A42EF1721 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Dear Daniel, first of all thank you for the prompt reply. To reproduce the issue try = to do what follows. Let's assume that there is a file called 'rescheduler.py' and a = directory called 'RESCHEDULE_EXAMPLE' in a svn repository (both under version = control), then > svn diff r=20 does not complete it as expected, since it suggests only the directory = 'RESCHEDULE_EXAMPLE'. The same odd behavior can be also experienced with 'log' argument (i.e. = svn log). With my patch it should provide all possible completions (i.e. all files = and disr in the folder), since I removed completely the smart logic, which was present in the original functions (i.e. I removed everywhere = the -g option and the relative argument of function _file) I also attempted to reimplement the functions _svn_status and = _svn_controlled to restore the original logic as follows (( $+functions[_svn_controlled] )) || _svn_controlled() { sta=3D$(svn status $REPLY)=20 stat=3D$sta[1] [[ $stat !=3D "?" ]] } (( $+functions[_svn_status] )) || _svn_status() { sta=3D$(svn status $REPLY)=20 =20 [[ "$sta" !=3D "" ]] } but I am not sure they work as the original versions=E2=80=A6 I agree with you that _svn_conflict could be kept. According to what you wrote a possible implementation of _svn_deletedfiles could = be sta=3D$(svn status $REPLY)=20 stat=3D$sta[1] [[ $stat =3D=3D =E2=80=9CD" ]] what do you think? The patch file is attached, cheers=20 Cristiano ____________ Cristiano De Michele, Ph.D. =20 Department of Physics Tel. : +390649913524 = =20 University of Rome "La Sapienza" Fax : +39064463158 = =20 Piazzale Aldo Moro, 2 =20 I-00185 Roma - Italy =20 homepage: http://www.roma1.infn.it/~demichel = > Il giorno 24 ago 2019, alle ore 19:24, Daniel Shahaf = ha scritto: >=20 > Cristiano De Michele wrote on Fri, Aug 23, 2019 at 18:38:07 +0200: >> the subversion functions for tab completion provided by current = stable >> version of zsh (5.7.1) are obsolete and they do not work as expected >> (e.g. 'svn diff =E2=80=99 does not provide all files under = revision >> control), >=20 > I can't reproduce this. What files does it not complete? >=20 >> simplifying the logic of tab completion, in that it completes all >> files and dirs in the current folder (i.e. not only the ones under >> revision control), >=20 > Note that completion should also complete files that are missing = (status > =C2=AB!=C2=BB), scheduled for deletion (status =C2=ABD=C2=BB), and in = the case of =C2=ABsvn up=C2=BB, > files that are cropped (after an earlier =C2=ABsvn up = --set-depth=3Dexclude=C2=BB). > Does your patch regress either of these cases? >=20 > (If multiple things are broken, a patch needs to fix only one of them = to > be acceptable =E2=80=94 provided that it doesn't regress anything = else. If it > does, it will need to be considered on a case-by-case basis.) >=20 >> since the latest svn versions store all files in the folder >> .svn of the root directory of the repository. >=20 > Context for the list: >=20 > Subversion through 1.6.x put .svn dirs in each and every subdirectory, > like CVS did. Subversion =E2=89=A51.7 put one .svn dir in the working = copy > root, like git and hg do. Subversion 1.7.0 was released in Oct 2011. > Subversion 1.6.x EOL'd in June 2013. At this point I see little value > in continuing to support the =E2=89=A41.6 working copy format in zsh. = If anyone > disagrees, speak up. >=20 >> Hence, I patched a bit the original file making svn completion work >> again but=20 >=20 > Thanks for basing your work on HEAD of master. Please send patches > as unified diffs, not as full files. That's easier to read and = review. >=20 > Non parlo italiano. If the comment at the top of the file is = pertinent, > please translate it to English. =20 >=20 > Why did you delete _svn_conflicts()? The pattern there is still = valid. >=20 > I'm not fond of deleting _svn_deletedfiles(), _svn_controlled(), and > _svn_status(). If there's no way to fix them, I'd prefer to keep them > as functions that return true, so it would be easier to restore the > functionality once someone figures out an implementation. >=20 > _svn_status() could probably be salvaged just by making it check the > mtime of wc.db and wc.db-journal instead (more or less; IIRC SQLite = has > some pragmas/options affecting naming of auxiliary files). >=20 > _svn_deletedfiles(), by using =C2=ABsvn st | grep '^D' | cut -c8-=C2=BB.= >=20 > _svn_controlled(), by using =C2=ABsvn info -R=C2=BB or =C2=ABsvn st = --xml=C2=BB. (It would > be wrong to use =C2=ABsvn ls=C2=BB there: that wouldn't DTRT on = mixed-revision > and/or switched working copies.) >=20 > And looking further into it, _svn_deletedfiles() and _svn_controlled() > can both be computed by a _single_ command: =C2=ABsvn info -R > --show-item=3Dschedule=C2=BB. >=20 > Thanks for the patch! >=20 > Cheers, >=20 > Daniel --Apple-Mail=_03F33B6E-D39B-45E2-9E41-216A42EF1721 Content-Type: multipart/mixed; boundary="Apple-Mail=_EC3B8164-2065-4310-B6CF-6A0AC1039FF4" --Apple-Mail=_EC3B8164-2065-4310-B6CF-6A0AC1039FF4 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Dear = Daniel,
first of all thank you for the prompt reply. To = reproduce the issue try to do what follows.
Let's = assume that there is a file called 'rescheduler.py' and a = directory
called 'RESCHEDULE_EXAMPLE' in a svn = repository (both under version control), then
> svn diff r<TAB> =

does not complete it as expected, since it = suggests only the directory 'RESCHEDULE_EXAMPLE'.
The same odd behavior can be also experienced with 'log' argument (i.e. = svn log).
With my patch it should provide all possible = completions (i.e. all files and disr in the folder), since I removed = completely the smart logic,

which was present in the = original functions (i.e. I removed everywhere the -g option and the = relative argument of function _file)

I also attempted = to reimplement the functions _svn_status and _svn_controlled to restore = the original logic as follows


(( = $+functions[_svn_controlled] )) ||
_svn_controlled() = {
  sta=3D$(svn status $REPLY) 
  stat=3D$sta[1]
  [[ $stat !=3D= "?" ]]
}

(( = $+functions[_svn_status] )) ||
_svn_status() = {

  = sta=3D$(svn status  $REPLY) 
 
  [[ "$sta" !=3D "" = ]]
}

but I am not sure they work = as the original versions=E2=80=A6
I = agree with you that _svn_conflict could be kept. According
to what you wrote a possible = implementation of _svn_deletedfiles could be

sta=3D$(svn status $REPLY) 
stat=3D$sta[1]
[[ $stat =3D=3D =E2=80=9CD"= ]]

what = do you think?

The patch file is = attached,

cheers 
Cristiano

= --Apple-Mail=_EC3B8164-2065-4310-B6CF-6A0AC1039FF4 Content-Disposition: attachment; filename=_subversion_patch.gz Content-Type: application/x-gzip; x-unix-mode=0644; name="_subversion_patch.gz" Content-Transfer-Encoding: base64 H4sICNOZYV0AA19zdWJ2ZXJzaW9uX3BhdGNoALVWbW/bNhD+HP2Kq+0hkmVZkvPSVJnbFNgGDGiC Idg+DE4mKBJlE6Ukg5ScOrb723ck5VhOYqPZ2iCJpCN5z3PPHclzHAdCUd3NCBe0yMOCl5NiXOQR Oxh4/jvHO3MGxzAYBL4XnLzte+sfsL2B5xm2bT9ZTscUF4cPYhKe9N/2/aYb711wchx4p8/cXFyA 4/fege33TuDiwoB2XGTThKQgZrn8Y7Qkw/o9SjK6eXFEGZU0Hq6/DTCcNvw5oQLwt5wQSCkjMOXF jCYkgbs5IDdQ3GAalfEEjdJfFU8ggvtojouiEn4HTrJihoMpLzKIGFPOYnwREqEsIFSepbe0yuMS 41dTiql6dcYQ5YmycMKQ44xAxMdVRvKyh+ZKQBZ9pvkYZKyMqEWMCAEii3gpMe5pOVGjEUceiLiW F2q9+4ZjoP6oi2nBwgAAViBDiCseF3lJvpTDVmfz0QIpFgFGcwLky5Qhs3Loy3XlfEoEKcH5KPmH SFTorPheb3CEifFO5VPmZv0TR4JAJ86kfOcbM4AZJYnVNIAMXNhD03C2rHDYDaSGgVJSHBr2vmGp aKtr/oPfGHEoY+IFYyQJrNbhNtwW+vk2OdQzo+UL/JAeHOjPzkIaXLN9Z5ldx5HwXStAW+B2Mlkz I/+2SW31PQKr45IpqsTrYkoI1g/5UZr3kZbp1vQ0VKJGX0mSpukuigeP4BBAGLGS8FxvmZZGanBq QaviTAR/XX/SlOQXErFf40QGdtO9eSL6jbXLua6MfeFNCJtaes8cD3pnuGWOzvDR3DHP1rBi/I1J 8/+HMA1192b+WzCe6NbYhLu1s1/E3676/7qbM8LHhOZpUUt/etLzB6j9qS+fUvyDZ2s4EQXDk/3H nVGboFJG4/KVG4UTPN5fOqG+CztTbudl13p5R/deewqhvGaVC6z+GdE5OPIHvVOwj7yz3vFxXf94 z1Q8lw8DVnhF26YJHXt9bYrRkxq4BcuC5dKwn9jVLYchjkbgpHhKm5fW9a9/fPq73e66KxmXK685 5w5vJrez2B5SVri9NeyVYe8koPP1DF+bH+HByaGj3PdN7DnIkv/svLfMK7wWLNiH0NR6G6Q5ssbB PmY+pfJCr0Q0JnBfVAw7GAKbdB7uOZxVNdQNAUoIGx3lACdTNh+amFEtqI4HhmB23aUl3aJYyK/O nZy1cYDr9PyG4N1Hlc2rgAelpV2nBdfw2GR1FhsXq3NICl2vMp2kdhhM3I6avgZHlraE0+n8SYKs 9AzlPilyskdwXcfbUmvbWmQtUEL5cE1gY8X+EBuohR845ujjL5fXX2+XHy6tVUuiATxkRcKKKAHn N9kFutIv3AUP6jl47yZk5uYVYxt/n8kc/Zl6ho3jNMa4EdsKHq00L5La2NqszEqakcZa9a1muaru sanklAirpkZTQDXeoB5hHGGL24h71EEWStvGkHJXj7wZajTU7Fy2r7lO0g5HklMou+IQW+wxjzLQ tamadTUPnKtGOLADFv2oLzUppToMmVG5ydv4P7V2MFgFbbMtrM7iK6Zr1dVZXCF7WRZgwEtlIXv7 koS4YPJYHPBsRJXIvwfwhE8iDQAA --Apple-Mail=_EC3B8164-2065-4310-B6CF-6A0AC1039FF4 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
____________
Cristiano De Michele, Ph.D.  =          
Department of Physics =                     =   Tel.  :  +390649913524        =                     =                     =           
University of = Rome  "La Sapienza"    Fax =  :  +39064463158            =                     =                     =     
Piazzale Aldo Moro, 2     =                     =      
I-00185 Roma - Italy  
homepage: http://www.roma1.infn.it/~demichel





Il giorno 24 ago 2019, alle ore 19:24, Daniel Shahaf <d.s@daniel.shahaf.name> ha scritto:

Cristiano De Michele wrote on Fri, Aug 23, 2019 at 18:38:07 = +0200:
the subversion = functions for tab completion provided by current stable
version of zsh (5.7.1) are obsolete and they do not work as = expected
(e.g. 'svn diff <tab>=E2=80=99 does not = provide all files under revision
control),

I can't reproduce this. =  What files does it not complete?

simplifying the logic of = tab completion, in that it completes all
files and dirs in = the current folder (i.e. not only the ones under
revision = control),

Note that completion = should also complete files that are missing (status
=C2=AB!=C2= =BB), scheduled for deletion (status =C2=ABD=C2=BB), and in the case of = =C2=ABsvn up=C2=BB,
files that are cropped (after an = earlier =C2=ABsvn up --set-depth=3Dexclude=C2=BB).
Does = your patch regress either of these cases?

(If= multiple things are broken, a patch needs to fix only one of them to
be acceptable =E2=80=94 provided that it doesn't regress = anything else.  If it
does, it will need to be = considered on a case-by-case basis.)

since the latest svn = versions store all files in the folder
.svn of the root = directory of the repository.

Context for the list:

Subversion = through 1.6.x put .svn dirs in each and every subdirectory,
like CVS did.  Subversion =E2=89=A51.7 put one .svn dir = in the working copy
root, like git and hg do. =  Subversion 1.7.0 was released in Oct 2011.
Subversion 1.6.x EOL'd in June 2013.  At this point = I see little value
in continuing to support the =E2=89=A41.6= working copy format in zsh.  If anyone
disagrees, = speak up.

Hence, I patched a bit the original file making svn = completion work
again but

Thanks for basing your work on HEAD of master.  Please = send patches
as unified diffs, not as full files. =  That's easier to read and review.

Non = parlo italiano.  If the comment at the top of the file is = pertinent,
please translate it to English.  

Why did you delete _svn_conflicts()?  The = pattern there is still valid.

I'm not fond = of deleting _svn_deletedfiles(), _svn_controlled(), and
_svn_status().  If there's no way to fix them, I'd = prefer to keep them
as functions that return true, so it = would be easier to restore the
functionality once someone = figures out an implementation.

_svn_status() = could probably be salvaged just by making it check the
mtime= of wc.db and wc.db-journal instead (more or less; IIRC SQLite has
some pragmas/options affecting naming of auxiliary files).

_svn_deletedfiles(), by using =C2=ABsvn st | = grep '^D' | cut -c8-=C2=BB.

_svn_controlled(), by using =C2=ABsvn info -R=C2=BB or =C2=ABsv= n st --xml=C2=BB.  (It would
be wrong to use =C2=ABsvn = ls=C2=BB there: that wouldn't DTRT on mixed-revision
and/or = switched working copies.)

And looking = further into it, _svn_deletedfiles() and _svn_controlled()
can both be computed by a _single_ command: =C2=ABsvn info = -R
--show-item=3Dschedule=C2=BB.

Thanks for the patch!

Cheers,

Daniel

= --Apple-Mail=_EC3B8164-2065-4310-B6CF-6A0AC1039FF4-- --Apple-Mail=_03F33B6E-D39B-45E2-9E41-216A42EF1721--