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 7, 2015, 06:14 UTC
Message-ID
<xmqq6170dozg.fsf@gitster.dls.corp.google.com>
In-Reply-To
<CANoM8SXnTU5bnyLKUUYEtnug89cC9cN3AU3E07qUmk85teamLw@mail.gmail.com>
Mike Rappazzo <rappazzo@gmail.com> writes:
Show 11 quoted lines
> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
> index dc3133f..e2d5ffc 100644
> --- a/git-rebase--interactive.sh
> +++ b/git-rebase--interactive.sh
> @@ -977,7 +977,18 @@ else
>   revisions=$onto...$orig_head
>   shortrevisions=$shorthead
>  fi
> -git rev-list $merges_option --pretty=oneline --reverse --left-right
> --topo-order \
> +custom_format=$(git config --get rebase.interactive.todo-format)

We use three-level names only when we need an unbounded end-user supplied things (e.g. nickname for remotes in "remote.*.url", description for a branch in "branch.*.description"). "interactive" is not such a token, so a two-level name, e.g. "rebase.insnformat" or something like that. Also core Git avoids variable names with "-" in them.

Show 10 quoted lines
> +if test -z "$custom_format"
> +then
> +   custom_format="oneline"
> +else
> +   # the custom format MUST start with %m%h or %m%H
> + if test "${custom_format:0:5}" != '%m%h '
> +   then
> +      custom_format="%m%h ${custom_format}"
> +   fi
> +fi

Why not allow them to *ONLY* set what follows '%m%h '? That is, if they say '%m%h %s', give them '%m%h %m%h %s', by unconditionally prepend '%m%h '. That way you do not need these conditional.

Something along the lines of...
        format=$(git config rebase.insnFormat)
        if test -z "$format"
        then
                format="%m%h	%s"
        else
                format="%m%h	$format"
        fi
        git rev-list $merge_option --format="$format" --reverse \
                --topo-order --left-right \
                ...
> ...  I also tried changing the
> '--left-right' to '--left-only', but that seemed to not produce any
> results.
Wouldn't we want right side of the symmetric difference, though?
Previous: Mike Rappazzo
Message 5 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.