Re: [PATCH] rebase -i: inform the user they can re-order commits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Matthieu Moy <Matthieu.Moy@xxxxxxxxxxxxxxx> writes:
>
>> But if the user sees the help message of "rebase -i", then I don't think
>> we will stop him from breaking anything by not mentionning that
>> reordering commits can work. We already give other commands that rewrite
>> history with more or less danger, so the additional messages isn't
>> really harmful.
>
> I was not questioning that "You can also reorder" is dangerous in any way.
>
> What is dangerous is to give an illusion that it is safe to use "rebase
> -i" without reading a decent documentation that does not even say that
> reordering is one of the primary purpose of the command, and the mindset
> that it is OK to give such an illusion with these reminder lines.

Another reason we may not want to say "you can re-order" is that we will
probably need to say that you cannot arbitrarily re-order (can s/f come at
the beginning?) unless you want to actively harm the user. Once we go down
that path, we would end up repeating the manual.

Having said that, I do not personally care about this too deeply.  Let's
queue a reworded Nelson's patch so it is not lost while waiting for others
to chime in.

How about this?  I avoided phrases "applying commit" (incorrect: you apply
patches, and you replay or cherry-pick commits) and "history" (to people
who know, it is redundant; to people who don't, it is vague mystery), but
added one more useful reminder (top to bottom).

 git-rebase--interactive.sh |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index 5812222..fd04c8f 100644
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -846,6 +846,8 @@ cat >> "$todo" << EOF
 #  f, fixup = like "squash", but discard this commit's log message
 #  x, exec = run command (the rest of the line) using shell
 #
+# These lines can be re-ordered; they are executed from top to bottom.
+# 
 # If you remove a line here THAT COMMIT WILL BE LOST.
 # However, if you remove everything, the rebase will be aborted.
 #
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]