All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Mike Rappazzo <rappazzo@gmail.com>
Cc: Eric Sunshine <sunshine@sunshineco.com>, Git List <git@vger.kernel.org>
Subject: Re: Suggestion: add author info to TODO list in git-rebase--interactive
Date: Sat, 06 Jun 2015 23:14:27 -0700	[thread overview]
Message-ID: <xmqq6170dozg.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CANoM8SXnTU5bnyLKUUYEtnug89cC9cN3AU3E07qUmk85teamLw@mail.gmail.com> (Mike Rappazzo's message of "Fri, 5 Jun 2015 21:00:51 -0400")

Mike Rappazzo <rappazzo@gmail.com> writes:

> 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.

> +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?

      reply	other threads:[~2015-06-07  6:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05 19:00 Suggestion: add author info to TODO list in git-rebase--interactive Mike Rappazzo
2015-06-05 19:35 ` Junio C Hamano
2015-06-05 19:39   ` Eric Sunshine
2015-06-06  1:00     ` Mike Rappazzo
2015-06-07  6:14       ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq6170dozg.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=rappazzo@gmail.com \
    --cc=sunshine@sunshineco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.