git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/4] name-rev: allow converting the exact object name at the tip of a ref
Date: Mon, 08 Jul 2013 08:12:43 -0700	[thread overview]
Message-ID: <7v38rp2ihg.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CALkWK0kSqaMrD_YuT8OxLo8yLEc0APd2Ca7FapKstqqmcYbC7A@mail.gmail.com> (Ramkumar Ramachandra's message of "Mon, 8 Jul 2013 17:50:16 +0530")

Ramkumar Ramachandra <artagnon@gmail.com> writes:

>   Finds symbolic names suitable for human digestion for revisions
>   given in any format parsable by git rev-parse.
>
> It is meant to name _revisions_ (aka. commits):

That is a mistaken documentation, written based on a half-baked
implementation that conflated "the current code only can handle
commits" with "we need to only handle commit and nothing, ever".

We had to fix a similar misguided/short-sighted implementation in
the "git fetch" codepath when adding "git pull/merge $tag" (the code
peeled a tag object too early when writing FETCH_HEAD out, losing
information if what we were given was a tag or a commit).

I do not want to see us making the mistake worse unnecessarily.
When we see a commit object that is pointed by tag v1.8.3, it is the
right thing to do to return v1.8.3^0 as its string representation so
that "git rev-parse v1.8.3^0" give us the same thing back.  name-rev
that is fed a tag object v1.8.3 should give v1.8.3 (not v1.8.3^0)
back, otherwise feeding its output to "git rev-parse" will not give
us the same thing we fed as the input to name-rev.

  reply	other threads:[~2013-07-08 15:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-07 22:33 [PATCH 0/4] Make "git name-rev $(git rev-parse v1.8.3)" work Junio C Hamano
2013-07-07 22:33 ` [PATCH 1/4] name-ref: factor out name shortening logic from name_ref() Junio C Hamano
2013-07-08  8:52   ` Michael Haggerty
2013-07-08 15:04     ` Junio C Hamano
2013-07-07 22:33 ` [PATCH 2/4] name-rev: allow converting the exact object name at the tip of a ref Junio C Hamano
2013-07-08 12:20   ` Ramkumar Ramachandra
2013-07-08 15:12     ` Junio C Hamano [this message]
2013-07-07 22:33 ` [PATCH 3/4] describe: use argv-array Junio C Hamano
2013-07-09  4:51   ` Jeff King
2013-07-09 14:55     ` Junio C Hamano
2013-07-09 16:00       ` Junio C Hamano
2013-07-09 18:53         ` Jeff King
2013-07-07 22:33 ` [PATCH 4/4] describe/name-rev: tell name-rev to peel the incoming object to commit first Junio C Hamano
2013-07-08 13:08   ` Ramkumar Ramachandra
2013-07-09  5:12     ` Jeff King
2013-07-09  5:06   ` Jeff King
2013-07-09  5:33     ` Junio C Hamano
2013-07-09  5:35       ` Jeff King
2013-07-09 11:45         ` Junio C Hamano
2013-07-09 12:42           ` Ramkumar Ramachandra

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=7v38rp2ihg.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    --subject='Re: [PATCH 2/4] name-rev: allow converting the exact object name at the tip of a ref' \
    /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

Code repositories for project(s) associated with this 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).