All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "SZEDER Gábor" <szeder@ira.uka.de>
Cc: "Shawn O. Pearce" <spearce@spearce.org>, <git@vger.kernel.org>,
	Jonathan Nieder <jrnieder@gmail.com>
Subject: Re: [PATCH] completion: complete "git diff ...branc<TAB>"
Date: Thu, 24 Feb 2011 09:09:48 -0800	[thread overview]
Message-ID: <7vfwrd2wbn.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20110224151328.GB14720@neumann> ("SZEDER =?utf-8?Q?G=C3=A1bo?= =?utf-8?Q?r=22's?= message of "Thu\, 24 Feb 2011 16\:13\:28 +0100")

SZEDER Gábor <szeder@ira.uka.de> writes:

> There is this 'ref:file' notation (as in 'git show master:README', but
> I don't know the proper term for it), which is understood by
> __git_complete_file(), and can be useful for 'git diff', e.g. to
> compare a file in two branches when the file was renamed in between:
>
>   git diff branchA:old branchB:new
>
> However, __git_complete_revlist() doesn't understand this notation,

If that is the case, I wonder if complete-revlist should learn it as well.
The "<tree>:<path>" notation is just one of the "extended SHA-1
expressions" to name an entry in a tree object and should be usable
anywhere an object name is expected to occur.

The users of complete-revlist seems to be "log" and their friends, and
they don't expect arbitrary object names; they are only interested in
commit objects and tags and then paths.  Teaching <tree>:<path> to it may
make "git log HEAD:bar<TAB>" to complete to "git log HEAD:bar/boz" that
would be a nonsense, but anything that the original "git log HEAD:bar"
would complete would be a nonsense to begin with (as soon as you said
"HEAD:<something to follow>", you are naming either a blob or a tree
object, and you cannot start log from them), so I don't see a harm done in
doing so.

IOW, shouldn't there be just one unified complete-rev-then-path that is a
superset of the current complete-revlist and complete-file that all the
current users of complete-revlist and complete-file should use?

  reply	other threads:[~2011-02-24 17:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 21:43 [PATCH] completion: complete "git diff ...branc<TAB>" Junio C Hamano
2011-02-24 12:24 ` Michael J Gruber
2011-02-24 13:58   ` SZEDER Gábor
2011-02-24 14:07     ` Michael J Gruber
2011-02-24 15:13 ` SZEDER Gábor
2011-02-24 17:09   ` Junio C Hamano [this message]
2011-03-10 18:12     ` [PATCH 1/2] bash: fix misindented esac statement in __git_complete_file() SZEDER Gábor
2011-03-10 18:12       ` [PATCH 2/2] bash: complete 'git diff ...branc<TAB>' SZEDER Gábor
2011-03-10 19:30         ` Junio C Hamano

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=7vfwrd2wbn.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.com \
    --cc=spearce@spearce.org \
    --cc=szeder@ira.uka.de \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.