Re: [PATCH] rev-parse: Allow @{U} as a synonym for @{u}

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]