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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:05:17

Michael Rappazzo [off-list ref] 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 <redacted>
---
 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?

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

From: Mike Rappazzo <hidden>
Date: 2016-06-15 23:05:17

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 [off-list ref] wrote:
Michael Rappazzo [off-list ref] writes:
quoted
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 <redacted>
---
 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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help