Skip to content

Commit 56173d2

Browse files
committed
Merge branch 'pw/rebase-keep-empty-fixes' into pw/rebase-signoff
* pw/rebase-keep-empty-fixes: rebase: respect --no-keep-empty rebase -i --keep-empty: don't prune empty commits rebase --root: stop assuming squash_onto is unset Git 2.16.2
2 parents 0f57f73 + 3d94616 commit 56173d2

File tree

4 files changed

+41
-3
lines changed

4 files changed

+41
-3
lines changed

Documentation/RelNotes/2.16.2.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Git v2.16.2 Release Notes
2+
=========================
3+
4+
Fixes since v2.16.1
5+
-------------------
6+
7+
* An old regression in "git describe --all $annotated_tag^0" has been
8+
fixed.
9+
10+
* "git svn dcommit" did not take into account the fact that a
11+
svn+ssh:// URL with a username@ (typically used for pushing) refers
12+
to the same SVN repository without the username@ and failed when
13+
svn.pushmergeinfo option is set.
14+
15+
* "git merge -Xours/-Xtheirs" learned to use our/their version when
16+
resolving a conflicting updates to a symbolic link.
17+
18+
* "git clone $there $here" is allowed even when here directory exists
19+
as long as it is an empty directory, but the command incorrectly
20+
removed it upon a failure of the operation.
21+
22+
* "git stash -- <pathspec>" incorrectly blew away untracked files in
23+
the directory that matched the pathspec, which has been corrected.
24+
25+
* "git add -p" was taught to ignore local changes to submodules as
26+
they do not interfere with the partial addition of regular changes
27+
anyway.
28+
29+
30+
Also contains various documentation updates and code clean-ups.

git-rebase.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ $(gettext 'Resolve all conflicts manually, mark them as resolved with
6060
You can instead skip this commit: run "git rebase --skip".
6161
To abort and get back to the state before "git rebase", run "git rebase --abort".')
6262
"
63+
squash_onto=
6364
unset onto
6465
unset restrict_revision
6566
cmd=
@@ -262,6 +263,9 @@ do
262263
--keep-empty)
263264
keep_empty=yes
264265
;;
266+
--no-keep-empty)
267+
keep_empty=
268+
;;
265269
--preserve-merges)
266270
preserve_merges=t
267271
test -z "$interactive_rebase" && interactive_rebase=implied

sequencer.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2992,7 +2992,7 @@ int sequencer_make_script(FILE *out, int argc, const char **argv,
29922992
init_revisions(&revs, NULL);
29932993
revs.verbose_header = 1;
29942994
revs.max_parents = 1;
2995-
revs.cherry_pick = 1;
2995+
revs.cherry_mark = 1;
29962996
revs.limited = 1;
29972997
revs.reverse = 1;
29982998
revs.right_only = 1;
@@ -3017,8 +3017,12 @@ int sequencer_make_script(FILE *out, int argc, const char **argv,
30173017
return error(_("make_script: error preparing revisions"));
30183018

30193019
while ((commit = get_revision(&revs))) {
3020+
int is_empty = is_original_commit_empty(commit);
3021+
3022+
if (!is_empty && (commit->object.flags & PATCHSAME))
3023+
continue;
30203024
strbuf_reset(&buf);
3021-
if (!keep_empty && is_original_commit_empty(commit))
3025+
if (!keep_empty && is_empty)
30223026
strbuf_addf(&buf, "%c ", comment_line_char);
30233027
strbuf_addf(&buf, "%s %s ", insn,
30243028
oid_to_hex(&commit->object.oid));

t/t3421-rebase-topology-linear.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ test_run_rebase () {
215215
}
216216
test_run_rebase success ''
217217
test_run_rebase failure -m
218-
test_run_rebase failure -i
218+
test_run_rebase success -i
219219
test_run_rebase failure -p
220220

221221
# m

0 commit comments

Comments
 (0)