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

Re: Suggestion: add author info to TODO list in git-rebase--interactive

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 5, 2015, 19:35 UTC
Message-ID
<xmqq8ubyrlsc.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CANoM8SWX+UVWdV-Aeqqn8DuMf74zUWx=rbEaz3ctNDwa_ZZbeg@mail.gmail.com>
Mike Rappazzo <rappazzo@gmail.com> writes:
> I find that If I am doing a rebase with the intention to squash or
> re-order commits, it is helpful to know the commit author.

There is not a fundamental reason why the remainder of the line after the object name in the rebase insn sheet should not be customizable, and I think your patch is a good first step to identify where that customization should go.

But that is a customization issue, not changing the default and the only format used.

Show 15 quoted lines
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index dc3133f..ec44d41 100644
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -977,7 +977,7 @@ else
>         revisions=$onto...$orig_head
>         shortrevisions=$shorthead
>  fi
> -git rev-list $merges_option --pretty=oneline --reverse --left-right
> --topo-order \
> +git rev-list $merges_option --pretty="%m%h [%an] %x09%s" --reverse
> --left-right --topo-order \
>         $revisions ${restrict_revision+^$restrict_revision} | \
>         sed -n "s/^>//p" |
>  while read -r sha1 rest

This is nothing new, and it may not even be a problem, but why do we use --left-right and then filter with sed? Does this part of the code predate --left-only, I wonder. I'd probably write

	git log --format="%h	%s" --left-only .....
with today's Git, but perhaps I am missing something?
> The problem, as I see it is that the original '--pretty=oneline' only
> produces a single line of output (of course).  However, the changed
> version '--pretty="%m%h [%an] %x09%s"' produces multiple lines.

Shouldn't you be using tformat, not format, if you are doing a oneline emulation?

Previous: Mike RappazzoNext: Eric Sunshine
Message 2 of 5 in “Suggestion: add author info to TODO list in git-rebase--interactive”
  1. Mike RappazzoJun 5, 2015
  2. Junio C HamanoJun 5, 2015
  3. Eric SunshineJun 5, 2015
  4. Mike RappazzoJun 6, 2015
  5. Junio C HamanoJun 7, 2015

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.