git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jeff King <peff@peff.net>, Git <git@vger.kernel.org>,
	Brandon Williams <bwilliams.eng@gmail.com>,
	Jacob Keller <jacob.keller@gmail.com>
Subject: Re: [PATCH] refspec: make @ a valid refspec
Date: Tue, 24 Nov 2020 18:09:10 -0600	[thread overview]
Message-ID: <CAMP44s3f_cO61YVjvwsiswKQRESznOFn7KTshgv06a=zVRPLug@mail.gmail.com> (raw)
In-Reply-To: <xmqqo8jmgyrd.fsf@gitster.c.googlers.com>

On Tue, Nov 24, 2020 at 4:45 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
> >> I too find that "@ is a shortcut for HEAD" looks ugly both at the UI
> >> level and at the implementation level [*1*], but as long as we have
> >> it, it is good to try to be consistent and allow "@" everywhere
> >> where one would write "HEAD" in places where it is syntacitically
> >> infeasible---at least we would be consistently ugly that way ;-).
> >
> > Beauty is in the eye of the beholder.
>
> Using "@" is rather "illogical" than "ugly", and at that point it is
> not so subjective.

I disagree.

> @-mark leads a suffix that applies some "magic" to what comes before
> it (e.g. next@{1}, maint@{2.weeks.ago}, and master@{-1}).  Making @
> a synonym for HEAD means '@' sometimes means a ref and most of the
> time means the introducer of magic that applies to a ref.

All this was discussed back then [1].

In my mind "@" means the same as "@{0}", and "@{0}~0^0". So I don't
see any inconsistency.

Your mind may be different.

> Worse yet, @{4} does not refer to HEAD@{4} but refers to the 4-th
> previous commit the current branch pointed at, so a mnemonic for the
> end user to remember the distinction between the two is that a bare
> "@" is different from HEAD, which is a total opposite X-<.

Once again; each user is different. Personally I never use these
shortcuts precisely because I'm not entirely sure what I want to tell
git. I just use "git reflog" and manually pick the commit id I want.

I suspect most users don't use this notation either, so even if
there's an inconsistency (which I'm not entirely sure the @ shortcut
has anything to do with it), it would affect few users.

> This is all water under the bridge, though ;-)

Indeed.

And I take it we can agree that it's better to have instructions like:

  git push -u origin @

Rather than:

  git push -u origin master

Regardless of what some users think of "@", it's less contentious than "master".

Cheers.

[1] https://lore.kernel.org/git/1367264106-2351-1-git-send-email-felipe.contreras@gmail.com/

-- 
Felipe Contreras

  parent reply	other threads:[~2020-11-25  0:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-22 16:46 [PATCH] refspec: make @ a valid refspec Felipe Contreras
2020-11-24  7:42 ` Jeff King
2020-11-24 20:01   ` Junio C Hamano
2020-11-24 22:01     ` Felipe Contreras
2020-11-24 22:45       ` Junio C Hamano
2020-11-24 22:52         ` Jacob Keller
2020-11-24 23:14           ` Junio C Hamano
2020-11-24 23:47             ` Jacob Keller
2020-11-25  0:28               ` Felipe Contreras
2020-11-25  0:30               ` Junio C Hamano
2020-11-25  0:14             ` Felipe Contreras
2020-11-25  0:09         ` Felipe Contreras [this message]
2020-12-04 22:20           ` Felipe Contreras

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='CAMP44s3f_cO61YVjvwsiswKQRESznOFn7KTshgv06a=zVRPLug@mail.gmail.com' \
    --to=felipe.contreras@gmail.com \
    --cc=bwilliams.eng@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jacob.keller@gmail.com \
    --cc=peff@peff.net \
    /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).