Skip to contentSkip to conversation

t/lib-rebase: (mostly) cosmetic improvements to set_fake_editor()

PATCH In review Oswald Buddenhagen 4 participants 22 messages Mar 23, 2023 – Aug 10, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 t/lib-rebase: (mostly) cosmetic improvements to set_fake_editor()

- Make the documentation reflect better what actually happens, and add some missing info
- Fix recognition of reset's short command in FAKE_LINES
- Default next action after 'fakesha' to preserving the command instead of forcing 'pick'. This is consistent with other "instant-effect" keywords.

---
 t/lib-rebase.sh | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
t/lib-rebase.sh +14 -11
index 7ca5b918f0..184b25b427 100644
@@ -8,18 +8,21 @@
 # - check that non-commit messages have a certain line count with $EXPECT_COUNT
 # - check the commit count in the commit message header with $EXPECT_HEADER_COUNT
 # - rewrite a rebase -i script as directed by $FAKE_LINES.
-#   $FAKE_LINES consists of a sequence of words separated by spaces.
-#   The following word combinations are possible:
+#   $FAKE_LINES consists of a sequence of words separated by spaces;
+#   spaces inside the words are encoded as underscores.
+#   The following words are possible:
 #
-#   "<lineno>" -- add a "pick" line with the SHA1 taken from the
-#       specified line.
+#   "<cmd>" -- override the command for the next line specification. Can be
+#       "pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword",
+#       "drop", "merge[_-{c|C}_<SHA1>]", or "bad" for an invalid command.
 #
-#   "<cmd> <lineno>" -- add a line with the specified command
-#       ("pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword" or "drop")
-#       and the SHA1 taken from the specified line.
+#   "<lineno>" -- add a command, using the specified line as a template.
+#       If the command has not been overridden, the line will be copied
+#       verbatim, usually resulting in a "pick" line.
 #
-#   "_" -- add a space, like "fixup_-C" implies "fixup -C" and
-#       "exec_cmd_with_args" add an "exec cmd with args" line.
+#   "fakesha" -- add a command ("pick" by default), using a fake SHA1.
+#
+#   "exec_[...]", "break" -- add the specified command.
 #
 #   "#" -- Add a comment line.
 #
@@ -49,7 +52,7 @@ set_fake_editor () {
 	action=\&
 	for line in $FAKE_LINES; do
 		case $line in
-		pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|r|merge|m)
+		pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|t|merge|m)
 			action="$line";;
 		exec_*|x_*|break|b)
 			echo "$line" | sed 's/_/ /g' >> "$1";;
@@ -64,7 +67,7 @@ set_fake_editor () {
 		fakesha)
 			test \& != "$action" || action=pick
 			echo "$action XXXXXXX False commit" >> "$1"
-			action=pick;;
+			action=\&;;
 		*)
 			sed -n "${line}s/^[a-z][a-z]*/$action/p" < "$1".tmp >> "$1"
 			action=\&;;
Signature · 1 line
2.40.0.152.g15d061e6df
#2 lore raw
Quoted 3 lines · Oswald Buddenhagen

ping!

(also on three other unanswered patches from the same day.)

I would be a wrong person to ping.

    $ git shortlog -n -s --since=18.months --no-merges master -- t/lib-rebase.sh
         2	Phillip Wood
         1	Derrick Stolee

Running "git blame" on the lines the patch touched may give you folks who may know better than these two but those who made contributions long time ago whose contributions still survive to this day may no longer be around in the project, so your mileage may vary.

"git blame" for the line that uses "action=\&" finds 5dcdd740 (t/lib-rebase: prepare for testing git rebase --rebase-merges, 2019-07-31) and explains why "pick" was changed to "\&", so adding the author of that patch to the list of people you ask reviews for may also be a good idea.

HTH for you to find appropriate reviewers better next time.

Thanks.

#3 lore raw
Quoted 11 lines · Junio C Hamano
Quoted 3 lines · Oswald Buddenhagen

ping!

(also on three other unanswered patches from the same day.)

I would be a wrong person to ping.

    $ git shortlog -n -s --since=18.months --no-merges master -- t/lib-rebase.sh
         2	Phillip Wood
         1	Derrick Stolee

Also:

https://github.com/felipec/git-related

Signature · 1 line
Felipe Contreras
#4 lore raw
In reply to Oswald Buddenhagen

Hi Oswald

On 23/03/2023 16:22, Oswald Buddenhagen wrote:

This project avoids commit messages that are a list of changes instead preferring the commit message to explain _why_ the changes are being made. The reason for this is that it makes it much easier for a future contributor to understand the reasoning behind a particular change. Having a list of changes is often a symptom that the commit is trying to do more than one thing at once and should be split up. Here there are three separate changes all mixed into the same commit.

Quoted 2 lines

- Make the documentation reflect better what actually happens, and add some missing info

Having read the proposed changes to the documentation I'm not sure what it is in the original you're objecting to. The script may well process each token separately but as far as the user is concerned it appears to take either "<cmd> <lineno>" or "<lineno>"

Quoted 1 line

- Fix recognition of reset's short command in FAKE_LINES

This fix is definitely needed and should be in its own commit in a separate series to any of the other changes here so it can be applied without being held up by discussions on those other changes. Presumably we don't have any users of the short reset command name as it has been broken ever since it was introduced in 5dcdd7409a (t/lib-rebase: prepare for testing git rebase --rebase-merges, 2019-07-31)

Quoted 3 lines

- Default next action after 'fakesha' to preserving the command instead of forcing 'pick'. This is consistent with other "instant-effect" keywords.

I'm not sure what the motivation for this change is. What does it facilitate that we cannot do now and why do we want to do whatever that is?

Best Wishes

Phillip

Quoted 58 lines
---
  t/lib-rebase.sh | 25 ++++++++++++++-----------
  1 file changed, 14 insertions(+), 11 deletions(-)
t/lib-rebase.sh +14 -11
index 7ca5b918f0..184b25b427 100644
@@ -8,18 +8,21 @@
  # - check that non-commit messages have a certain line count with $EXPECT_COUNT
  # - check the commit count in the commit message header with $EXPECT_HEADER_COUNT
  # - rewrite a rebase -i script as directed by $FAKE_LINES.
-#   $FAKE_LINES consists of a sequence of words separated by spaces.
-#   The following word combinations are possible:
+#   $FAKE_LINES consists of a sequence of words separated by spaces;
+#   spaces inside the words are encoded as underscores.
+#   The following words are possible:
  #
-#   "<lineno>" -- add a "pick" line with the SHA1 taken from the
-#       specified line.
+#   "<cmd>" -- override the command for the next line specification. Can be
+#       "pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword",
+#       "drop", "merge[_-{c|C}_<SHA1>]", or "bad" for an invalid command.
  #
-#   "<cmd> <lineno>" -- add a line with the specified command
-#       ("pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword" or "drop")
-#       and the SHA1 taken from the specified line.
+#   "<lineno>" -- add a command, using the specified line as a template.
+#       If the command has not been overridden, the line will be copied
+#       verbatim, usually resulting in a "pick" line.
  #
-#   "_" -- add a space, like "fixup_-C" implies "fixup -C" and
-#       "exec_cmd_with_args" add an "exec cmd with args" line.
+#   "fakesha" -- add a command ("pick" by default), using a fake SHA1.
+#
+#   "exec_[...]", "break" -- add the specified command.
  #
  #   "#" -- Add a comment line.
  #
@@ -49,7 +52,7 @@ set_fake_editor () {
  	action=\&
  	for line in $FAKE_LINES; do
  		case $line in
-		pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|r|merge|m)
+		pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|t|merge|m)
  			action="$line";;
  		exec_*|x_*|break|b)
  			echo "$line" | sed 's/_/ /g' >> "$1";;
@@ -64,7 +67,7 @@ set_fake_editor () {
  		fakesha)
  			test \& != "$action" || action=pick
  			echo "$action XXXXXXX False commit" >> "$1"
-			action=pick;;
+			action=\&;;
  		*)
  			sed -n "${line}s/^[a-z][a-z]*/$action/p" < "$1".tmp >> "$1"
  			action=\&;;
#5 lore raw

cover t/lib-rebase: (mostly) cosmetic improvements to set_fake_editor()

An update to the documentation, and two minor functional changes that don't actually change anything given current use cases, and are therefore basically documentation updates as well.

Oswald Buddenhagen (3):
t/lib-rebase: set_fake_editor(): fix recognition of reset's short
command
t/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistently t/lib-rebase: improve documentation of set_fake_editor()

 t/lib-rebase.sh | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)
Signature · 1 line
2.40.0.152.g15d061e6df
#6 lore raw

PATCH 1/3 t/lib-rebase: set_fake_editor(): fix recognition of reset's short command

... in FAKE_LINES.

This has been broken ever since it was introduced in 5dcdd7409a (t/lib-rebase: prepare for testing git rebase --rebase-merges, 2019-07-31), but it's not actually used, so it's a cosmetic defect only.

---
Cc: Phillip Wood <[email protected]>

---
 t/lib-rebase.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/lib-rebase.sh +1 -1
index 7ca5b918f0..e6179ab529 100644
@@ -49,7 +49,7 @@ set_fake_editor () {
 	action=\&
 	for line in $FAKE_LINES; do
 		case $line in
-		pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|r|merge|m)
+		pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|t|merge|m)
 			action="$line";;
 		exec_*|x_*|break|b)
 			echo "$line" | sed 's/_/ /g' >> "$1";;
Signature · 1 line
2.40.0.152.g15d061e6df
#7 lore raw

Re: [PATCH 1/3] t/lib-rebase: set_fake_editor(): fix recognition of reset's short command

Quoted 6 lines · Oswald Buddenhagen

... in FAKE_LINES.

This has been broken ever since it was introduced in 5dcdd7409a (t/lib-rebase: prepare for testing git rebase --rebase-merges, 2019-07-31), but it's not actually used, so it's a cosmetic defect only.

Sharp eyes. And this makes the list match what is actually used and defined in sequencer.c which is good.

Thanks.

Quoted 21 lines

---
Cc: Phillip Wood <[email protected]>

---
 t/lib-rebase.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/lib-rebase.sh +1 -1
index 7ca5b918f0..e6179ab529 100644
@@ -49,7 +49,7 @@ set_fake_editor () {
 	action=\&
 	for line in $FAKE_LINES; do
 		case $line in
-		pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|r|merge|m)
+		pick|p|squash|s|fixup|f|edit|e|reword|r|drop|d|label|l|reset|t|merge|m)
 			action="$line";;
 		exec_*|x_*|break|b)
 			echo "$line" | sed 's/_/ /g' >> "$1";;
#8 lore raw

PATCH 2/3 t/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistently

In reply to Oswald Buddenhagen

Default next action after 'fakesha' to preserving the command instead of forcing 'pick', consistently with other "instant-effect" keywords. There is no reason why one would want that inconsistency, so this was clearly just an oversight in commit 5dcdd740 ("t/lib-rebase: prepare for testing git rebase --rebase-merges"). Rectifying it makes the behavior easier to reason about and document.

This would affect hypothetical "fakesha <n>" sequences where line <n> already isn't a pick, which currently don't appear.

---
Cc: Phillip Wood <[email protected]>

---
 t/lib-rebase.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
t/lib-rebase.sh +1 -1
index e6179ab529..9ed87ca7ab 100644
@@ -64,7 +64,7 @@ set_fake_editor () {
 		fakesha)
 			test \& != "$action" || action=pick
 			echo "$action XXXXXXX False commit" >> "$1"
-			action=pick;;
+			action=\&;;
 		*)
 			sed -n "${line}s/^[a-z][a-z]*/$action/p" < "$1".tmp >> "$1"
 			action=\&;;
Signature · 1 line
2.40.0.152.g15d061e6df
#9 lore raw

Re: [PATCH 2/3] t/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistently

Quoted 10 lines · Oswald Buddenhagen

Default next action after 'fakesha' to preserving the command instead of forcing 'pick', consistently with other "instant-effect" keywords. There is no reason why one would want that inconsistency, so this was clearly just an oversight in commit 5dcdd740 ("t/lib-rebase: prepare for testing git rebase --rebase-merges"). Rectifying it makes the behavior easier to reason about and document.

This would affect hypothetical "fakesha <n>" sequences where line <n> already isn't a pick, which currently don't appear.

Quoted 6 lines

---
Cc: Phillip Wood <[email protected]>

---
 t/lib-rebase.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

I do recall seeing this change and remember wondering what the fallout from this change would be. So relative to the previous round, the above is a definite improvement to clearly state that no test that is currently in the codebase is affected by this change.

As to the change itself, I do not much care among (1) what this patch does, (2) doing nothing, or (3) barf when the action is not a pick. At least, having this step separate from other changes like this round of the series does is a very good thing---when somebody with more knowledge and stake in what the fake-editor does appears and explains why forcing pick is a good idea, we can easily revert only this step.

Will queue as-is together with the other two patches.

Thanks.

Quoted 13 lines
t/lib-rebase.sh +1 -1
index e6179ab529..9ed87ca7ab 100644
@@ -64,7 +64,7 @@ set_fake_editor () {
 		fakesha)
 			test \& != "$action" || action=pick
 			echo "$action XXXXXXX False commit" >> "$1"
-			action=pick;;
+			action=\&;;
 		*)
 			sed -n "${line}s/^[a-z][a-z]*/$action/p" < "$1".tmp >> "$1"
 			action=\&;;
#10 lore raw

PATCH 3/3 t/lib-rebase: improve documentation of set_fake_editor()

In reply to Oswald Buddenhagen

- Make it reflect better what actually happens. This makes it easier to fully exploit the possibilities and to modify the code.
- Improve the structure, putting more general info further up.
- Document fakesha and break.

---
Cc: Phillip Wood <[email protected]>

---
 t/lib-rebase.sh | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
t/lib-rebase.sh +12 -9
index 9ed87ca7ab..184b25b427 100644
@@ -8,18 +8,21 @@
 # - check that non-commit messages have a certain line count with $EXPECT_COUNT
 # - check the commit count in the commit message header with $EXPECT_HEADER_COUNT
 # - rewrite a rebase -i script as directed by $FAKE_LINES.
-#   $FAKE_LINES consists of a sequence of words separated by spaces.
-#   The following word combinations are possible:
+#   $FAKE_LINES consists of a sequence of words separated by spaces;
+#   spaces inside the words are encoded as underscores.
+#   The following words are possible:
 #
-#   "<lineno>" -- add a "pick" line with the SHA1 taken from the
-#       specified line.
+#   "<cmd>" -- override the command for the next line specification. Can be
+#       "pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword",
+#       "drop", "merge[_-{c|C}_<SHA1>]", or "bad" for an invalid command.
 #
-#   "<cmd> <lineno>" -- add a line with the specified command
-#       ("pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword" or "drop")
-#       and the SHA1 taken from the specified line.
+#   "<lineno>" -- add a command, using the specified line as a template.
+#       If the command has not been overridden, the line will be copied
+#       verbatim, usually resulting in a "pick" line.
 #
-#   "_" -- add a space, like "fixup_-C" implies "fixup -C" and
-#       "exec_cmd_with_args" add an "exec cmd with args" line.
+#   "fakesha" -- add a command ("pick" by default), using a fake SHA1.
+#
+#   "exec_[...]", "break" -- add the specified command.
 #
 #   "#" -- Add a comment line.
 #
Signature · 1 line
2.40.0.152.g15d061e6df
#11 lore raw

Re: [PATCH 3/3] t/lib-rebase: improve documentation of set_fake_editor()

Hi Oswald

Thanks for splitting these patches up. We generally prefer commits message to be prose explaining the reason for the change rather than bullet points.

Quoted 4 lines · Oswald Buddenhagen

- Make it reflect better what actually happens.

This makes it easier to
fully exploit the possibilities and to modify the code.

I don't really see how this follows from the first sentence.

Quoted 1 line

- Improve the structure, putting more general info further up.

Good idea

Quoted 1 line

- Document fakesha and break.

Great

Quoted 16 lines

---
Cc: Phillip Wood <[email protected]>

---
  t/lib-rebase.sh | 21 ++++++++++++---------
  1 file changed, 12 insertions(+), 9 deletions(-)
t/lib-rebase.sh +0 -1
index 9ed87ca7ab..184b25b427 100644
@@ -8,18 +8,21 @@
  # - check that non-commit messages have a certain line count with $EXPECT_COUNT
  # - check the commit count in the commit message header with $EXPECT_HEADER_COUNT
  # - rewrite a rebase -i script as directed by $FAKE_LINES.
-#   $FAKE_LINES consists of a sequence of words separated by spaces.

t/lib-rebase.sh line 17

Quoted 10 lines
t/lib-rebase.sh +6 -3
-#   The following word combinations are possible:
+#   $FAKE_LINES consists of a sequence of words separated by spaces;
+#   spaces inside the words are encoded as underscores.
+#   The following words are possible:
  #
-#   "<lineno>" -- add a "pick" line with the SHA1 taken from the
-#       specified line.
+#   "<cmd>" -- override the command for the next line specification. Can be
+#       "pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword",
+#       "drop", "merge[_-{c|C}_<SHA1>]", 

There is an inconsistency here in how we document fixup and merge. The former explicitly lists all possibilities and the latter uses a more compact notation. Note that we use docopt style descriptions for options so "{c|C}" would be written as "(c|C)". Also "merge -c/C" takes a commitish (which we could write as <rev>" rather than a hex object ID.

Quoted 1 line

or "bad" for an invalid command.

This is a useful addition

t/lib-rebase.sh line 25

Quoted 12 lines
t/lib-rebase.sh +6 -5
-#   "<cmd> <lineno>" -- add a line with the specified command
-#       ("pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword" or "drop")
-#       and the SHA1 taken from the specified line.
+#   "<lineno>" -- add a command, using the specified line as a template.
+#       If the command has not been overridden, the line will be copied
+#       verbatim, usually resulting in a "pick" line.
  #
-#   "_" -- add a space, like "fixup_-C" implies "fixup -C" and
-#       "exec_cmd_with_args" add an "exec cmd with args" line.
+#   "fakesha" -- add a command ("pick" by default), using a fake SHA1.
+#
+#   "exec_[...]", "break" -- add the specified command.

Something like

	exec[_<command ...>]

would be more accurate I think

I think with a couple of tweaks this would be worthwhile improvement to the documentation. Having comprehensive coverage of all the commands is very welcome.

Thanks

Phillip

#12 lore raw

v2 cover t/lib-rebase: (mostly) cosmetic improvements to set_fake_editor()

An update to the documentation, and two minor functional changes that don't actually change anything given current use cases, and are therefore basically documentation updates as well.

Oswald Buddenhagen (1):
t/lib-rebase: improve documentation of set_fake_editor()

 t/lib-rebase.sh | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
Signature · 1 line
2.40.0.152.g15d061e6df
#13 lore raw

PATCH v2 1/1 t/lib-rebase: improve documentation of set_fake_editor()

Firstly, make it reflect better what actually happens. Not omitting some possibilities makes it easier to fully exploit them, and not contradicting the implementation makes it easier to grok and thus modify the code.

Secondly, improve the overall structure, putting more general info further up.

Thirdly, document merge, fakesha, and break, which were previously omitted entirely.

---
v2:
- everything phillip asked for, i think. of course, it's still bullet points, just without the punctuation - i wouldn't know what else to do about it which would be an actual improvement.

Cc Phillip Wood <[email protected]>
---
 t/lib-rebase.sh | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
t/lib-rebase.sh +12 -9
index 7ca5b918f0..133c856992 100644
@@ -8,18 +8,21 @@
 # - check that non-commit messages have a certain line count with $EXPECT_COUNT
 # - check the commit count in the commit message header with $EXPECT_HEADER_COUNT
 # - rewrite a rebase -i script as directed by $FAKE_LINES.
-#   $FAKE_LINES consists of a sequence of words separated by spaces.
-#   The following word combinations are possible:
+#   $FAKE_LINES consists of a sequence of words separated by spaces;
+#   spaces inside the words are encoded as underscores.
+#   The following words are possible:
 #
-#   "<lineno>" -- add a "pick" line with the SHA1 taken from the
-#       specified line.
+#   "<cmd>" -- override the command for the next line specification. Can be
+#       "pick", "squash", "fixup[_-(c|C)]", "edit", "reword", "drop",
+#       "merge[_-{c|C}_<rev>]", or "bad" for an invalid command.
 #
-#   "<cmd> <lineno>" -- add a line with the specified command
-#       ("pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword" or "drop")
-#       and the SHA1 taken from the specified line.
+#   "<lineno>" -- add a command, using the specified line as a template.
+#       If the command has not been overridden, the line will be copied
+#       verbatim, usually resulting in a "pick" line.
 #
-#   "_" -- add a space, like "fixup_-C" implies "fixup -C" and
-#       "exec_cmd_with_args" add an "exec cmd with args" line.
+#   "fakesha" -- add a command ("pick" by default), using a fake SHA1.
+#
+#   "exec_[command...]", "break" -- add the specified command.
 #
 #   "#" -- Add a comment line.
 #
Signature · 1 line
2.40.0.152.g15d061e6df
#14 lore raw

Re: [PATCH v2 1/1] t/lib-rebase: improve documentation of set_fake_editor()

Quoted 11 lines · Oswald Buddenhagen

Firstly, make it reflect better what actually happens. Not omitting some possibilities makes it easier to fully exploit them, and not contradicting the implementation makes it easier to grok and thus modify the code.

Secondly, improve the overall structure, putting more general info further up.

Thirdly, document merge, fakesha, and break, which were previously omitted entirely.

Quoted 7 lines

---
v2:
- everything phillip asked for, i think. of course, it's still bullet points, just without the punctuation - i wouldn't know what else to do about it which would be an actual improvement.

If more bits are spent for the explanation of concrete changes (like "move general info first and then describe details") that back subjective claims (e.g. make it "better", "improve" the structure), the result probably would read better. Readers do not have to take your word on it that the result is "better", but at least would understand the reason why you think the result is "better" and can agree (or disagree) more easily.

I am not Phillip but to me what you wrote in the above look clear enough. Thanks for working on it.

Quoted 40 lines
Cc Phillip Wood <[email protected]>
---
 t/lib-rebase.sh | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
t/lib-rebase.sh +12 -9
index 7ca5b918f0..133c856992 100644
@@ -8,18 +8,21 @@
 # - check that non-commit messages have a certain line count with $EXPECT_COUNT
 # - check the commit count in the commit message header with $EXPECT_HEADER_COUNT
 # - rewrite a rebase -i script as directed by $FAKE_LINES.
-#   $FAKE_LINES consists of a sequence of words separated by spaces.
-#   The following word combinations are possible:
+#   $FAKE_LINES consists of a sequence of words separated by spaces;
+#   spaces inside the words are encoded as underscores.
+#   The following words are possible:
 #
-#   "<lineno>" -- add a "pick" line with the SHA1 taken from the
-#       specified line.
+#   "<cmd>" -- override the command for the next line specification. Can be
+#       "pick", "squash", "fixup[_-(c|C)]", "edit", "reword", "drop",
+#       "merge[_-{c|C}_<rev>]", or "bad" for an invalid command.
 #
-#   "<cmd> <lineno>" -- add a line with the specified command
-#       ("pick", "squash", "fixup"|"fixup_-C"|"fixup_-c", "edit", "reword" or "drop")
-#       and the SHA1 taken from the specified line.
+#   "<lineno>" -- add a command, using the specified line as a template.
+#       If the command has not been overridden, the line will be copied
+#       verbatim, usually resulting in a "pick" line.
 #
-#   "_" -- add a space, like "fixup_-C" implies "fixup -C" and
-#       "exec_cmd_with_args" add an "exec cmd with args" line.
+#   "fakesha" -- add a command ("pick" by default), using a fake SHA1.
+#
+#   "exec_[command...]", "break" -- add the specified command.
 #
 #   "#" -- Add a comment line.
 #
#15 lore raw

Re: [PATCH v2 1/1] t/lib-rebase: improve documentation of set_fake_editor()

In reply to Oswald Buddenhagen

Hi Oswald

Quoted 4 lines · Oswald Buddenhagen

Firstly, make it reflect better what actually happens. Not omitting some possibilities makes it easier to fully exploit them, and not contradicting the implementation makes it easier to grok and thus modify the code.

Thanks for expanding this first point, the new message looks fine to me. The code changes look good apart from one change in the that got missed.

t/lib-rebase.sh line 17

Quoted 5 lines
t/lib-rebase.sh +3 -2
-#   "<lineno>" -- add a "pick" line with the SHA1 taken from the
-#       specified line.
+#   "<cmd>" -- override the command for the next line specification. Can be
+#       "pick", "squash", "fixup[_-(c|C)]", "edit", "reword", "drop",
+#       "merge[_-{c|C}_<rev>]", or "bad" for an invalid command.

This is still using "{}" in the merge documentation rather than "()" like the new fixup docs.

Thanks

Phillip

#16 lore raw

Re: [PATCH v2 1/1] t/lib-rebase: improve documentation of set_fake_editor()

Quoted 21 lines · Phillip Wood

Hi Oswald

Quoted 4 lines · Oswald Buddenhagen

Firstly, make it reflect better what actually happens. Not omitting some possibilities makes it easier to fully exploit them, and not contradicting the implementation makes it easier to grok and thus modify the code.

Thanks for expanding this first point, the new message looks fine to me. The code changes look good apart from one change in the that got missed.

t/lib-rebase.sh line 17

Quoted 5 lines
t/lib-rebase.sh +3 -2
-#   "<lineno>" -- add a "pick" line with the SHA1 taken from the
-#       specified line.
+#   "<cmd>" -- override the command for the next line specification. Can be
+#       "pick", "squash", "fixup[_-(c|C)]", "edit", "reword", "drop",
+#       "merge[_-{c|C}_<rev>]", or "bad" for an invalid command.

This is still using "{}" in the merge documentation rather than "()" like the new fixup docs.

Quoted 1 line

Thanks

Ah, thanks for sharp eyes. I can locally tweak these two bytes ;-)

#17 lore raw
In reply to Oswald Buddenhagen
Quoted 9 lines · Oswald Buddenhagen

An update to the documentation, and two minor functional changes that don't actually change anything given current use cases, and are therefore basically documentation updates as well.

Oswald Buddenhagen (1):
t/lib-rebase: improve documentation of set_fake_editor()

 t/lib-rebase.sh | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

Now I lost track. This is slightly different from one of the steps in the three-patch series. Were the other two steps retracted?

My time quota today to pick up newly sent patches has run out, and we will be in pre-release freeze period any time now, so there is no need for an immediate response, but please help readers easily see which ones are proposed updates that are still surviving.

Thanks.

#18 lore raw
Quoted 6 lines · Junio C Hamano
Quoted 4 lines · Oswald Buddenhagen

An update to the documentation, and two minor functional changes that don't actually change anything given current use cases, and are therefore basically documentation updates as well.

Quoted 9 lines
Quoted 5 lines

Oswald Buddenhagen (1):
t/lib-rebase: improve documentation of set_fake_editor()

 t/lib-rebase.sh | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

Now I lost track. This is slightly different from one of the steps in the three-patch series. Were the other two steps retracted?

no, this cover letter was a messup on my side, caused by a lack of attention and still suboptimal tooling. this was meant to be an update to just this one commit, while keeping the other two intact.

regards

#19 lore raw
Quoted 13 lines · Oswald Buddenhagen
Quoted 12 lines · Junio C Hamano
Quoted 9 lines · Oswald Buddenhagen

An update to the documentation, and two minor functional changes that don't actually change anything given current use cases, and are therefore basically documentation updates as well.

Oswald Buddenhagen (1):
t/lib-rebase: improve documentation of set_fake_editor()

 t/lib-rebase.sh | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)
Quoted 6 lines
Quoted 3 lines

Now I lost track. This is slightly different from one of the steps in the three-patch series. Were the other two steps retracted?

no, this cover letter was a messup on my side, caused by a lack of attention and still suboptimal tooling. this was meant to be an update to just this one commit, while keeping the other two intact.

I see. It is a bit too late for today's integration cycle to resurrect the other two I have discarded, because I have other things to do including the -rc1 release engineering, but I can easily go back to the list archive.

For future reference, in this project, we do not generally replace only a single patch in a three-patch series [*]. We do not want to deal with a mixture of [PATCH v1 1/3], [PATCH v3 2/3], [PATCH v2 3/3], especially since during the evolution of a series, new patches may become needed, a patch may become split into two, etc. Instead everything gets the new iteration number, i.e. v1 and v2 of patches 1/3 and 3/3 may be identical and only 2/3 may have differences between its v1 and v2. And that is perfectly expected around here.

Thanks.

[Footnote]

* Of course there are execeptions. When it is obvious to everybody that the series is more or less done and all things that need to be discussed have been discussed during the review, and the review conclusion is that everything in v4 patch is good except for this minor change necessary in one patch, it would be a good approach to send just a single message, saying "here is to replace step 2 of the 7 patches" under the three-dash line and marking it as [PATCH v5 2/7] (or "v4bis" or any other marking that makes it clear it is the "latest").

#20 lore raw
Quoted 8 lines · Junio C Hamano
Quoted 3 lines

no, this cover letter was a messup on my side, caused by a lack of attention and still suboptimal tooling. this was meant to be an update to just this one commit, while keeping the other two intact.

I see. It is a bit too late for today's integration cycle to resurrect the other two I have discarded, because I have other things to do including the -rc1 release engineering, but I can easily go back to the list archive.

Now I did, so instead of queuing this as a replacement of the three, one of the three from the earlier has been replaced with this, and the push-out of tomorrow will have them in 'seen'.

This piece-meal replacement may break threading on the mailing list but if we ever need v3 and later for this topic, we will see the entire set resent (hopefully), so the problem will correct itself. Also if everybody is happy with all three patches, we may not need v3 ;-)

Thanks.

#21 lore raw
In reply to Oswald Buddenhagen
Quoted 3 lines · Oswald Buddenhagen

An update to the documentation, and two minor functional changes that don't actually change anything given current use cases, and are therefore basically documentation updates as well.

Thanks for re-rolling. I've left a couple of comments on the third patch, I don't have anything to add to Junio's comments on the first two.

Best Wishes

Phillip

Quoted 9 lines

Oswald Buddenhagen (3):
t/lib-rebase: set_fake_editor(): fix recognition of reset's short
command
t/lib-rebase: set_fake_editor(): handle FAKE_LINES more consistently t/lib-rebase: improve documentation of set_fake_editor()

  t/lib-rebase.sh | 25 ++++++++++++++-----------
  1 file changed, 14 insertions(+), 11 deletions(-)