git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha.warpmail.net>
To: Christian Couder <christian.couder@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH] replace: List replacement along with the object
Date: Fri, 26 Aug 2011 09:38:09 +0200	[thread overview]
Message-ID: <4E574D61.8050501@drmicha.warpmail.net> (raw)
In-Reply-To: <CAP8UFD2Cr4UQjWa=pRvcqgyX_Ed+qjts=TujWRdyk4dUZsd_7Q@mail.gmail.com>

Christian Couder venit, vidit, dixit 25.08.2011 18:29:
> On Thu, Aug 25, 2011 at 4:39 PM, Michael J Gruber
> <git@drmicha.warpmail.net> wrote:
>> The documentation could be misunderstood as if "git replace -l" lists
>> the replacements of the specified objects. Currently, it lists the
>> replaced objects.
> 
> You could just change the documentation to make it more explicit.

Well, sure. I just didn't find the current form that useful.

>> Change the output to the form "<object> <replacement>" so that there is
>> an easy way to find the replacement, besides the more difficult to find
>> git show-ref $(git replace -l).
> 
> I shamelessly copied the "-l <pattern>" feature and the documentation
> from "git tag". If you just change the output of "git replace -l" it
> will make the UI inconsistent between both commands.

I don't think many people will expect consistency between branch and tag
on the one hand, and replace refs on the other hand. It requires the
knowledge that a replacement is basically a lightweight tag stored in a
different namespace in refs/, which I would actually consider an
implementation detail.

> Maybe you could add a "-L <pattern>" feature to "git replace", "git
> tag" and "git branch" that would output "<ref name> <ref content>"?

I'd use "-v" then if this is about consistency, because that *always*
means "verbose", and migrate the misnamed "git tag -v"...

Junio C Hamano venit, vidit, dixit 25.08.2011 21:07:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> The documentation could be misunderstood as if "git replace -l" lists
>> the replacements of the specified objects. Currently, it lists the
>> replaced objects.
> Seeing that you had to change existing tests, I do not think this is an
> improvement. The existing scripts can read the list of objects and find
> replacement themselves (if they want to find that out, that is), no?

If "replace -l" is considered fair game for scripts then the output
should probably not change, though I left the meaning of "$1" for each
line of the output as is on purpose.

But, how would scripts find the replacement? rev-parse does not do it,
rev-list does not do it, and using show-ref requires the user to know
about the actual implementation as refs under refs/replace.

Seems that the doc change is the only option.

Michael

  reply	other threads:[~2011-08-26  7:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 14:39 [PATCH] replace: List replacement along with the object Michael J Gruber
2011-08-25 16:29 ` Christian Couder
2011-08-26  7:38   ` Michael J Gruber [this message]
2011-08-26  7:53     ` [PATCHv2] git-replace.txt: Clarify list mode Michael J Gruber
2011-08-26 16:30       ` Junio C Hamano
2011-08-27 14:07         ` Michael J Gruber
2011-08-26  8:13     ` [PATCH] replace: List replacement along with the object Christian Couder
2011-08-25 19:07 ` Junio C Hamano

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E574D61.8050501@drmicha.warpmail.net \
    --to=git@drmicha.warpmail.net \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
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 NNTP newsgroup(s).