[PATCH v1 0/3] fixup fixup documenation

STALE3657d

4 messages, 1 author, 2016-08-14 · open the first message on its own page

[PATCH v1 0/3] fixup fixup documenation

From: Philip Oakley <hidden>
Date: 2016-08-14 21:46:49

With the review of the list's workflow, and failings in my personal
workflow, I asked a couple of questions about fixup and discovered
that my reading of the man pages hadn't provided the illumination
they hope to give. 

Here's three little documenation patches, and some queries to go
with them.

Philip Oakley (3):
  doc: commit: --fixup/--squash can take a commit revision
  doc: rebase: fixup! can take an object name
  doc: rebase: clarify fixup! fixup! constraint

 Documentation/git-commit.txt | 8 ++++----
 Documentation/git-rebase.txt | 9 +++++----
 2 files changed, 9 insertions(+), 8 deletions(-)

-- 
2.9.0.windows.1

[PATCH v1 1/3] doc: commit: --fixup/--squash can take a commit revision

From: Philip Oakley <hidden>
Date: 2016-08-14 21:46:45

Be clearer that the --fixup/--squash options can take any of the
gitrevisions methods of specifying a commit, not just a 'hash'.

Signed-off-by: Philip Oakley <redacted>
---
v1
It's not immediately obvious what different forms the <commit>
option can take. Spell out, and refer to the git revisions guide,
that any of the revision methods will work.

On a side note, if one looks at the glossary, a <commit> links to
<commit object> which links to <object> (and only tangentially
"about" revisions) which then says "uniquely identified by the SHA-1",
so it is easy to think one should use the sha1 here.

I only discovered this misunderstanding while following up
other parts of this series!
---
 Documentation/git-commit.txt | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
index e704953..3600929 100644
--- a/Documentation/git-commit.txt
+++ b/Documentation/git-commit.txt
@@ -81,15 +81,15 @@ OPTIONS
 --fixup=<commit>::
 	Construct a commit message for use with `rebase --autosquash`.
 	The commit message will be the subject line from the specified
-	commit with a prefix of "fixup! ".  See linkgit:git-rebase[1]
-	for details.
+	commit revision with a prefix of "fixup! ".  See linkgit:git-rebase[1]
+	and linkgit:gitrevisions[7] for details.
 
 --squash=<commit>::
 	Construct a commit message for use with `rebase --autosquash`.
 	The commit message subject line is taken from the specified
-	commit with a prefix of "squash! ".  Can be used with additional
+	commit revision with a prefix of "squash! ".  Can be used with additional
 	commit message options (`-m`/`-c`/`-C`/`-F`). See
-	linkgit:git-rebase[1] for details.
+	linkgit:git-rebase[1] and linkgit:gitrevisions[7] for details.
 
 --reset-author::
 	When used with -C/-c/--amend options, or when committing after a
-- 
2.9.0.windows.1

[PATCH v1 3/3] doc: rebase: clarify fixup! fixup! constraint

From: Philip Oakley <hidden>
Date: 2016-08-14 21:46:50

22c5b13 (rebase -i: handle fixup! fixup! in --autosquash, 2013-06-27)

Signed-off-by: Philip Oakley <redacted>
---
v1
the historical discussion about this is here
https://public-inbox.org/git/20130611180530.GA18488%40oinkpad.pimlott.net/

I certainly misunderstood what this meant. It sounded like only one fixup! was
allowed per commit (i.e. one mistake) - fixing two mistakes wouldn't be
allowed. Hindsight is a wonderful thing.

Also, does 'earliest commit requiring fixup/squash' fully convey that
its the one to fix.
---
 Documentation/git-rebase.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 66b789a..91eb107 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -425,9 +425,9 @@ without an explicit `--interactive`.
 	automatically modify the todo list of rebase -i
 	so that the commit marked for squashing comes right after the
 	commit to be modified, and change the action of the moved
-	commit from `pick` to `squash` (or `fixup`).  Ignores subsequent
-	"fixup! " or "squash! " after the first, in case you referred to an
-	earlier fixup/squash with `git commit --fixup/--squash`.
+	commit from `pick` to `squash` (or `fixup`).  Commits with repeated
+	"fixup! " or "squash! " in the subject line are considered to refer
+	to the earliest commit requiring fixup/squash.
 +
 This option is only valid when the '--interactive' option is used.
 +
-- 
2.9.0.windows.1

[PATCH v1 2/3] doc: rebase: fixup! can take an object name

From: Philip Oakley <hidden>
Date: 2016-08-14 21:46:53

Since 68d5d03 (rebase: teach --autosquash to match on sha1 in addition
to message, 2010-11-04) the commit subject can refer directly to the
destination object hash as a single word.)...

Signed-off-by: Philip Oakley <redacted>
---
v1
This is about the actual commit subject line, rather than the --fixup
options to the commit command.

This came out of https://public-inbox.org/git/FAE9116880074D6FA421942CCAEC368F@PhilipOakley/
where I was expecting to be able to say 'fixup! <sha1> my message', but
I can't (which would be another day's patch - fixup! <rev>! my message').

One question is whether 'standalone' is clear enough, or needs to say
'single word revision'? (which would mean it's not 'object name')

Further, with more digging, I think that any
rev specifier that has no spaces should work [1], despite the 68d5d's
title. Though maybe during the relevant phase of rebase -i some of the
rev specifiers may not work because of the series being rewound - dunno.

[1] https://github.com/git/git/blame/v2.9.2/git-rebase--interactive.sh#L790
---
 Documentation/git-rebase.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt
index 0387b40..66b789a 100644
--- a/Documentation/git-rebase.txt
+++ b/Documentation/git-rebase.txt
@@ -421,7 +421,8 @@ without an explicit `--interactive`.
 --no-autosquash::
 	When the commit log message begins with "squash! ..." (or
 	"fixup! ..."), and there is a commit whose title begins with
-	the same ..., automatically modify the todo list of rebase -i
+	the same "..." message, or a commit object name (standalone),
+	automatically modify the todo list of rebase -i
 	so that the commit marked for squashing comes right after the
 	commit to be modified, and change the action of the moved
 	commit from `pick` to `squash` (or `fixup`).  Ignores subsequent
-- 
2.9.0.windows.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help