Re: [PATCH v3] Add new @ shortcut for HEAD

4 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH v3] Add new @ shortcut for HEAD

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:06

Felipe Contreras [off-list ref] writes:
Exactly, because ref@something is used for operations on a ref. If
'ref' is missing, it only makes sense to use HEAD (or something like
that), and if 'something' is missing, it only makes sense to make it a
no-op, but since we don't want to forbid refs with names like
'master@'. That's the reason why '@' makes sense, and not any other
character.
Yes.  My typo made it look as if I meant to say '@' was a bad
choice, but we are in agreement that '@' is better than any other
random choice of single punctuation letter.

It is just the "strip this, strip that" explanation, which is not
technically correct, does _not_ have to be our justification for
picking '@' as a short-hand for HEAD.

Re: [PATCH v3] Add new @ shortcut for HEAD

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:06

On Wed, May 1, 2013 at 5:59 PM, Junio C Hamano [off-list ref] wrote:
Felipe Contreras [off-list ref] writes:
quoted
Exactly, because ref@something is used for operations on a ref. If
'ref' is missing, it only makes sense to use HEAD (or something like
that), and if 'something' is missing, it only makes sense to make it a
no-op, but since we don't want to forbid refs with names like
'master@'. That's the reason why '@' makes sense, and not any other
character.
Yes.  My typo made it look as if I meant to say '@' was a bad
choice, but we are in agreement that '@' is better than any other
random choice of single punctuation letter.
Yeah, we agree.
It is just the "strip this, strip that" explanation, which is not
technically correct, does _not_ have to be our justification for
picking '@' as a short-hand for HEAD.
The point is that it follows from @something -> @.

-- 
Felipe Contreras

Re: [PATCH v3] Add new @ shortcut for HEAD

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:06

On Wed, May 1, 2013 at 6:14 PM, Felipe Contreras
[off-list ref] wrote:
On Wed, May 1, 2013 at 5:59 PM, Junio C Hamano [off-list ref] wrote:
quoted
It is just the "strip this, strip that" explanation, which is not
technically correct, does _not_ have to be our justification for
picking '@' as a short-hand for HEAD.
The point is that it follows from @something -> @.
So my proposal is:

---
Typing 'HEAD' is tedious, especially when we can use '@' instead.

The reason for choosing '@' is that it follows naturally from the
ref@op syntax (e.g. HEAD@{u}), except we have no ref, and no
operation, and when we don't have those, it makes sens to assume
'HEAD'.

After this patch, we can use 'git show @~1', and all that goody goodness.

Until now '@' was a valid ref name, but it conflicts with this idea, so lets
make it invalid. Probably very few people, if any, used this symbolic ref.
---

-- 
Felipe Contreras

Re: [PATCH v3] Add new @ shortcut for HEAD

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:08

Felipe Contreras [off-list ref] writes:
On Wed, May 1, 2013 at 6:14 PM, Felipe Contreras
[off-list ref] wrote:
quoted
On Wed, May 1, 2013 at 5:59 PM, Junio C Hamano [off-list ref] wrote:
quoted
quoted
It is just the "strip this, strip that" explanation, which is not
technically correct, does _not_ have to be our justification for
picking '@' as a short-hand for HEAD.
The point is that it follows from @something -> @.
So my proposal is:

---
Typing 'HEAD' is tedious, especially when we can use '@' instead.

The reason for choosing '@' is that it follows naturally from the
ref@op syntax (e.g. HEAD@{u}), except we have no ref, and no
operation, and when we don't have those, it makes sens to assume
'HEAD'.

After this patch, we can use 'git show @~1', and all that goody goodness.
That reads much better.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help