git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	git@vger.kernel.org, Conrad Irwin <conrad.irwin@gmail.com>,
	Sitaram Chamarty <sitaramc@gmail.com>
Subject: Re: [PATCH] rev-parse: Allow @{U} as a synonym for @{u}
Date: Thu, 18 Aug 2011 09:15:53 +0200	[thread overview]
Message-ID: <4E4CBC29.7080703@drmicha.warpmail.net> (raw)
In-Reply-To: <CACsJy8CX7X3u4i_kXChVHkFK=Q--pRBrxmdvjxrF7wr5_SyakA@mail.gmail.com>

Nguyen Thai Ngoc Duy venit, vidit, dixit 18.08.2011 03:53:
> On Thu, Aug 18, 2011 at 5:53 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Letting u/upstream spelled case-insensitively does improve consistency
>> among the above, but at the same time if we ever wanted to enhance @{...}
>> notation even further in the future, we are restricted to a payload that
>> is case insensitive to retain the consistency.
>>
>> 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 hate to declare that we will never support such a feature with this
>> change, but at the same time, I do not think I would need such a feature
>> that often. But for that matter, I do not think I would miss @{UpStREAM},
>> either, and that takes me back to "Meh" for this change.
>>
>> What do people think?
> 
> The itch is probably because people have to release shift, then press
> shift again to type "@{u}". How about allow case insensitive match if
> there's only _one_ letter inside @{}?
> 
> That would solve the shift problem while leaving door for @{...} extension.

Well, this patch is actually specific to a particular keyboard layout!
It improves things only for a layout where you get @ and { using a shift
key.

For a german keyboard layout, you get @{u} from

hold AltGr (Meta)
press q
press 7
release AltGr
press u
hold AltGr
press 0

For me, an improvement would be to have the alias

@{↓}

for @{u} so that I can hold AltGr throughout and press q7u0. Which would
be very nice, pictorially :)

In general git could benefit from a rev alias mechanism. This idea has
come up several times, but in order to be really useful, we would need
that to be more general than textual replacements and allow for macro
like replacements such as

git config revalias.new "\1@{1}..\1"

to be used as, say

git log @{new(origin/next)}

after a fetch. (No, I'm not suggesting that specific syntax here.)

As a simpler case, a user could tailor to her keyboard layout with

git config revalias.↓ u

but for obvious reasons

git config revalias.U u

won't work.

So, maybe we could make the key part of a special revspec case
insensitive (just like config variable names) but still have a possible
payload (parameter) be case sensitive (just like config variable values)?

Michael

  reply	other threads:[~2011-08-18  7:16 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 [this message]
2011-08-18  8:54         ` Nguyen Thai Ngoc Duy
2011-08-18  9:31           ` Michael J Gruber
2011-08-19 18:54             ` Conrad Irwin

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=4E4CBC29.7080703@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=conrad.irwin@gmail.com \
    --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.
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).