git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Conrad Irwin <conrad.irwin@gmail.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Sitaram Chamarty <sitaramc@gmail.com>
Subject: Re: [PATCH] rev-parse: Allow @{U} as a synonym for @{u}
Date: Fri, 19 Aug 2011 11:54:57 -0700	[thread overview]
Message-ID: <CAOTq_pvFLs+7QZ2CZT6TVw=m+UioKjtSkuPiBfAnCv=Mb1Q0PQ@mail.gmail.com> (raw)
In-Reply-To: <4E4CDBF5.4040709@drmicha.warpmail.net>

On Wed, Aug 17, 2011 at 3:53 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Currently, we use @{...} for:
>
>  - Negative integers are "-N branch-switching ago" (only without any ref
>   on the left);
>  - Non-negative integers "The tip of the named ref before it was changed N
>   times";
>  - An approxidate that is case insensitive; or
>  - "u" and "upstream".
[snip]
> The only remotely semi-plausible enhancement I could think of is perhaps
> to allow @{/regexp} to find a reflog entry that matches the given pattern,
> and in such a use case we would certainly want to take the pattern in a
> case sensitive way. This change closes the door to that, and that is the
> only downside I can think of right now.

I'm reasonably convinced by this argument as a refutation of the
consistency argument I proposed above. Given that the date format will
always be insensitive, and any enhancements added would probably want
to be case-sensitive (I can think of a few other things I'd "like",
but which are pretty silly: @{merge-base <commits>*}, @{octopus-base
<commits>*}); this syntax is always going to be inconsistent.
Additionally, as pointed out elsewhere in the thread, the most-similar
existing syntax (^{tree}) is already case-sensitive.

Given all of the above, I think that allowing @{upstream} to be
case-insensitive is certainly wrong, as it's slightly confusing and
not very useful.

Given that @{upstream} should be case-sensitive, it would be bizarre
to allow @{U} as a synonym, so I think I'm convinced that this is not
worth it, despite the convenience it brings.

On Thu, Aug 18, 2011 at 2:31 AM, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
>>> As a simpler case, a user could tailor to her keyboard layout with
>>>
>>> git config revalias.↓ u
>>

Hmm, this opens up interesting ideas:

git config revalias.base = '! git merge-base -a "$@"'
git show HEAD@{base master}

but that seems like it's a bit over-the-top for some reason :).

Conrad

      reply	other threads:[~2011-08-19 18:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-13  7:57 can we have @{U} as an alias for @{u} Sitaram Chamarty
2011-08-14  1:57 ` [PATCH] rev-parse: Allow @{U} as a synonym " Conrad Irwin
2011-08-17 22:53   ` Junio C Hamano
2011-08-18  1:53     ` Nguyen Thai Ngoc Duy
2011-08-18  7:15       ` Michael J Gruber
2011-08-18  8:54         ` Nguyen Thai Ngoc Duy
2011-08-18  9:31           ` Michael J Gruber
2011-08-19 18:54             ` Conrad Irwin [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to='CAOTq_pvFLs+7QZ2CZT6TVw=m+UioKjtSkuPiBfAnCv=Mb1Q0PQ@mail.gmail.com' \
    --to=conrad.irwin@gmail.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pclouds@gmail.com \
    --cc=sitaramc@gmail.com \
    /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://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).