Re: [PATCH] rev-parse: Allow @{U} as a synonym for @{u}
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 17, 2011, 22:53 UTC
- Message-ID
- <7vhb5fd4zy.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1313287071-7851-1-git-send-email-conrad.irwin@gmail.com>
Conrad Irwin <conrad.irwin@gmail.com> writes:
> This facilitates specifying the upstream of a branch if you have
> difficulty synchronising your shift-key and other characters, if you
> just want to SHOUT at git, or if you're expecting consistency with
> @{1DAY}.Show 11 quoted lines
> +test_expect_success '@{U} resolves to correct full name' '
> + test refs/remotes/origin/master = "$(full_name @{U})"
> +'
> +
> +test_expect_success '@{Upstream} resolves to correct full name' '
> + test refs/remotes/origin/master = "$(full_name @{Upstream})"
> +'
> +
> test_expect_success 'my-side@{upstream} resolves to correct full name' '
> test refs/remotes/origin/side = "$(full_name my-side@{u})"
> 'Even though I sometimes use @{upstream} these days to keep track of origins of various topic branches (some are fixes and fork from maint while others are features and fork from master), I never felt a need for @{U} or @{uPStreAM} myself, so as a new feature, this change is a "Meh" for me personally.
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".
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?