Re: [PATCH v4 1/1] range-diff: treat notes like `log`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 19, 2023, at 21:27, Junio C Hamano wrote:
> Kristoffer Haugsbakk <code@xxxxxxxxxxxxxxx> writes:
>
>> [snip]
>
> Very well described.  I think the rest of the proposed log message
> is redundant now we have quite a good write-up above.

Thanks!

>
>>  ifndef::git-rev-list[]
>> +--show-notes-by-default::
>> +	Show the default notes (see `--notes`) unless subsequent arguments
>> +	are used to display specific notes.
>> +
>>  --notes[=<ref>]::
>>  	Show the notes (see linkgit:git-notes[1]) that annotate the
>>  	commit, when showing the commit log message.  This is the default
>
> I think the new entry should come after the description of `--notes`,
> which is the primary option around the "notes" feature.
>
> In the description, I think "subsequent" is misphrased.  It makes it
> sound as if
>
>     $ git log --show-notes-by-default --notes=amlog
>
> would stop showing the notes from the default notes tree (because
> the notes from the .git/refs/notes/amlog is explicitly asked for),
> while
>
>     $ git log --notes=amlog --show-notes-by-default
>
> would show both the default and the custom notes, which is not what
> the code does, I think, in this hunk:
>
>> @@ -3054,6 +3056,11 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, struct s
>>  	if (revs->expand_tabs_in_log < 0)
>>  		revs->expand_tabs_in_log = revs->expand_tabs_in_log_default;
>>
>> +	if (!revs->show_notes_given && revs->show_notes_by_default) {
>> +		enable_default_display_notes(&revs->notes_opt, &revs->show_notes);
>> +		revs->show_notes_given = 1;
>> +	}
>> +
>>  	return left;
>>  }
>
> Other than the above minor nits, looks very good.
>
> Thanks.

Okay I think I understand. With that in mind I would change it to the
patch below.

I can make a new version if that looks okay.

-- >8 --
diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt
index dcd501ee505..d2df1aad647 100644
--- a/Documentation/pretty-options.txt
+++ b/Documentation/pretty-options.txt
@@ -59,10 +59,6 @@ message by 4 spaces (i.e.  'medium', which is the default, 'full',
 and 'fuller').
 
 ifndef::git-rev-list[]
---show-notes-by-default::
-	Show the default notes (see `--notes`) unless subsequent arguments
-	are used to display specific notes.
-
 --notes[=<ref>]::
 	Show the notes (see linkgit:git-notes[1]) that annotate the
 	commit, when showing the commit log message.  This is the default
@@ -91,6 +87,10 @@ being displayed. Examples: "--notes=foo" will show only notes from
 	"--notes --notes=foo --no-notes --notes=bar" will only show notes
 	from "refs/notes/bar".
 
+--show-notes-by-default::
+	Show the default notes unless arguments are given for displaying
+	specific notes.
+
 --show-notes[=<ref>]::
 --[no-]standard-notes::
 	These options are deprecated. Use the above --notes/--no-notes



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux