git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] replace: List replacement along with the object

From
Christian Couder <christian.couder@gmail.com>
Date
Aug 26, 2011, 08:13 UTC
Message-ID
<CAP8UFD1Or8dPVBpAsOwge4o0Lpej2gTs7dQJM0eocbn7EiWVrQ@mail.gmail.com>
In-Reply-To
<4E574D61.8050501@drmicha.warpmail.net>

On Fri, Aug 26, 2011 at 9:38 AM, Michael J Gruber <git@drmicha.warpmail.net> wrote:

Show 24 quoted lines
> 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.

It is an implementation detail, but anyway UI consistency is important and I would suggest the same behavior even if it was implemented in another way. By the way it would be nice to make "git remote" more similar to "git branch", "git tag" and "git replace" while you are at it.

Show 5 quoted lines
>> 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"...
Yeah, but "git branch -v" is decribed like this:
    Show sha1 and commit subject line for each head, along with
relationship to upstream branch (if any). If given twice, print the
name of the upstream branch, as well.

So if you implement it in "git replace" and "git tag", you should at least show the commit subject line too.

Thanks, Christian.

Previous: Michael J GruberNext: Junio C Hamano
Message 7 of 8 in “replace: List replacement along with the object”
  1. replace: List replacement along with the objectMichael J Gruber, Aug 25, 2011
  2. Christian CouderAug 25, 2011
  3. Michael J GruberAug 26, 2011
  4. [PATCHv2] git-replace.txt: Clarify list modeMichael J Gruber, Aug 26, 2011
  5. Junio C HamanoAug 26, 2011
  6. Michael J GruberAug 27, 2011
  7. Christian CouderAug 26, 2011
  8. Junio C HamanoAug 25, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.