Re: [PATCH v3 5/7] git-rebase.txt: document behavioral inconsistencies between modes

2 messages, 2 authors, 2018-06-21 · open the first message on its own page

Re: [PATCH v3 5/7] git-rebase.txt: document behavioral inconsistencies between modes

From: Junio C Hamano <hidden>
Date: 2018-06-21 20:44:15

Elijah Newren [off-list ref] writes:
+BEHAVIORAL INCONSISTENCIES
+--------------------------
+
+  * --no-ff vs. --force-rebase
Do we want to `--quote` these?
+    These options are actually identical, though their description
+    leads people to believe they might not be.
Perhaps the same bandwidth can be spent on improving their
description, instead of adding this paragraph?
+ * empty commits:
+
+    am-based rebase will drop any "empty" commits, whether the
+    commit started empty (had no changes relative to its parent to
+    start with) or ended empty (all changes were already applied
+    upstream in other commits).
+
+    merge-based rebase does the same.
+
+    interactive-based rebase will by default drop commits that
+    started empty and halt if it hits a commit that ended up empty.
I think the description is accurate.

WRT a change that ends up being empty (as opposed to a change that
is empty from the beginning), I'd think that the current behaviour
is desireable one.  "am" based rebase is solely to transplant an
existing history and want to stop much less than "interactive" one
whose purpose is to polish a series before making it publishable,
and asking for confirmation ("this has become empty--do you want to
drop it?") is more appropriate from the workflow point of view; so
it may deserve s/inconsistencies/differences/.
+    The --keep-empty option exists for interactive rebases to allow
+    it to keep commits that started empty.
On the other hand, lack of --keep-empty on the "am" side is probably
a bug that wants to be fixed.
+  * empty commit messages:
+
+    am-based rebase will silently apply commits with empty commit
+    messages.
+
+    merge-based and interactive-based rebases will by default halt
+    on any such commits.  The --allow-empty-message option exists to
+    allow interactive-based rebases to apply such commits without
+    halting.
Ditto for desirable difference coming from workflow point of view.
+  * directory rename detection:
+
+    merge-based and interactive-based rebases work fine with
+    directory rename detection.  am-based rebases sometimes do not.
I quite do not get what the big deal is with "directory rename"; it
is merely a degree of magic heuristics employed while detecting file
renames.  It is natural to expect that the less information you make
available to the machinery, the less amount of heuristics gets
exercised to make "magic" happen.  Is the internal implementation
detail described below (omitted) all that interesting to general
readers of "git rebase --help", I wonder?  I would understand it if
this were under Documentation/technical/, though.

Re: [PATCH v3 5/7] git-rebase.txt: document behavioral inconsistencies between modes

From: Elijah Newren <hidden>
Date: 2018-06-21 21:26:02

Hi Junio,

On Thu, Jun 21, 2018 at 1:44 PM, Junio C Hamano [off-list ref] wrote:
Elijah Newren [off-list ref] writes:
quoted
+BEHAVIORAL INCONSISTENCIES
+--------------------------
+
+  * --no-ff vs. --force-rebase
Do we want to `--quote` these?
Ah, good point.
quoted
+ * empty commits:
+
+    am-based rebase will drop any "empty" commits, whether the
+    commit started empty (had no changes relative to its parent to
+    start with) or ended empty (all changes were already applied
+    upstream in other commits).
+
+    merge-based rebase does the same.
+
+    interactive-based rebase will by default drop commits that
+    started empty and halt if it hits a commit that ended up empty.
I think the description is accurate.

WRT a change that ends up being empty (as opposed to a change that
is empty from the beginning), I'd think that the current behaviour
is desireable one.  "am" based rebase is solely to transplant an
existing history and want to stop much less than "interactive" one
whose purpose is to polish a series before making it publishable,
and asking for confirmation ("this has become empty--do you want to
drop it?") is more appropriate from the workflow point of view; so
it may deserve s/inconsistencies/differences/.
Are you arguing the default for an explicit interactive rebase, or
also an implied one?

I would argue that implied interactive rebases also solely have the
purpose of "transplanting an existing history", as you say.  Thus, if
the user passes --rebase-merges (or --strategy or --strategy-options
after git-rebase--merge becomes part of git-rebase--interactive), then
the default should be the same as for am-based rebase, i.e. just
silently drop the empty commits.
quoted
+    The --keep-empty option exists for interactive rebases to allow
+    it to keep commits that started empty.
On the other hand, lack of --keep-empty on the "am" side is probably
a bug that wants to be fixed.
I personally don't like --keep-empty; it's too granular.  I'd prefer a
  --empty={drop,halt,keep}
flag, and have it apply to both patches that were empty when the
rebase started as well as patches that became empty after application
on the new base.  I think that'd be useful for both am-based and
interactive-based rebases.

Then we could also make an explicit --interactive flag imply
--empty=halt, if so desired, and otherwise make --empty=drop the
default.

I'm interested in implementing that, if other folks think it's not crazy.

Thoughts?
quoted
+  * empty commit messages:
+
+    am-based rebase will silently apply commits with empty commit
+    messages.
+
+    merge-based and interactive-based rebases will by default halt
+    on any such commits.  The --allow-empty-message option exists to
+    allow interactive-based rebases to apply such commits without
+    halting.
Ditto for desirable difference coming from workflow point of view.
I can see the argument for having a difference for rebases if the
interactive rebase was explicit, though I disagree with the argument.
See https://public-inbox.org/git/CABPp-BHrcUHX_zHxpojV5=sxJ1=NoDg9uhxv+NH5BsHsQYavPQ@mail.gmail.com/
for my views on this.

However, I'm curious again -- is your argument only for
interactive_rebase=explicit or also for interactive_rebase=implied?
quoted
+  * directory rename detection:
+
+    merge-based and interactive-based rebases work fine with
+    directory rename detection.  am-based rebases sometimes do not.
I quite do not get what the big deal is with "directory rename"; it
is merely a degree of magic heuristics employed while detecting file
renames.  It is natural to expect that the less information you make
available to the machinery, the less amount of heuristics gets
exercised to make "magic" happen.  Is the internal implementation
detail described below (omitted) all that interesting to general
readers of "git rebase --help", I wonder?  I would understand it if
this were under Documentation/technical/, though.
You are right that the last two paragraphs are probably much too
technical and belong elsewhere; I can move them.  However, I am not
sure if you were requesting just those paragraphs be moved, or if you
wanted the whole "directory rename detection" section removed from the
manpage.  Could you clarify?  Also, if the latter...How would users
know how much "information is made available to the underlying
machinery", as you put it?  Or, at a higher level, what is the right
way to communicate to them how they can obtain a behavior they might
want (directory rename detection), if it's not mentioned somewhere in
the manpage?  Is there an alternate place to put this in the document?


Thanks,
Elijah
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help