Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: subversion complete functions obsolete
- X-seq: zsh-users 24183
- From: "Daniel Shahaf" <d.s@xxxxxxxxxxxxxxxxxx>
- To: "Cristiano De Michele" <cristiano.demichele@xxxxxxxxxxx>
- Subject: Re: subversion complete functions obsolete
- Date: Sat, 24 Aug 2019 21:16:48 +0000
- Cc: zsh-users@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=mime-version:message-id:in-reply-to :references:date:from:to:cc:subject:content-type :content-transfer-encoding; s=fm1; bh=0Sew0qGskISLI8ZlbHjwLXTaEM LSD+ETqjhf2ZthLq4=; b=bKTjxQeZ8YrVTUNa1tbTNw3RSOIVSHRDdNoqiibkKz r1SOsv4HbXGSFVsVMarp2RIBTxZdQOqXf3MBtkoI6/FhXeSTERYZVyC/mhkPwfd8 Iv6EvFm0uc6lTZdz56rDTmzIxGNffKwvqBu9QGtggqWXyj6j65Vo/a/gR1hLV3Hc s6AOh+rvC8lkb7Dth+Kz9jB9qwx+ZRygY6hZRjgxaD0GvFYhk7cBge2eKJZtQ7RC utQzfkkbLqmneAYsb9AWNEDXlH0ePxaDt59GXxUjmPaSXh2XZhCxsVsab0A/vFCO 9WcUn4TuTl+iFZHcL9XsfpYE8Q51pBNTegmyywvSNbjg==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=0Sew0qGskISLI8ZlbHjwLXTaEMLSD+ETqjhf2ZthL q4=; b=ituakbnhiPiWvCR24VWLTxPPu9QgLR47johgQWHJYFGZluaSUwzhBK6ID sPN90y8XbQ7H4kdtsulzXDZnq3ZUSMB7K4Ne1OIw9LNnl4puluBnaj4KnXk5IvCD XiO+HYXkg9ZG/hfNF8xJDvoJXiovAZf3z9k+VTTuXO53VoVzQKclSShsMRn7jjX1 1FdeUod/QCdCaDwJygDQzknHoG/nPf4mgRHpXFoDCbthovbosoydCd5EktPbB39D sgegp3fe7iEJreJXzkBYgPT8T5nJ4Q7wyvS5LUsbkVOoyBliu8RUkYO7UBUlot2g JxqiAZsJzjMUeYytJezaIFnUmckFg==
- In-reply-to: <7E7BD433-3D39-4D86-9EAA-6DE282B5CFAF@uniroma1.it>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <5521481D-C84A-449A-BBF7-0C429868247B@uniroma1.it> <20190824172433.c4v252jc4czjsyay@tarpaulin.shahaf.local2> <7E7BD433-3D39-4D86-9EAA-6DE282B5CFAF@uniroma1.it>
Cristiano De Michele wrote on Sat, 24 Aug 2019 20:26 +00:00:
> 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'.
Interesting. I can reproduce this in a new repository that contains
just these two entries, but if I go to one of my usual working copies and
modify some files, those files do get offered by the completion.
> The same odd behavior can be also experienced with 'log' argument
> (i.e. svn log).
Okay, but note that 'diff' and 'log' would be expected to complete
different things. 'diff' tries to complete only files with local mods;
'log' should complete only filenames that exist on the server. For example:
Status diff? log?
------ ----- ----
A yes no
M yes yes
<space> no yes
> 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)
As I said in my previous email, simply using _files wouldn't complete
everything that should be completed: files with status '!' or 'D', or
files with 'Depth: exclude', for example.
> (( $+functions[_svn_controlled] )) ||
> _svn_controlled() {
> sta=$(svn status $REPLY)
> stat=$sta[1]
> [[ $stat != "?" ]]
> }
This sounds right, though the machinery currently in there
(_call_program, cache) should be added back. Calling 'svn st foo' for
each file individually would be slow. Also, a '--' should be added.
> (( $+functions[_svn_status] )) ||
> _svn_status() {
>
> sta=$(svn status $REPLY)
> [[ "$sta" != "" ]]
> }
Not sure. What about conflicted files? Unmodified files in a
changelist? Unmodified files that were locked by another working copy?
> but I am not sure they work as the original versions…
> I agree with you that _svn_conflict could be kept. According
> to what you wrote a possible implementation of _svn_deletedfiles could be
>
> sta=$(svn status $REPLY)
> stat=$sta[1]
> [[ $stat == “D" ]]
What about completing foo/bar after «svn rm foo»?
> what do you think?
Thanks a lot for working on this. Let's try to break this into small,
incremental improvements.
> The patch file is attached,
You sent the diff reversed: the file as in HEAD of master should be the
first argument to diff. Also, for bonus points, send the diff with a
.txt extension and not compressed. (Doing so gives it a text/* MIME
type, which makes the diff easier to read on our end.)
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author