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

Re: [PATCH] log: Do not decorate replacements with --no-replace-objects

From
Michael J Gruber <git@drmicha.warpmail.net>
Date
Aug 25, 2011, 15:08 UTC
Message-ID
<4E566586.5010901@drmicha.warpmail.net>
In-Reply-To
<CACsJy8BOhU7-aTN2TPRRoQ=_mSfbOstXFRfpyoPmrr_Gbqg0pg@mail.gmail.com>
Nguyen Thai Ngoc Duy venit, vidit, dixit 25.08.2011 15:55:
Show 20 quoted lines
> 2011/8/25 Michael J Gruber <git@drmicha.warpmail.net>:
>> Make it so that additionally the use of --no-replace-objects is
>> detected: I.e. replaced commits are only decorated as replaced when they
>> are actually replaced.
> 
> Yeah.. I forgot about this.
> 
>> @@ -95,7 +95,7 @@ static int add_ref_decoration(const char *refname, const unsigned char *sha1, in
>>        struct object *obj;
>>        enum decoration_type type = DECORATION_NONE;
>>
>> -       if (!prefixcmp(refname, "refs/replace/")) {
>> +       if (read_replace_refs && !prefixcmp(refname, "refs/replace/")) {
>>                unsigned char original_sha1[20];
>>                if (get_sha1_hex(refname + 13, original_sha1)) {
>>                        warning("invalid replace ref %s", refname);
> 
> You should put "if (!read_replace_refs) return 0;" inside "if
> (!prefixcmp..", otherwise it'll come to the ref decoration code below
> and my second paragraph in 5267d29's commit message will be reverted.
Right, thanks for checking.
Show 5 quoted lines
> I thought my patch was
>  - simple
>  - replace is rarely used
> therefore neglected the tests. Perhaps you can also add a few tests
> here. It's not that simple after all.

It would take a bit to do so, but this is a fix to a recently introduced feature, so it should go along quickly. v2 upcoming.

Michael
Previous: Nguyen Thai Ngoc DuyNext: Michael J Gruber
Message 3 of 5 in “log: Do not decorate replacements with --no-replace-objects”
  1. log: Do not decorate replacements with --no-replace-objectsMichael J Gruber, Aug 25, 2011
  2. Nguyen Thai Ngoc DuyAug 25, 2011
  3. Michael J GruberAug 25, 2011
  4. [PATCHv2] log: Do not decorate replacements with --no-replace-objectsMichael J Gruber, Aug 25, 2011
  5. 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.