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

Re: [PATCH 1/5] remove-annotate: change cmd_annotate to cmd_blame

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 4, 2019, 04:04 UTC
Message-ID
<xmqqy2wwz3r2.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<86tv7khgtf.fsf@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 27 quoted lines
> "Abimbola via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
>> Subject: Re: [PATCH 1/5] remove-annotate: change cmd_annotate to cmd_blame
>> From: Abimbola <craftwordltd@gmail.com>
>>
>> Changing this command is to remove the annotate.c file which does almost
>> the same thing as blame.c. git annotate will invoke blame directly
>
> Both the summary and the detailed description of the changes is not
> entirely clean.  What is this 'remove-annotate' subsystem?  Why we would
> want to change cmd_annotate to cmd_blame -- and wouldn't we loose
> difference (in defaults, and thus in output format) between git-blame
> and git-annotate?
>
>>
>> Signed-off-by: Abimbola <craftwordltd@gmail.com>
>
> Why not
>
>   Signed-off-by: Abimbola Olaitan <craftwordltd@gmail.com>
>
>> ---
>>  git.c | 143 +++++++++++++++++++++++++++++++++-------------------------
>>  1 file changed, 82 insertions(+), 61 deletions(-)
>
> Looks like a big change, strangely.  And annotate.c is not actually
> deleted...

Thanks for all the good comments. The first priority of any work in this area is not to lose the different defaults between "annotate" and "blame", as the former has ("had", at least when we invented "blame") known uses in widely used script(s), and the solution we took was to use a small annotate.c shim to tell the blame machinery to emit historical "annotate" output format. If we can do so without having the shim, that would be OK. If removal of shim loses the distinction, then it is not.

I suspect that cmd_blame() can be taught to look at argv[0] and pretend "-c" was given on the command line, and then the command dispatch table can call cmd_blame() upon seeing "annotate" as the subcommand name, but I haven't actually tried it so there may be hidden dragons.

Thanks.
Previous: Jakub NarebskiNext: Abimbola via GitGitGadget
Message 5 of 9 in “Teach git annotate to use parse option instead of its own argv”
  1. 0/5 Teach git annotate to use parse option instead of its own argvAbimbola Olaitan via GitGitGadget, Nov 3, 2019
  2. 2/5 edit the makefileAbimbola via GitGitGadget, Nov 3, 2019
  3. 1/5 remove-annotate: change cmd_annotate to cmd_blameAbimbola via GitGitGadget, Nov 3, 2019
  4. Jakub NarebskiNov 3, 2019
  5. Junio C HamanoNov 4, 2019
  6. 3/5 remove-annotate: comment out annotate BUILDIN_OBJSAbimbola via GitGitGadget, Nov 3, 2019
  7. 5/5 fix unproper comment in MakefileAbimbola via GitGitGadget, Nov 3, 2019
  8. Junio C HamanoNov 4, 2019
  9. 4/5 remove-annotate: delete builtin annotate fileAbimbola via GitGitGadget, Nov 3, 2019

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.