]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sequencer.c
sequencer: avoid garbled merge machinery messages due to commit labels
[thirdparty/git.git] / sequencer.c
index 9d1b3e7d4fa3ff44c1b06df9552f2139a433879c..e988c12ad2b66f0d24678820ba1dd42f44014f1e 100644 (file)
@@ -355,7 +355,7 @@ static int get_message(struct commit *commit, struct commit_message *out)
        subject_len = find_commit_subject(out->message, &subject);
 
        out->subject = xmemdupz(subject, subject_len);
-       out->label = xstrfmt("%s... %s", abbrev, out->subject);
+       out->label = xstrfmt("%s (%s)", abbrev, out->subject);
        out->parent_label = xstrfmt("parent of %s", out->label);
 
        return 0;
@@ -5385,10 +5385,13 @@ int todo_list_rearrange_squash(struct todo_list *todo_list)
                        todo_list->items[i].command =
                                starts_with(subject, "fixup!") ?
                                TODO_FIXUP : TODO_SQUASH;
-                       if (next[i2] < 0)
+                       if (tail[i2] < 0) {
+                               next[i] = next[i2];
                                next[i2] = i;
-                       else
+                       } else {
+                               next[i] = next[tail[i2]];
                                next[tail[i2]] = i;
+                       }
                        tail[i2] = i;
                } else if (!hashmap_get_from_hash(&subject2item,
                                                strhash(subject), subject)) {