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

Re: [PATCH v4] git-rebase--interactive.sh: add config option for custom instruction format

From
Mike Rappazzo <rappazzo@gmail.com>
Date
Jun 12, 2015, 21:12 UTC
Message-ID
<CANoM8SW-N6_yJ0kgGDuGWB+RS-0d54D4FtaRbKqhsf0_fSeMdw@mail.gmail.com>
In-Reply-To
<xmqqa8w4d4sc.fsf@gitster.dls.corp.google.com>

It only needs the '%s' for the autosquash when the todo/instruction list order is determined. For this, in the rearrange_squash function, it will re-calculate the message:

+               test -z "${format}" || message=$(git log -n 1
--format="%s" ${sha1})
Additionally, it may also rerun the log command when preparing the final list.

It is possible that this could be made more efficient by separating the list arrangement from the list presentation. I can look into that for a future patch.

I did add a test which uses the instructionFormat config, and then interactively auto-squashes using both a 'squash! <sha1>' and a 'squash! <comment>'. in the commits.

On Fri, Jun 12, 2015 at 4:56 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 21 quoted lines
> Michael Rappazzo <rappazzo@gmail.com> writes:
>
>> A config option 'rebase.instructionFormat' can override the
>> default 'oneline' format of the rebase instruction list.
>>
>> Since the list is parsed using the left, right or boundary mark plus
>> the sha1, they are prepended to the instruction format.
>>
>> Signed-off-by: Michael Rappazzo <rappazzo@gmail.com>
>> ---
>>  Documentation/git-rebase.txt |  7 +++++++
>>  git-rebase--interactive.sh   | 20 +++++++++++++++++---
>>  t/t3415-rebase-autosquash.sh | 21 +++++++++++++++++++++
>>  3 files changed, 45 insertions(+), 3 deletions(-)
>
> Thanks, will replace.
>
> The autosquash part somehow makes me feel uneasy, though.  The
> feature fundamentally has to have %s as the first thing in the
> format to work, but by making the format overridable, you are
> potentially breaking that feature, aren't you?
Previous: Junio C HamanoNext: Junio C Hamano
Message 4 of 7 in “git-rebase--interactive.sh: add config option for custom instruction format”
  1. git-rebase--interactive.sh: add config option for custom instruction formatMichael Rappazzo, Jun 12, 2015
  2. git-rebase--interactive.sh: add config option for custom instruction formatMichael Rappazzo, Jun 12, 2015
  3. Junio C HamanoJun 12, 2015
  4. Mike RappazzoJun 12, 2015
  5. Junio C HamanoJun 12, 2015
  6. Mike RappazzoJun 12, 2015
  7. Junio C HamanoJun 12, 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.