zsh-users
 help / color / mirror / code / Atom feed
From: "Daniel Shahaf" <d.s@daniel.shahaf.name>
To: "Cristiano De Michele" <cristiano.demichele@uniroma1.it>
Cc: zsh-users@zsh.org
Subject: Re: subversion complete functions obsolete
Date: Sat, 24 Aug 2019 21:16:48 +0000	[thread overview]
Message-ID: <cf4183ed-0abb-46c8-8208-2aa3842c3b7e@www.fastmail.com> (raw)
In-Reply-To: <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

  reply	other threads:[~2019-08-24 21:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-23 16:38 Cristiano De Michele
2019-08-24 17:24 ` Daniel Shahaf
2019-08-24 20:25   ` Cristiano De Michele
2019-08-24 21:16     ` Daniel Shahaf [this message]
     [not found]       ` <35D00560-E05B-40F1-B581-43BAAC418C32@uniroma1.it>
     [not found]         ` <bfb30924-2b36-4d99-b8ba-674eb280c5e0@www.fastmail.com>
2019-08-25  9:46           ` Cristiano De Michele
2019-08-26 14:23             ` Daniel Shahaf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cf4183ed-0abb-46c8-8208-2aa3842c3b7e@www.fastmail.com \
    --to=d.s@daniel.shahaf.name \
    --cc=cristiano.demichele@uniroma1.it \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).