{"thread":{"id":"34075","subject":"[PATCH v4 00/45] Massive improvents to rebase and cherry-pick","startedAt":"2013-06-09T16:40:12Z","lastAt":"2013-06-11T17:42:20Z","messageCount":86,"participants":["Felipe Contreras","Antoine Pelisse","Ramkumar Ramachandra","SZEDER Gábor","Thomas Rast","John Keeping","Fredrik Gustafsson","Philip Oakley","Martin von Zweigbergk","Junio C Hamano"],"isPatch":true,"patchVersion":4,"patchTotal":45},"messages":[{"id":"219971","messageId":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":null,"subject":"[PATCH v4 00/45] Massive improvents to rebase and cherry-pick","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:12Z","receivedAt":"2013-06-09T16:40:12Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Hi,\n\nThese are improvements to 'git rebase' by using a much improved 'git\ncherry-pick'. I already sent some of these, but they have been revamped.\n\nThese changes require reorganization of the code in order to have a\nbuiltin/lib.a library.\n\nA new builtin/rewrite.c helper is added, and builtin/commit updated to use\nthat.\n\nA new git-rebase--cherypick mode is added, and it replaces git-rebase--am and\ngit-rebase--merge.\n\nI also added the new rebase tests by Martin von Zweigbergk to make sure\neverything works, and in fact, it works better than before, since now all the\nrebase modes are consistent with each other.\n\nI don't have any hopes of these getting merged, because people have no interest\nin fixing the ./*.o ./builin/*.o divide problem, only interested in arguing\nthat libgit.a is not a real library, and it should never be. So my obviously\ncleanup is rejected.\n\nFelipe Contreras (38):\n  build: generate and clean test scripts\n  build: do not install git-remote-testgit\n  build: trivial cleanup\n  build: add builtin lib\n  log-tree: remove dependency from sequencer\n  Move sequencer to builtin\n  unpack-trees: plug a memory leak\n  read-cache: plug a few leaks\n  sequencer: remove useless indentation\n  sequencer: trivial fix\n  cherry-pick: don't barf when there's nothing to do\n  cherry-pick: add --skip-empty option\n  revert/cherry-pick: add --quiet option\n  revert/cherry-pick: add --skip option\n  builtin: add rewrite helper\n  cherry-pick: store rewritten commits\n  cherry-pick: don't store skipped commit\n  builtin: move run_rewrite_hook() to rewrite.c\n  builtin: add copy_rewrite_notes()\n  cherry-pick: copy notes and run hooks\n  cherry-pick: add --action-name option\n  cherry-pick: remember rerere-autoupdate\n  rebase: split the cherry-pick stuff\n  rebase: cherry-pick: fix mode storage\n  rebase: cherry-pick: fix sequence continuation\n  rebase: cherry-pick: fix abort of cherry mode\n  rebase: cherry-pick: fix command invocations\n  rebase: cherry-pick: fix status messages\n  rebase: cherry-pick: automatically commit stage\n  rebase: cherry-pick: set correct action-name\n  rebase: trivial cleanup\n  rebase: use 'cherrypick' mode instead of 'am'\n  rebase: cherry-pick: fix for shell prompt\n  rebase: cherry-pick: add merge options\n  rebase: remove merge mode\n  rebase: cherry-pick: add copyright\n  tests: fix autostash\n  tests: update topology tests\n\nMartin von Zweigbergk (7):\n  add simple tests of consistency across rebase types\n  add tests for rebasing with patch-equivalence present\n  add tests for rebasing of empty commits\n  add tests for rebasing root\n  add tests for rebasing merged history\n  t3406: modernize style\n  tests: move test for rebase messages from t3400 to t3406\n\n .gitignore                             |   1 +\n Documentation/git-cherry-pick.txt      |  10 +-\n Documentation/git-revert.txt           |   7 +-\n Documentation/sequencer.txt            |   3 +\n Makefile                               |  31 +--\n builtin/commit.c                       |  46 +----\n builtin/revert.c                       |  17 ++\n builtin/rewrite.c                      | 124 ++++++++++++\n builtin/rewrite.h                      |  20 ++\n sequencer.c => builtin/sequencer.c     | 263 ++++++++++---------------\n sequencer.h => builtin/sequencer.h     |  12 +-\n contrib/completion/git-prompt.sh       |   4 +-\n git-rebase--am.sh                      |  12 +-\n git-rebase--cherrypick.sh              |  72 +++++++\n git-rebase--interactive.sh             |   4 +-\n git-rebase--merge.sh                   | 151 --------------\n git-rebase.sh                          |  16 +-\n log-tree.c                             | 161 ++++++++++++++-\n log-tree.h                             |   3 +\n read-cache.c                           |   4 +\n t/lib-rebase.sh                        |  33 ++++\n t/t3400-rebase.sh                      |  53 +----\n t/t3401-rebase-partial.sh              |  69 -------\n t/t3404-rebase-interactive.sh          |  10 +-\n t/t3406-rebase-message.sh              |  56 +++---\n t/t3407-rebase-abort.sh                |   2 +-\n t/t3409-rebase-preserve-merges.sh      |  53 -----\n t/t3420-rebase-autostash.sh            |   5 +-\n t/t3421-rebase-topology-linear.sh      | 350 +++++++++++++++++++++++++++++++++\n t/t3425-rebase-topology-merges.sh      | 255 ++++++++++++++++++++++++\n t/t3508-cherry-pick-many-commits.sh    |  13 ++\n t/t3510-cherry-pick-sequence.sh        |  14 +-\n t/t5520-pull.sh                        |   2 +-\n t/t9106-git-svn-commit-diff-clobber.sh |   2 +-\n t/t9903-bash-prompt.sh                 |   2 +-\n unpack-trees.c                         |   4 +-\n 36 files changed, 1268 insertions(+), 616 deletions(-)\n create mode 100644 builtin/rewrite.c\n create mode 100644 builtin/rewrite.h\n rename sequencer.c => builtin/sequencer.c (86%)\n rename sequencer.h => builtin/sequencer.h (86%)\n create mode 100644 git-rebase--cherrypick.sh\n delete mode 100644 git-rebase--merge.sh\n delete mode 100755 t/t3401-rebase-partial.sh\n create mode 100755 t/t3421-rebase-topology-linear.sh\n create mode 100755 t/t3425-rebase-topology-merges.sh\n\n-- \n1.8.3.698.g079b096\n"},{"id":"220018","messageId":"1370796057-25312-2-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 01/45] build: generate and clean test scripts","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:13Z","receivedAt":"2013-06-09T16:40:13Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Commit 416fda6 (build: do not install git-remote-testpy) made it so\ngit-remote-testpy is not only not installed, but also not generated by\ndefault, let's make sure tests scripts (NO_INSTALL) are generated as\nell.\n\nComments-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Makefile b/Makefile\nindex 03524d0..51c812d 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2232,6 +2232,7 @@ endif\n \n test_bindir_programs := $(patsubst %,bin-wrappers/%,$(BINDIR_PROGRAMS_NEED_X) $(BINDIR_PROGRAMS_NO_X) $(TEST_PROGRAMS_NEED_X))\n \n+all:: $(NO_INSTALL)\n all:: $(TEST_PROGRAMS) $(test_bindir_programs)\n \n bin-wrappers/%: wrap-for-bin.sh\n@@ -2482,7 +2483,7 @@ clean: profile-clean coverage-clean\n \t$(RM) *.o *.res block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \\\n \t\tbuiltin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)\n \t$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X\n-\t$(RM) $(TEST_PROGRAMS)\n+\t$(RM) $(TEST_PROGRAMS) $(NO_INSTALL)\n \t$(RM) -r bin-wrappers $(dep_dirs)\n \t$(RM) -r po/build/\n \t$(RM) *.spec *.pyc *.pyo */*.pyc */*.pyo common-cmds.h $(ETAGS_TARGET) tags cscope*\n-- \n1.8.3.698.g079b096\n"},{"id":"219973","messageId":"1370796057-25312-3-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 02/45] build: do not install git-remote-testgit","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:14Z","receivedAt":"2013-06-09T16:40:14Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/Makefile b/Makefile\nindex 51c812d..34f1240 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -491,6 +491,7 @@ SCRIPT_PERL += git-svn.perl\n SCRIPT_PYTHON += git-remote-testpy.py\n SCRIPT_PYTHON += git-p4.py\n \n+NO_INSTALL += git-remote-testgit\n NO_INSTALL += git-remote-testpy\n \n # Generated files for scripts\n-- \n1.8.3.698.g079b096\n"},{"id":"219972","messageId":"1370796057-25312-4-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 03/45] build: trivial cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:15Z","receivedAt":"2013-06-09T16:40:15Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"There's no need to list again the prerequisites.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile | 6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 34f1240..3b6cd5a 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -2068,13 +2068,13 @@ $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS\n \t\t$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)\n \n $(LIB_FILE): $(LIB_OBJS)\n-\t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)\n+\t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^\n \n $(XDIFF_LIB): $(XDIFF_OBJS)\n-\t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS)\n+\t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^\n \n $(VCSSVN_LIB): $(VCSSVN_OBJS)\n-\t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(VCSSVN_OBJS)\n+\t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^\n \n export DEFAULT_EDITOR DEFAULT_PAGER\n \n-- \n1.8.3.698.g079b096\n"},{"id":"219974","messageId":"1370796057-25312-5-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 04/45] build: add builtin lib","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:16Z","receivedAt":"2013-06-09T16:40:16Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex 3b6cd5a..d2af207 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -631,6 +631,7 @@ export PERL_PATH\n export PYTHON_PATH\n \n LIB_FILE = libgit.a\n+BUILTIN_LIB = builtin/lib.a\n XDIFF_LIB = xdiff/lib.a\n VCSSVN_LIB = vcs-svn/lib.a\n \n@@ -1713,9 +1714,9 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = \\\n \t'-DGIT_MAN_PATH=\"$(mandir_relative_SQ)\"' \\\n \t'-DGIT_INFO_PATH=\"$(infodir_relative_SQ)\"'\n \n-git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)\n+git$X: git.o GIT-LDFLAGS $(BUILTIN_LIB) $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \\\n-\t\t$(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)\n+\t\t$(ALL_LDFLAGS) $(BUILTIN_LIB) $(LIBS)\n \n help.sp help.s help.o: common-cmds.h\n \n@@ -2070,6 +2071,9 @@ $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS\n $(LIB_FILE): $(LIB_OBJS)\n \t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^\n \n+$(BUILTIN_LIB): $(BUILTIN_OBJS)\n+\t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^\n+\n $(XDIFF_LIB): $(XDIFF_OBJS)\n \t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^\n \n@@ -2482,7 +2486,7 @@ profile-clean:\n \n clean: profile-clean coverage-clean\n \t$(RM) *.o *.res block-sha1/*.o ppc/*.o compat/*.o compat/*/*.o xdiff/*.o vcs-svn/*.o \\\n-\t\tbuiltin/*.o $(LIB_FILE) $(XDIFF_LIB) $(VCSSVN_LIB)\n+\t\tbuiltin/*.o $(LIB_FILE) $(BUILTIN_LIB) $(XDIFF_LIB) $(VCSSVN_LIB)\n \t$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) git$X\n \t$(RM) $(TEST_PROGRAMS) $(NO_INSTALL)\n \t$(RM) -r bin-wrappers $(dep_dirs)\n-- \n1.8.3.698.g079b096\n"},{"id":"219975","messageId":"1370796057-25312-6-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 05/45] log-tree: remove dependency from sequencer","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:17Z","receivedAt":"2013-06-09T16:40:17Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Move the relevant code from sequencer to log-tree. This code is not\nspecific to sequencer, and this allows the sequencer to move out of\nlibgit.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n log-tree.c  | 161 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-\n log-tree.h  |   3 ++\n sequencer.c | 160 ++---------------------------------------------------------\n sequencer.h |   4 --\n 4 files changed, 166 insertions(+), 162 deletions(-)\n\ndiff --git a/log-tree.c b/log-tree.c\nindex 2eb69bc..654f5db 100644\n--- a/log-tree.c\n+++ b/log-tree.c\n@@ -9,10 +9,13 @@\n #include \"string-list.h\"\n #include \"color.h\"\n #include \"gpg-interface.h\"\n-#include \"sequencer.h\"\n #include \"line-log.h\"\n \n+#define APPEND_SIGNOFF_DEDUP (1u << 0)\n+\n struct decoration name_decoration = { \"object names\" };\n+const char sign_off_header[] = \"Signed-off-by: \";\n+static const char cherry_picked_prefix[] = \"(cherry picked from commit \";\n \n enum decoration_type {\n \tDECORATION_NONE = 0,\n@@ -472,6 +475,162 @@ static void show_mergetag(struct rev_info *opt, struct commit *commit)\n \tfree_commit_extra_headers(to_free);\n }\n \n+static int is_rfc2822_line(const char *buf, int len)\n+{\n+\tint i;\n+\n+\tfor (i = 0; i < len; i++) {\n+\t\tint ch = buf[i];\n+\t\tif (ch == ':')\n+\t\t\treturn 1;\n+\t\tif (!isalnum(ch) && ch != '-')\n+\t\t\tbreak;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int is_cherry_picked_from_line(const char *buf, int len)\n+{\n+\t/*\n+\t * We only care that it looks roughly like (cherry picked from ...)\n+\t */\n+\treturn len > strlen(cherry_picked_prefix) + 1 &&\n+\t\t!prefixcmp(buf, cherry_picked_prefix) && buf[len - 1] == ')';\n+}\n+\n+/*\n+ * Returns 0 for non-conforming footer\n+ * Returns 1 for conforming footer\n+ * Returns 2 when sob exists within conforming footer\n+ * Returns 3 when sob exists within conforming footer as last entry\n+ */\n+int has_conforming_footer(struct strbuf *sb, struct strbuf *sob,\n+\tint ignore_footer)\n+{\n+\tchar prev;\n+\tint i, k;\n+\tint len = sb->len - ignore_footer;\n+\tconst char *buf = sb->buf;\n+\tint found_sob = 0;\n+\n+\t/* footer must end with newline */\n+\tif (!len || buf[len - 1] != '\\n')\n+\t\treturn 0;\n+\n+\tprev = '\\0';\n+\tfor (i = len - 1; i > 0; i--) {\n+\t\tchar ch = buf[i];\n+\t\tif (prev == '\\n' && ch == '\\n') /* paragraph break */\n+\t\t\tbreak;\n+\t\tprev = ch;\n+\t}\n+\n+\t/* require at least one blank line */\n+\tif (prev != '\\n' || buf[i] != '\\n')\n+\t\treturn 0;\n+\n+\t/* advance to start of last paragraph */\n+\twhile (i < len - 1 && buf[i] == '\\n')\n+\t\ti++;\n+\n+\tfor (; i < len; i = k) {\n+\t\tint found_rfc2822;\n+\n+\t\tfor (k = i; k < len && buf[k] != '\\n'; k++)\n+\t\t\t; /* do nothing */\n+\t\tk++;\n+\n+\t\tfound_rfc2822 = is_rfc2822_line(buf + i, k - i - 1);\n+\t\tif (found_rfc2822 && sob &&\n+\t\t    !strncmp(buf + i, sob->buf, sob->len))\n+\t\t\tfound_sob = k;\n+\n+\t\tif (!(found_rfc2822 ||\n+\t\t      is_cherry_picked_from_line(buf + i, k - i - 1)))\n+\t\t\treturn 0;\n+\t}\n+\tif (found_sob == i)\n+\t\treturn 3;\n+\tif (found_sob)\n+\t\treturn 2;\n+\treturn 1;\n+}\n+\n+void append_cherrypick(struct strbuf *msgbuf, struct object *obj)\n+{\n+\tif (!has_conforming_footer(msgbuf, NULL, 0))\n+\t\tstrbuf_addch(msgbuf, '\\n');\n+\tstrbuf_addstr(msgbuf, cherry_picked_prefix);\n+\tstrbuf_addstr(msgbuf, sha1_to_hex(obj->sha1));\n+\tstrbuf_addstr(msgbuf, \")\\n\");\n+}\n+\n+void append_signoff(struct strbuf *msgbuf, int ignore_footer, unsigned flag)\n+{\n+\tunsigned no_dup_sob = flag & APPEND_SIGNOFF_DEDUP;\n+\tstruct strbuf sob = STRBUF_INIT;\n+\tint has_footer;\n+\n+\tstrbuf_addstr(&sob, sign_off_header);\n+\tstrbuf_addstr(&sob, fmt_name(getenv(\"GIT_COMMITTER_NAME\"),\n+\t\t\t\tgetenv(\"GIT_COMMITTER_EMAIL\")));\n+\tstrbuf_addch(&sob, '\\n');\n+\n+\t/*\n+\t * If the whole message buffer is equal to the sob, pretend that we\n+\t * found a conforming footer with a matching sob\n+\t */\n+\tif (msgbuf->len - ignore_footer == sob.len &&\n+\t    !strncmp(msgbuf->buf, sob.buf, sob.len))\n+\t\thas_footer = 3;\n+\telse\n+\t\thas_footer = has_conforming_footer(msgbuf, &sob, ignore_footer);\n+\n+\tif (!has_footer) {\n+\t\tconst char *append_newlines = NULL;\n+\t\tsize_t len = msgbuf->len - ignore_footer;\n+\n+\t\tif (!len) {\n+\t\t\t/*\n+\t\t\t * The buffer is completely empty.  Leave foom for\n+\t\t\t * the title and body to be filled in by the user.\n+\t\t\t */\n+\t\t\tappend_newlines = \"\\n\\n\";\n+\t\t} else if (msgbuf->buf[len - 1] != '\\n') {\n+\t\t\t/*\n+\t\t\t * Incomplete line.  Complete the line and add a\n+\t\t\t * blank one so that there is an empty line between\n+\t\t\t * the message body and the sob.\n+\t\t\t */\n+\t\t\tappend_newlines = \"\\n\\n\";\n+\t\t} else if (len == 1) {\n+\t\t\t/*\n+\t\t\t * Buffer contains a single newline.  Add another\n+\t\t\t * so that we leave room for the title and body.\n+\t\t\t */\n+\t\t\tappend_newlines = \"\\n\";\n+\t\t} else if (msgbuf->buf[len - 2] != '\\n') {\n+\t\t\t/*\n+\t\t\t * Buffer ends with a single newline.  Add another\n+\t\t\t * so that there is an empty line between the message\n+\t\t\t * body and the sob.\n+\t\t\t */\n+\t\t\tappend_newlines = \"\\n\";\n+\t\t} /* else, the buffer already ends with two newlines. */\n+\n+\t\tif (append_newlines)\n+\t\t\tstrbuf_splice(msgbuf, msgbuf->len - ignore_footer, 0,\n+\t\t\t\tappend_newlines, strlen(append_newlines));\n+\t}\n+\n+\tif (has_footer != 3 && (!no_dup_sob || has_footer != 2))\n+\t\tstrbuf_splice(msgbuf, msgbuf->len - ignore_footer, 0,\n+\t\t\t\tsob.buf, sob.len);\n+\n+\tstrbuf_release(&sob);\n+}\n+\n void show_log(struct rev_info *opt)\n {\n \tstruct strbuf msgbuf = STRBUF_INIT;\ndiff --git a/log-tree.h b/log-tree.h\nindex d6ecd4d..1039e49 100644\n--- a/log-tree.h\n+++ b/log-tree.h\n@@ -25,4 +25,7 @@ void load_ref_decorations(int flags);\n void fmt_output_commit(struct strbuf *, struct commit *, struct rev_info *);\n void fmt_output_subject(struct strbuf *, const char *subject, struct rev_info *);\n \n+void append_cherrypick(struct strbuf *msgbuf, struct object *obj);\n+void append_signoff(struct strbuf *msgbuf, int ignore_footer, unsigned flag);\n+\n #endif\ndiff --git a/sequencer.c b/sequencer.c\nindex ab6f8a7..e92e039 100644\n--- a/sequencer.c\n+++ b/sequencer.c\n@@ -14,94 +14,10 @@\n #include \"merge-recursive.h\"\n #include \"refs.h\"\n #include \"argv-array.h\"\n+#include \"log-tree.h\"\n \n #define GIT_REFLOG_ACTION \"GIT_REFLOG_ACTION\"\n \n-const char sign_off_header[] = \"Signed-off-by: \";\n-static const char cherry_picked_prefix[] = \"(cherry picked from commit \";\n-\n-static int is_rfc2822_line(const char *buf, int len)\n-{\n-\tint i;\n-\n-\tfor (i = 0; i < len; i++) {\n-\t\tint ch = buf[i];\n-\t\tif (ch == ':')\n-\t\t\treturn 1;\n-\t\tif (!isalnum(ch) && ch != '-')\n-\t\t\tbreak;\n-\t}\n-\n-\treturn 0;\n-}\n-\n-static int is_cherry_picked_from_line(const char *buf, int len)\n-{\n-\t/*\n-\t * We only care that it looks roughly like (cherry picked from ...)\n-\t */\n-\treturn len > strlen(cherry_picked_prefix) + 1 &&\n-\t\t!prefixcmp(buf, cherry_picked_prefix) && buf[len - 1] == ')';\n-}\n-\n-/*\n- * Returns 0 for non-conforming footer\n- * Returns 1 for conforming footer\n- * Returns 2 when sob exists within conforming footer\n- * Returns 3 when sob exists within conforming footer as last entry\n- */\n-static int has_conforming_footer(struct strbuf *sb, struct strbuf *sob,\n-\tint ignore_footer)\n-{\n-\tchar prev;\n-\tint i, k;\n-\tint len = sb->len - ignore_footer;\n-\tconst char *buf = sb->buf;\n-\tint found_sob = 0;\n-\n-\t/* footer must end with newline */\n-\tif (!len || buf[len - 1] != '\\n')\n-\t\treturn 0;\n-\n-\tprev = '\\0';\n-\tfor (i = len - 1; i > 0; i--) {\n-\t\tchar ch = buf[i];\n-\t\tif (prev == '\\n' && ch == '\\n') /* paragraph break */\n-\t\t\tbreak;\n-\t\tprev = ch;\n-\t}\n-\n-\t/* require at least one blank line */\n-\tif (prev != '\\n' || buf[i] != '\\n')\n-\t\treturn 0;\n-\n-\t/* advance to start of last paragraph */\n-\twhile (i < len - 1 && buf[i] == '\\n')\n-\t\ti++;\n-\n-\tfor (; i < len; i = k) {\n-\t\tint found_rfc2822;\n-\n-\t\tfor (k = i; k < len && buf[k] != '\\n'; k++)\n-\t\t\t; /* do nothing */\n-\t\tk++;\n-\n-\t\tfound_rfc2822 = is_rfc2822_line(buf + i, k - i - 1);\n-\t\tif (found_rfc2822 && sob &&\n-\t\t    !strncmp(buf + i, sob->buf, sob->len))\n-\t\t\tfound_sob = k;\n-\n-\t\tif (!(found_rfc2822 ||\n-\t\t      is_cherry_picked_from_line(buf + i, k - i - 1)))\n-\t\t\treturn 0;\n-\t}\n-\tif (found_sob == i)\n-\t\treturn 3;\n-\tif (found_sob)\n-\t\treturn 2;\n-\treturn 1;\n-}\n-\n static void remove_sequencer_state(void)\n {\n \tstruct strbuf seq_dir = STRBUF_INIT;\n@@ -578,13 +494,8 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)\n \t\t\tstrbuf_addstr(&msgbuf, p);\n \t\t}\n \n-\t\tif (opts->record_origin) {\n-\t\t\tif (!has_conforming_footer(&msgbuf, NULL, 0))\n-\t\t\t\tstrbuf_addch(&msgbuf, '\\n');\n-\t\t\tstrbuf_addstr(&msgbuf, cherry_picked_prefix);\n-\t\t\tstrbuf_addstr(&msgbuf, sha1_to_hex(commit->object.sha1));\n-\t\t\tstrbuf_addstr(&msgbuf, \")\\n\");\n-\t\t}\n+\t\tif (opts->record_origin)\n+\t\t\tappend_cherrypick(&msgbuf, &commit->object);\n \t}\n \n \tif (!opts->strategy || !strcmp(opts->strategy, \"recursive\") || opts->action == REPLAY_REVERT) {\n@@ -1123,68 +1034,3 @@ int sequencer_pick_revisions(struct replay_opts *opts)\n \tsave_opts(opts);\n \treturn pick_commits(todo_list, opts);\n }\n-\n-void append_signoff(struct strbuf *msgbuf, int ignore_footer, unsigned flag)\n-{\n-\tunsigned no_dup_sob = flag & APPEND_SIGNOFF_DEDUP;\n-\tstruct strbuf sob = STRBUF_INIT;\n-\tint has_footer;\n-\n-\tstrbuf_addstr(&sob, sign_off_header);\n-\tstrbuf_addstr(&sob, fmt_name(getenv(\"GIT_COMMITTER_NAME\"),\n-\t\t\t\tgetenv(\"GIT_COMMITTER_EMAIL\")));\n-\tstrbuf_addch(&sob, '\\n');\n-\n-\t/*\n-\t * If the whole message buffer is equal to the sob, pretend that we\n-\t * found a conforming footer with a matching sob\n-\t */\n-\tif (msgbuf->len - ignore_footer == sob.len &&\n-\t    !strncmp(msgbuf->buf, sob.buf, sob.len))\n-\t\thas_footer = 3;\n-\telse\n-\t\thas_footer = has_conforming_footer(msgbuf, &sob, ignore_footer);\n-\n-\tif (!has_footer) {\n-\t\tconst char *append_newlines = NULL;\n-\t\tsize_t len = msgbuf->len - ignore_footer;\n-\n-\t\tif (!len) {\n-\t\t\t/*\n-\t\t\t * The buffer is completely empty.  Leave foom for\n-\t\t\t * the title and body to be filled in by the user.\n-\t\t\t */\n-\t\t\tappend_newlines = \"\\n\\n\";\n-\t\t} else if (msgbuf->buf[len - 1] != '\\n') {\n-\t\t\t/*\n-\t\t\t * Incomplete line.  Complete the line and add a\n-\t\t\t * blank one so that there is an empty line between\n-\t\t\t * the message body and the sob.\n-\t\t\t */\n-\t\t\tappend_newlines = \"\\n\\n\";\n-\t\t} else if (len == 1) {\n-\t\t\t/*\n-\t\t\t * Buffer contains a single newline.  Add another\n-\t\t\t * so that we leave room for the title and body.\n-\t\t\t */\n-\t\t\tappend_newlines = \"\\n\";\n-\t\t} else if (msgbuf->buf[len - 2] != '\\n') {\n-\t\t\t/*\n-\t\t\t * Buffer ends with a single newline.  Add another\n-\t\t\t * so that there is an empty line between the message\n-\t\t\t * body and the sob.\n-\t\t\t */\n-\t\t\tappend_newlines = \"\\n\";\n-\t\t} /* else, the buffer already ends with two newlines. */\n-\n-\t\tif (append_newlines)\n-\t\t\tstrbuf_splice(msgbuf, msgbuf->len - ignore_footer, 0,\n-\t\t\t\tappend_newlines, strlen(append_newlines));\n-\t}\n-\n-\tif (has_footer != 3 && (!no_dup_sob || has_footer != 2))\n-\t\tstrbuf_splice(msgbuf, msgbuf->len - ignore_footer, 0,\n-\t\t\t\tsob.buf, sob.len);\n-\n-\tstrbuf_release(&sob);\n-}\ndiff --git a/sequencer.h b/sequencer.h\nindex 1fc22dc..c341918 100644\n--- a/sequencer.h\n+++ b/sequencer.h\n@@ -6,8 +6,6 @@\n #define SEQ_TODO_FILE\t\"sequencer/todo\"\n #define SEQ_OPTS_FILE\t\"sequencer/opts\"\n \n-#define APPEND_SIGNOFF_DEDUP (1u << 0)\n-\n enum replay_action {\n \tREPLAY_REVERT,\n \tREPLAY_PICK\n@@ -50,6 +48,4 @@ int sequencer_pick_revisions(struct replay_opts *opts);\n \n extern const char sign_off_header[];\n \n-void append_signoff(struct strbuf *msgbuf, int ignore_footer, unsigned flag);\n-\n #endif\n-- \n1.8.3.698.g079b096\n"},{"id":"220017","messageId":"1370796057-25312-7-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 06/45] Move sequencer to builtin","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:18Z","receivedAt":"2013-06-09T16:40:18Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"This code is only useful for cherry-pick and revert built-ins, nothing\nelse, so let's make it a builtin object.\n\nThe first source file that doesn't generate a git-foo builtin, but does\ngo into the builtin library. Hopefully the first of many to clean\nlibgit.a.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile                           | 10 ++++++----\n sequencer.c => builtin/sequencer.c |  0\n sequencer.h => builtin/sequencer.h |  0\n 3 files changed, 6 insertions(+), 4 deletions(-)\n rename sequencer.c => builtin/sequencer.c (100%)\n rename sequencer.h => builtin/sequencer.h (100%)\n\ndiff --git a/Makefile b/Makefile\nindex d2af207..4c7bb88 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -716,7 +716,6 @@ LIB_H += resolve-undo.h\n LIB_H += revision.h\n LIB_H += run-command.h\n LIB_H += send-pack.h\n-LIB_H += sequencer.h\n LIB_H += sha1-array.h\n LIB_H += sha1-lookup.h\n LIB_H += shortlog.h\n@@ -858,7 +857,6 @@ LIB_OBJS += resolve-undo.o\n LIB_OBJS += revision.o\n LIB_OBJS += run-command.o\n LIB_OBJS += send-pack.o\n-LIB_OBJS += sequencer.o\n LIB_OBJS += server-info.o\n LIB_OBJS += setup.o\n LIB_OBJS += sha1-array.o\n@@ -992,6 +990,9 @@ BUILTIN_OBJS += builtin/verify-pack.o\n BUILTIN_OBJS += builtin/verify-tag.o\n BUILTIN_OBJS += builtin/write-tree.o\n \n+BUILTIN_LIB_OBJS += builtin/sequencer.o\n+BUILTIN_LIB_OBJS += $(BUILTIN_OBJS)\n+\n GITLIBS = $(LIB_FILE) $(XDIFF_LIB)\n EXTLIBS =\n \n@@ -1894,7 +1895,8 @@ VCSSVN_OBJS += vcs-svn/svndiff.o\n VCSSVN_OBJS += vcs-svn/svndump.o\n \n TEST_OBJS := $(patsubst test-%$X,test-%.o,$(TEST_PROGRAMS))\n-OBJECTS := $(LIB_OBJS) $(BUILTIN_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \\\n+OBJECTS := $(LIB_OBJS) $(PROGRAM_OBJS) $(TEST_OBJS) \\\n+\t$(BUILTIN_LIB_OBJS) \\\n \t$(XDIFF_OBJS) \\\n \t$(VCSSVN_OBJS) \\\n \tgit.o\n@@ -2071,7 +2073,7 @@ $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o GIT-LDFLAGS $(GITLIBS\n $(LIB_FILE): $(LIB_OBJS)\n \t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^\n \n-$(BUILTIN_LIB): $(BUILTIN_OBJS)\n+$(BUILTIN_LIB): $(BUILTIN_LIB_OBJS)\n \t$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $^\n \n $(XDIFF_LIB): $(XDIFF_OBJS)\ndiff --git a/sequencer.c b/builtin/sequencer.c\nsimilarity index 100%\nrename from sequencer.c\nrename to builtin/sequencer.c\ndiff --git a/sequencer.h b/builtin/sequencer.h\nsimilarity index 100%\nrename from sequencer.h\nrename to builtin/sequencer.h\n-- \n1.8.3.698.g079b096\n"},{"id":"219976","messageId":"1370796057-25312-8-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 07/45] unpack-trees: plug a memory leak","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:19Z","receivedAt":"2013-06-09T16:40:19Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Before overwriting the destination index, first let's discard its\ncontents.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n unpack-trees.c | 4 +++-\n 1 file changed, 3 insertions(+), 1 deletion(-)\n\ndiff --git a/unpack-trees.c b/unpack-trees.c\nindex 57b4074..abe2576 100644\n--- a/unpack-trees.c\n+++ b/unpack-trees.c\n@@ -1166,8 +1166,10 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options\n \n \to->src_index = NULL;\n \tret = check_updates(o) ? (-2) : 0;\n-\tif (o->dst_index)\n+\tif (o->dst_index) {\n+\t\tdiscard_index(o->dst_index);\n \t\t*o->dst_index = o->result;\n+\t}\n \n done:\n \tclear_exclude_list(&el);\n-- \n1.8.3.698.g079b096\n"},{"id":"219977","messageId":"1370796057-25312-9-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 08/45] read-cache: plug a few leaks","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:20Z","receivedAt":"2013-06-09T16:40:20Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We are not freeing 'istate->cache' properly.\n\nWe can't rely on 'initialized' to keep track of the 'istate->cache',\nbecause it doesn't really mean it's initialized. So assume it always has\ndata, and free it before overwriting it.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n read-cache.c | 4 ++++\n 1 file changed, 4 insertions(+)\n\ndiff --git a/read-cache.c b/read-cache.c\nindex 5e30746..a1dd04d 100644\n--- a/read-cache.c\n+++ b/read-cache.c\n@@ -1451,6 +1451,7 @@ int read_index_from(struct index_state *istate, const char *path)\n \tistate->version = ntohl(hdr->hdr_version);\n \tistate->cache_nr = ntohl(hdr->hdr_entries);\n \tistate->cache_alloc = alloc_nr(istate->cache_nr);\n+\tfree(istate->cache);\n \tistate->cache = xcalloc(istate->cache_alloc, sizeof(*istate->cache));\n \tistate->initialized = 1;\n \n@@ -1512,6 +1513,9 @@ int discard_index(struct index_state *istate)\n \n \tfor (i = 0; i < istate->cache_nr; i++)\n \t\tfree(istate->cache[i]);\n+\tfree(istate->cache);\n+\tistate->cache = NULL;\n+\tistate->cache_alloc = 0;\n \tresolve_undo_clear_index(istate);\n \tistate->cache_nr = 0;\n \tistate->cache_changed = 0;\n-- \n1.8.3.698.g079b096\n"},{"id":"219980","messageId":"1370796057-25312-10-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 09/45] sequencer: remove useless indentation","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:21Z","receivedAt":"2013-06-09T16:40:21Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"By using good ol' goto.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/sequencer.c | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex e92e039..b2c8c94 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -390,7 +390,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)\n \tstruct commit_message msg = { NULL, NULL, NULL, NULL, NULL };\n \tchar *defmsg = NULL;\n \tstruct strbuf msgbuf = STRBUF_INIT;\n-\tint res, unborn = 0;\n+\tint res, unborn = 0, allow;\n \n \tif (opts->no_commit) {\n \t\t/*\n@@ -535,14 +535,16 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)\n \t\t      msg.subject);\n \t\tprint_advice(res == 1, opts);\n \t\trerere(opts->allow_rerere_auto);\n-\t} else {\n-\t\tint allow = allow_empty(opts, commit);\n+\t\tgoto leave;\n+\t}\n+\n+\tallow = allow_empty(opts, commit);\n \tif (allow < 0)\n \t\treturn allow;\n \tif (!opts->no_commit)\n \t\tres = run_git_commit(defmsg, opts, allow);\n-\t}\n \n+leave:\n \tfree_message(&msg);\n \tfree(defmsg);\n \n-- \n1.8.3.698.g079b096\n"},{"id":"219978","messageId":"1370796057-25312-11-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 10/45] sequencer: trivial fix","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:22Z","receivedAt":"2013-06-09T16:40:22Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We should free objects before leaving.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/sequencer.c | 6 ++++--\n 1 file changed, 4 insertions(+), 2 deletions(-)\n\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex b2c8c94..23b01b7 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -539,8 +539,10 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)\n \t}\n \n \tallow = allow_empty(opts, commit);\n-\tif (allow < 0)\n-\t\treturn allow;\n+\tif (allow < 0) {\n+\t\tres = allow;\n+\t\tgoto leave;\n+\t}\n \tif (!opts->no_commit)\n \t\tres = run_git_commit(defmsg, opts, allow);\n \n-- \n1.8.3.698.g079b096\n"},{"id":"219979","messageId":"1370796057-25312-12-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 11/45] cherry-pick: don't barf when there's nothing to do","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:23Z","receivedAt":"2013-06-09T16:40:23Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/sequencer.c             | 4 ++--\n t/t3510-cherry-pick-sequence.sh | 2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex 23b01b7..4d7dc8b 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -565,8 +565,8 @@ static void prepare_revs(struct replay_opts *opts)\n \tif (prepare_revision_walk(opts->revs))\n \t\tdie(_(\"revision walk setup failed\"));\n \n-\tif (!opts->revs->commits)\n-\t\tdie(_(\"empty commit set passed\"));\n+\tif (!opts->revs->commits && !opts->quiet)\n+\t\terror(_(\"empty commit set passed\"));\n }\n \n static void read_and_refresh_cache(struct replay_opts *opts)\ndiff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\nindex 7b7a89d..33c5512 100755\n--- a/t/t3510-cherry-pick-sequence.sh\n+++ b/t/t3510-cherry-pick-sequence.sh\n@@ -472,7 +472,7 @@ test_expect_success 'malformed instruction sheet 2' '\n \n test_expect_success 'empty commit set' '\n \tpristine_detach initial &&\n-\ttest_expect_code 128 git cherry-pick base..base\n+\tgit cherry-pick base..base\n '\n \n test_expect_success 'malformed instruction sheet 3' '\n-- \n1.8.3.698.g079b096\n"},{"id":"219981","messageId":"1370796057-25312-13-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 12/45] cherry-pick: add --skip-empty option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:24Z","receivedAt":"2013-06-09T16:40:24Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Pretty much what it says on the tin.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Documentation/git-cherry-pick.txt   |  3 +++\n builtin/revert.c                    |  8 ++++++++\n builtin/sequencer.c                 |  6 ++++++\n builtin/sequencer.h                 |  1 +\n t/t3508-cherry-pick-many-commits.sh | 13 +++++++++++++\n 5 files changed, 31 insertions(+)\n\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex c205d23..fccd936 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -129,6 +129,9 @@ effect to your index in a row.\n \tredundant commits are ignored.  This option overrides that behavior and\n \tcreates an empty commit object.  Implies `--allow-empty`.\n \n+--skip-empty::\n+\tInstead of failing, skip commits that are or become empty.\n+\n --strategy=<strategy>::\n \tUse the given merge strategy.  Should only be used once.\n \tSee the MERGE STRATEGIES section in linkgit:git-merge[1]\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 0401fdb..5a8453d 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -118,6 +118,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\tOPT_END(),\n \t\tOPT_END(),\n \t\tOPT_END(),\n+\t\tOPT_END(),\n \t};\n \n \tif (opts->action == REPLAY_PICK) {\n@@ -127,6 +128,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\t\tOPT_BOOLEAN(0, \"allow-empty\", &opts->allow_empty, N_(\"preserve initially empty commits\")),\n \t\t\tOPT_BOOLEAN(0, \"allow-empty-message\", &opts->allow_empty_message, N_(\"allow commits with empty messages\")),\n \t\t\tOPT_BOOLEAN(0, \"keep-redundant-commits\", &opts->keep_redundant_commits, N_(\"keep redundant, empty commits\")),\n+\t\t\tOPT_BOOLEAN(0, \"skip-empty\", &opts->skip_empty, N_(\"skip empty commits\")),\n \t\t\tOPT_END(),\n \t\t};\n \t\tif (parse_options_concat(options, ARRAY_SIZE(options), cp_extra))\n@@ -144,6 +146,12 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\t\t\t\"--abort\", rollback,\n \t\t\t\tNULL);\n \n+\tverify_opt_mutually_compatible(me,\n+\t\t\t\t\"--allow-empty\", opts->allow_empty,\n+\t\t\t\t\"--skip-empty\", opts->skip_empty,\n+\t\t\t\t\"--keep-redundant-commits\", opts->keep_redundant_commits,\n+\t\t\t\tNULL);\n+\n \t/* implies allow_empty */\n \tif (opts->keep_redundant_commits)\n \t\topts->allow_empty = 1;\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex 4d7dc8b..56551bb 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -538,6 +538,12 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)\n \t\tgoto leave;\n \t}\n \n+\tif (opts->skip_empty && is_index_unchanged() == 1) {\n+\t\twarning(_(\"skipping %s... %s\"),\n+\t\t\tfind_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV),\n+\t\t\tmsg.subject);\n+\t\tgoto leave;\n+\t}\n \tallow = allow_empty(opts, commit);\n \tif (allow < 0) {\n \t\tres = allow;\ndiff --git a/builtin/sequencer.h b/builtin/sequencer.h\nindex c341918..86e2eee 100644\n--- a/builtin/sequencer.h\n+++ b/builtin/sequencer.h\n@@ -32,6 +32,7 @@ struct replay_opts {\n \tint allow_empty;\n \tint allow_empty_message;\n \tint keep_redundant_commits;\n+\tint skip_empty;\n \n \tint mainline;\n \ndiff --git a/t/t3508-cherry-pick-many-commits.sh b/t/t3508-cherry-pick-many-commits.sh\nindex 19c99d7..3dc19c6 100755\n--- a/t/t3508-cherry-pick-many-commits.sh\n+++ b/t/t3508-cherry-pick-many-commits.sh\n@@ -187,4 +187,17 @@ test_expect_success 'cherry-pick --stdin works' '\n \tcheck_head_differs_from fourth\n '\n \n+test_expect_success 'cherry-pick skip empty' '\n+\tgit clean -fxd &&\n+\tgit checkout -b empty fourth &&\n+\tgit commit --allow-empty -m empty &&\n+\ttest_commit ontop &&\n+\tgit checkout -f master &&\n+\tgit reset --hard fourth &&\n+\tgit cherry-pick --skip-empty fourth..empty &&\n+\techo ontop > expected &&\n+\tgit log --format=%s fourth..HEAD > actual\n+\ttest_cmp expected actual\n+'\n+\n test_done\n-- \n1.8.3.698.g079b096\n"},{"id":"219987","messageId":"1370796057-25312-14-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 13/45] revert/cherry-pick: add --quiet option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:25Z","receivedAt":"2013-06-09T16:40:25Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Documentation/git-cherry-pick.txt | 6 +++++-\n Documentation/git-revert.txt      | 6 +++++-\n builtin/revert.c                  | 1 +\n builtin/sequencer.c               | 3 +++\n builtin/sequencer.h               | 1 +\n 5 files changed, 15 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex fccd936..da0bd81 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -8,7 +8,7 @@ git-cherry-pick - Apply the changes introduced by some existing commits\n SYNOPSIS\n --------\n [verse]\n-'git cherry-pick' [--edit] [-n] [-m parent-number] [-s] [-x] [--ff] <commit>...\n+'git cherry-pick' [-q] [--edit] [-n] [-m parent-number] [-s] [-x] [--ff] <commit>...\n 'git cherry-pick' --continue\n 'git cherry-pick' --quit\n 'git cherry-pick' --abort\n@@ -51,6 +51,10 @@ OPTIONS\n \tfeed all <commit>... arguments to a single revision walk\n \t(see a later example that uses 'maint master..next').\n \n+-q::\n+--quiet::\n+\tQuiet, suppress feedback messages.\n+\n -e::\n --edit::\n \tWith this option, 'git cherry-pick' will let you edit the commit\ndiff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt\nindex f79c9d8..98a8e7a 100644\n--- a/Documentation/git-revert.txt\n+++ b/Documentation/git-revert.txt\n@@ -8,7 +8,7 @@ git-revert - Revert some existing commits\n SYNOPSIS\n --------\n [verse]\n-'git revert' [--[no-]edit] [-n] [-m parent-number] [-s] <commit>...\n+'git revert' [-q] [--[no-]edit] [-n] [-m parent-number] [-s] <commit>...\n 'git revert' --continue\n 'git revert' --quit\n 'git revert' --abort\n@@ -40,6 +40,10 @@ OPTIONS\n \tdefault, see linkgit:git-rev-list[1] and its '--no-walk'\n \toption.\n \n+-q::\n+--quiet::\n+\tQuiet, suppress feedback messages.\n+\n -e::\n --edit::\n \tWith this option, 'git revert' will let you edit the commit\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex 5a8453d..ec83748 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -100,6 +100,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \tint contin = 0;\n \tint rollback = 0;\n \tstruct option options[] = {\n+\t\tOPT__QUIET(&opts->quiet, N_(\"suppress progress reporting\")),\n \t\tOPT_BOOLEAN(0, \"quit\", &remove_state, N_(\"end revert or cherry-pick sequence\")),\n \t\tOPT_BOOLEAN(0, \"continue\", &contin, N_(\"resume revert or cherry-pick sequence\")),\n \t\tOPT_BOOLEAN(0, \"abort\", &rollback, N_(\"cancel revert or cherry-pick sequence\")),\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex 56551bb..0f50942 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -305,6 +305,8 @@ static int run_git_commit(const char *defmsg, struct replay_opts *opts,\n \targv_array_init(&array);\n \targv_array_push(&array, \"commit\");\n \targv_array_push(&array, \"-n\");\n+\tif (opts->quiet)\n+\t\targv_array_push(&array, \"-q\");\n \n \tif (opts->signoff)\n \t\targv_array_push(&array, \"-s\");\n@@ -539,6 +541,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)\n \t}\n \n \tif (opts->skip_empty && is_index_unchanged() == 1) {\n+\t\tif (!opts->quiet)\n \t\t\twarning(_(\"skipping %s... %s\"),\n \t\t\t\tfind_unique_abbrev(commit->object.sha1, DEFAULT_ABBREV),\n \t\t\t\tmsg.subject);\ndiff --git a/builtin/sequencer.h b/builtin/sequencer.h\nindex 86e2eee..e45411c 100644\n--- a/builtin/sequencer.h\n+++ b/builtin/sequencer.h\n@@ -33,6 +33,7 @@ struct replay_opts {\n \tint allow_empty_message;\n \tint keep_redundant_commits;\n \tint skip_empty;\n+\tint quiet;\n \n \tint mainline;\n \n-- \n1.8.3.698.g079b096\n"},{"id":"219982","messageId":"1370796057-25312-15-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 14/45] revert/cherry-pick: add --skip option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:26Z","receivedAt":"2013-06-09T16:40:26Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Akin to 'am --skip' and 'rebase --skip'.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Documentation/git-cherry-pick.txt |  1 +\n Documentation/git-revert.txt      |  1 +\n Documentation/sequencer.txt       |  3 +++\n builtin/revert.c                  |  6 ++++++\n builtin/sequencer.c               | 24 ++++++++++++++++++++++++\n builtin/sequencer.h               |  3 ++-\n t/t3510-cherry-pick-sequence.sh   | 12 ++++++++++++\n 7 files changed, 49 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex da0bd81..d95c63c 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -10,6 +10,7 @@ SYNOPSIS\n [verse]\n 'git cherry-pick' [-q] [--edit] [-n] [-m parent-number] [-s] [-x] [--ff] <commit>...\n 'git cherry-pick' --continue\n+'git cherry-pick' --skip\n 'git cherry-pick' --quit\n 'git cherry-pick' --abort\n \ndiff --git a/Documentation/git-revert.txt b/Documentation/git-revert.txt\nindex 98a8e7a..52e146e 100644\n--- a/Documentation/git-revert.txt\n+++ b/Documentation/git-revert.txt\n@@ -10,6 +10,7 @@ SYNOPSIS\n [verse]\n 'git revert' [-q] [--[no-]edit] [-n] [-m parent-number] [-s] <commit>...\n 'git revert' --continue\n+'git revert' --skip\n 'git revert' --quit\n 'git revert' --abort\n \ndiff --git a/Documentation/sequencer.txt b/Documentation/sequencer.txt\nindex 5747f44..df2d355 100644\n--- a/Documentation/sequencer.txt\n+++ b/Documentation/sequencer.txt\n@@ -3,6 +3,9 @@\n \t'.git/sequencer'.  Can be used to continue after resolving\n \tconflicts in a failed cherry-pick or revert.\n \n+--skip::\n+\tSkip the current commit, and then continue.\n+\n --quit::\n \tForget about the current operation in progress.  Can be used\n \tto clear the sequencer state after a failed cherry-pick or\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex ec83748..d3d5600 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -99,11 +99,13 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \tint remove_state = 0;\n \tint contin = 0;\n \tint rollback = 0;\n+\tint skip = 0;\n \tstruct option options[] = {\n \t\tOPT__QUIET(&opts->quiet, N_(\"suppress progress reporting\")),\n \t\tOPT_BOOLEAN(0, \"quit\", &remove_state, N_(\"end revert or cherry-pick sequence\")),\n \t\tOPT_BOOLEAN(0, \"continue\", &contin, N_(\"resume revert or cherry-pick sequence\")),\n \t\tOPT_BOOLEAN(0, \"abort\", &rollback, N_(\"cancel revert or cherry-pick sequence\")),\n+\t\tOPT_BOOLEAN(0, \"skip\", &skip, N_(\"skip current commit in the sequence\")),\n \t\tOPT_BOOLEAN('n', \"no-commit\", &opts->no_commit, N_(\"don't automatically commit\")),\n \t\tOPT_BOOLEAN('e', \"edit\", &opts->edit, N_(\"edit the commit message\")),\n \t\tOPT_NOOP_NOARG('r', NULL),\n@@ -164,6 +166,8 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\topts->subcommand = REPLAY_CONTINUE;\n \telse if (rollback)\n \t\topts->subcommand = REPLAY_ROLLBACK;\n+\telse if (skip)\n+\t\topts->subcommand = REPLAY_SKIP;\n \telse\n \t\topts->subcommand = REPLAY_NONE;\n \n@@ -174,6 +178,8 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\t\tthis_operation = \"--quit\";\n \t\telse if (opts->subcommand == REPLAY_CONTINUE)\n \t\t\tthis_operation = \"--continue\";\n+\t\telse if (opts->subcommand == REPLAY_SKIP)\n+\t\t\tthis_operation = \"--skip\";\n \t\telse {\n \t\t\tassert(opts->subcommand == REPLAY_ROLLBACK);\n \t\t\tthis_operation = \"--abort\";\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex 0f50942..2b1b30a 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -961,6 +961,28 @@ static int sequencer_continue(struct replay_opts *opts)\n \treturn pick_commits(todo_list, opts);\n }\n \n+static int sequencer_skip(struct replay_opts *opts)\n+{\n+\tconst char *argv[4]; /* reset --hard HEAD + NULL */\n+\tstruct string_list merge_rr = STRING_LIST_INIT_DUP;\n+\tint ret;\n+\n+\tif (setup_rerere(&merge_rr, 0) >= 0) {\n+\t\trerere_clear(&merge_rr);\n+\t\tstring_list_clear(&merge_rr, 1);\n+\t}\n+\n+\targv[0] = \"reset\";\n+\targv[1] = \"--hard\";\n+\targv[2] = \"HEAD\";\n+\targv[3] = NULL;\n+\tret = run_command_v_opt(argv, RUN_GIT_CMD);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\treturn sequencer_continue(opts);\n+}\n+\n static int single_pick(struct commit *cmit, struct replay_opts *opts)\n {\n \tsetenv(GIT_REFLOG_ACTION, action_name(opts), 0);\n@@ -991,6 +1013,8 @@ int sequencer_pick_revisions(struct replay_opts *opts)\n \t\treturn sequencer_rollback(opts);\n \tif (opts->subcommand == REPLAY_CONTINUE)\n \t\treturn sequencer_continue(opts);\n+\tif (opts->subcommand == REPLAY_SKIP)\n+\t\treturn sequencer_skip(opts);\n \n \tfor (i = 0; i < opts->revs->pending.nr; i++) {\n \t\tunsigned char sha1[20];\ndiff --git a/builtin/sequencer.h b/builtin/sequencer.h\nindex e45411c..e69495a 100644\n--- a/builtin/sequencer.h\n+++ b/builtin/sequencer.h\n@@ -15,7 +15,8 @@ enum replay_subcommand {\n \tREPLAY_NONE,\n \tREPLAY_REMOVE_STATE,\n \tREPLAY_CONTINUE,\n-\tREPLAY_ROLLBACK\n+\tREPLAY_ROLLBACK,\n+\tREPLAY_SKIP\n };\n \n struct replay_opts {\ndiff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\nindex 33c5512..c43c327 100755\n--- a/t/t3510-cherry-pick-sequence.sh\n+++ b/t/t3510-cherry-pick-sequence.sh\n@@ -511,4 +511,16 @@ test_expect_success 'commit descriptions in insn sheet are optional' '\n \ttest_line_count = 4 commits\n '\n \n+test_expect_success 'skip' '\n+\tpristine_detach conflicting &&\n+\ttest_must_fail git cherry-pick initial..picked &&\n+\n+\tgit checkout HEAD -- unrelated &&\n+\ttest_must_fail git cherry-pick --continue &&\n+\tgit cherry-pick --skip &&\n+\n+\tgit rev-list initial..HEAD >commits &&\n+\ttest_line_count = 3 commits\n+'\n+\n test_done\n-- \n1.8.3.698.g079b096\n"},{"id":"219983","messageId":"1370796057-25312-16-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 15/45] builtin: add rewrite helper","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:27Z","receivedAt":"2013-06-09T16:40:27Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"So that we can load and store rewrites, as well as other operations on a\nlist of rewritten commits.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile          |  1 +\n builtin/rewrite.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++\n builtin/rewrite.h | 18 ++++++++++++++\n 3 files changed, 93 insertions(+)\n create mode 100644 builtin/rewrite.c\n create mode 100644 builtin/rewrite.h\n\ndiff --git a/Makefile b/Makefile\nindex 4c7bb88..a167e68 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -991,6 +991,7 @@ BUILTIN_OBJS += builtin/verify-tag.o\n BUILTIN_OBJS += builtin/write-tree.o\n \n BUILTIN_LIB_OBJS += builtin/sequencer.o\n+BUILTIN_LIB_OBJS += builtin/rewrite.o\n BUILTIN_LIB_OBJS += $(BUILTIN_OBJS)\n \n GITLIBS = $(LIB_FILE) $(XDIFF_LIB)\ndiff --git a/builtin/rewrite.c b/builtin/rewrite.c\nnew file mode 100644\nindex 0000000..2519352\n--- /dev/null\n+++ b/builtin/rewrite.c\n@@ -0,0 +1,74 @@\n+#include \"cache.h\"\n+#include \"rewrite.h\"\n+\n+void add_rewritten(struct rewritten *list, unsigned char *from, unsigned char *to)\n+{\n+\tstruct rewritten_item *item;\n+\tif (list->nr + 1 >= list->alloc) {\n+\t\tlist->alloc += 32;\n+\t\tlist->items = xrealloc(list->items, list->alloc * sizeof(*list->items));\n+\t}\n+\titem = &list->items[list->nr];\n+\thashcpy(item->from, from);\n+\thashcpy(item->to, to);\n+\tlist->nr++;\n+}\n+\n+int store_rewritten(struct rewritten *list, const char *file)\n+{\n+\tstatic struct lock_file lock;\n+\tstruct strbuf buf = STRBUF_INIT;\n+\tint fd, i, ret = 0;\n+\n+\tfd = hold_lock_file_for_update(&lock, file, LOCK_DIE_ON_ERROR);\n+\tfor (i = 0; i < list->nr; i++) {\n+\t\tstruct rewritten_item *item = &list->items[i];\n+\t\tstrbuf_addf(&buf, \"%s %s\\n\", sha1_to_hex(item->from), sha1_to_hex(item->to));\n+\t}\n+\tif (write_in_full(fd, buf.buf, buf.len) < 0) {\n+\t\terror(_(\"Could not write to %s\"), file);\n+\t\tret = 1;\n+\t\tgoto leave;\n+\t}\n+\tif (commit_lock_file(&lock) < 0) {\n+\t\terror(_(\"Error wrapping up %s.\"), file);\n+\t\tret = 1;\n+\t\tgoto leave;\n+\t}\n+leave:\n+\tstrbuf_release(&buf);\n+\treturn ret;\n+}\n+\n+void load_rewritten(struct rewritten *list, const char *file)\n+{\n+\tstruct strbuf buf = STRBUF_INIT;\n+\tchar *p;\n+\tint fd;\n+\n+\tfd = open(file, O_RDONLY);\n+\tif (fd < 0)\n+\t\treturn;\n+\tif (strbuf_read(&buf, fd, 0) < 0) {\n+\t\tclose(fd);\n+\t\tstrbuf_release(&buf);\n+\t\treturn;\n+\t}\n+\tclose(fd);\n+\n+\tfor (p = buf.buf; *p;) {\n+\t\tunsigned char from[20];\n+\t\tunsigned char to[20];\n+\t\tchar *eol = strchrnul(p, '\\n');\n+\t\tif (eol - p != 81)\n+\t\t\t/* wrong size */\n+\t\t\tbreak;\n+\t\tif (get_sha1_hex(p, from))\n+\t\t\tbreak;\n+\t\tif (get_sha1_hex(p + 41, to))\n+\t\t\tbreak;\n+\t\tadd_rewritten(list, from, to);\n+\t\tp = *eol ? eol + 1 : eol;\n+\t}\n+\tstrbuf_release(&buf);\n+}\ndiff --git a/builtin/rewrite.h b/builtin/rewrite.h\nnew file mode 100644\nindex 0000000..09e7222\n--- /dev/null\n+++ b/builtin/rewrite.h\n@@ -0,0 +1,18 @@\n+#ifndef REWRITE_H\n+#define REWRITE_H\n+\n+struct rewritten_item {\n+\tunsigned char from[20];\n+\tunsigned char to[20];\n+};\n+\n+struct rewritten {\n+\tstruct rewritten_item *items;\n+\tunsigned int nr, alloc;\n+};\n+\n+void add_rewritten(struct rewritten *list, unsigned char *from, unsigned char *to);\n+int store_rewritten(struct rewritten *list, const char *file);\n+void load_rewritten(struct rewritten *list, const char *file);\n+\n+#endif\n-- \n1.8.3.698.g079b096\n"},{"id":"219984","messageId":"1370796057-25312-17-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 16/45] cherry-pick: store rewritten commits","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:28Z","receivedAt":"2013-06-09T16:40:28Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Will be useful for the next commits.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/sequencer.c | 23 ++++++++++++++++++++++-\n builtin/sequencer.h |  1 +\n 2 files changed, 23 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex 2b1b30a..24034f2 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -15,9 +15,12 @@\n #include \"refs.h\"\n #include \"argv-array.h\"\n #include \"log-tree.h\"\n+#include \"rewrite.h\"\n \n #define GIT_REFLOG_ACTION \"GIT_REFLOG_ACTION\"\n \n+static struct rewritten rewritten;\n+\n static void remove_sequencer_state(void)\n {\n \tstruct strbuf seq_dir = STRBUF_INIT;\n@@ -555,6 +558,14 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)\n \tif (!opts->no_commit)\n \t\tres = run_git_commit(defmsg, opts, allow);\n \n+\tif (!res && opts->action == REPLAY_PICK) {\n+\t\tunsigned char to[20];\n+\n+\t\tif (read_ref(\"HEAD\", to))\n+\t\t\tgoto leave;\n+\n+\t\tadd_rewritten(&rewritten, commit->object.sha1, to);\n+\t}\n leave:\n \tfree_message(&msg);\n \tfree(defmsg);\n@@ -917,9 +928,12 @@ static int pick_commits(struct commit_list *todo_list, struct replay_opts *opts)\n \tfor (cur = todo_list; cur; cur = cur->next) {\n \t\tsave_todo(cur, opts);\n \t\tres = do_pick_commit(cur->item, opts);\n-\t\tif (res)\n+\t\tif (res) {\n+\t\t\tif (opts->action == REPLAY_PICK)\n+\t\t\t\tstore_rewritten(&rewritten, git_path(SEQ_REWR_FILE));\n \t\t\treturn res;\n \t\t}\n+\t}\n \n \t/*\n \t * Sequence of picks finished successfully; cleanup by\n@@ -947,6 +961,8 @@ static int sequencer_continue(struct replay_opts *opts)\n \t\treturn continue_single_pick();\n \tread_populate_opts(&opts);\n \tread_populate_todo(&todo_list, opts);\n+\tif (opts->action == REPLAY_PICK)\n+\t\tload_rewritten(&rewritten, git_path(SEQ_REWR_FILE));\n \n \t/* Verify that the conflict has been resolved */\n \tif (file_exists(git_path(\"CHERRY_PICK_HEAD\")) ||\n@@ -957,6 +973,11 @@ static int sequencer_continue(struct replay_opts *opts)\n \t}\n \tif (index_differs_from(\"HEAD\", 0))\n \t\treturn error_dirty_index(opts);\n+\tif (opts->action == REPLAY_PICK) {\n+\t\tunsigned char to[20];\n+\t\tif (!read_ref(\"HEAD\", to))\n+\t\t\tadd_rewritten(&rewritten, todo_list->item->object.sha1, to);\n+\t}\n \ttodo_list = todo_list->next;\n \treturn pick_commits(todo_list, opts);\n }\ndiff --git a/builtin/sequencer.h b/builtin/sequencer.h\nindex e69495a..63ba274 100644\n--- a/builtin/sequencer.h\n+++ b/builtin/sequencer.h\n@@ -5,6 +5,7 @@\n #define SEQ_HEAD_FILE\t\"sequencer/head\"\n #define SEQ_TODO_FILE\t\"sequencer/todo\"\n #define SEQ_OPTS_FILE\t\"sequencer/opts\"\n+#define SEQ_REWR_FILE\t\"sequencer/rewritten\"\n \n enum replay_action {\n \tREPLAY_REVERT,\n-- \n1.8.3.698.g079b096\n"},{"id":"219985","messageId":"1370796057-25312-18-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 17/45] cherry-pick: don't store skipped commit","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:29Z","receivedAt":"2013-06-09T16:40:29Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/sequencer.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex 24034f2..d40fda9 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -953,7 +953,7 @@ static int continue_single_pick(void)\n \treturn run_command_v_opt(argv, RUN_GIT_CMD);\n }\n \n-static int sequencer_continue(struct replay_opts *opts)\n+static int sequencer_continue(struct replay_opts *opts, int skip)\n {\n \tstruct commit_list *todo_list = NULL;\n \n@@ -973,7 +973,7 @@ static int sequencer_continue(struct replay_opts *opts)\n \t}\n \tif (index_differs_from(\"HEAD\", 0))\n \t\treturn error_dirty_index(opts);\n-\tif (opts->action == REPLAY_PICK) {\n+\tif (opts->action == REPLAY_PICK && !skip) {\n \t\tunsigned char to[20];\n \t\tif (!read_ref(\"HEAD\", to))\n \t\t\tadd_rewritten(&rewritten, todo_list->item->object.sha1, to);\n@@ -1001,7 +1001,7 @@ static int sequencer_skip(struct replay_opts *opts)\n \tif (ret)\n \t\treturn ret;\n \n-\treturn sequencer_continue(opts);\n+\treturn sequencer_continue(opts, 1);\n }\n \n static int single_pick(struct commit *cmit, struct replay_opts *opts)\n@@ -1033,7 +1033,7 @@ int sequencer_pick_revisions(struct replay_opts *opts)\n \tif (opts->subcommand == REPLAY_ROLLBACK)\n \t\treturn sequencer_rollback(opts);\n \tif (opts->subcommand == REPLAY_CONTINUE)\n-\t\treturn sequencer_continue(opts);\n+\t\treturn sequencer_continue(opts, 0);\n \tif (opts->subcommand == REPLAY_SKIP)\n \t\treturn sequencer_skip(opts);\n \n-- \n1.8.3.698.g079b096\n"},{"id":"220015","messageId":"1370796057-25312-19-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 18/45] builtin: move run_rewrite_hook() to rewrite.c","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:30Z","receivedAt":"2013-06-09T16:40:30Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"And use struct rewrite.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/commit.c  | 38 +++++---------------------------------\n builtin/rewrite.c | 32 ++++++++++++++++++++++++++++++++\n builtin/rewrite.h |  1 +\n 3 files changed, 38 insertions(+), 33 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 1621dfc..56dab4f 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -29,6 +29,7 @@\n #include \"gpg-interface.h\"\n #include \"column.h\"\n #include \"sequencer.h\"\n+#include \"rewrite.h\"\n \n static const char * const builtin_commit_usage[] = {\n \tN_(\"git commit [options] [--] <pathspec>...\"),\n@@ -1323,38 +1324,6 @@ static int git_commit_config(const char *k, const char *v, void *cb)\n \treturn git_status_config(k, v, s);\n }\n \n-static int run_rewrite_hook(const unsigned char *oldsha1,\n-\t\t\t    const unsigned char *newsha1)\n-{\n-\t/* oldsha1 SP newsha1 LF NUL */\n-\tstatic char buf[2*40 + 3];\n-\tstruct child_process proc;\n-\tconst char *argv[3];\n-\tint code;\n-\tsize_t n;\n-\n-\targv[0] = find_hook(\"post-rewrite\");\n-\tif (!argv[0])\n-\t\treturn 0;\n-\n-\targv[1] = \"amend\";\n-\targv[2] = NULL;\n-\n-\tmemset(&proc, 0, sizeof(proc));\n-\tproc.argv = argv;\n-\tproc.in = -1;\n-\tproc.stdout_to_stderr = 1;\n-\n-\tcode = start_command(&proc);\n-\tif (code)\n-\t\treturn code;\n-\tn = snprintf(buf, sizeof(buf), \"%s %s\\n\",\n-\t\t     sha1_to_hex(oldsha1), sha1_to_hex(newsha1));\n-\twrite_in_full(proc.in, buf, n);\n-\tclose(proc.in);\n-\treturn finish_command(&proc);\n-}\n-\n int cmd_commit(int argc, const char **argv, const char *prefix)\n {\n \tstatic struct wt_status s;\n@@ -1589,13 +1558,16 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \trun_hook(get_index_file(), \"post-commit\", NULL);\n \tif (amend && !no_post_rewrite) {\n \t\tstruct notes_rewrite_cfg *cfg;\n+\t\tstruct rewritten rewrite;\n+\t\tmemset(&rewrite, 0, sizeof(rewrite));\n \t\tcfg = init_copy_notes_for_rewrite(\"amend\");\n \t\tif (cfg) {\n \t\t\t/* we are amending, so current_head is not NULL */\n \t\t\tcopy_note_for_rewrite(cfg, current_head->object.sha1, sha1);\n \t\t\tfinish_copy_notes_for_rewrite(cfg);\n \t\t}\n-\t\trun_rewrite_hook(current_head->object.sha1, sha1);\n+\t\tadd_rewritten(&rewrite, current_head->object.sha1, sha1);\n+\t\trun_rewrite_hook(&rewrite, \"amend\");\n \t}\n \tif (!quiet)\n \t\tprint_summary(prefix, sha1, !current_head);\ndiff --git a/builtin/rewrite.c b/builtin/rewrite.c\nindex 2519352..15fcd1a 100644\n--- a/builtin/rewrite.c\n+++ b/builtin/rewrite.c\n@@ -1,5 +1,6 @@\n #include \"cache.h\"\n #include \"rewrite.h\"\n+#include \"run-command.h\"\n \n void add_rewritten(struct rewritten *list, unsigned char *from, unsigned char *to)\n {\n@@ -72,3 +73,34 @@ void load_rewritten(struct rewritten *list, const char *file)\n \t}\n \tstrbuf_release(&buf);\n }\n+\n+int run_rewrite_hook(struct rewritten *list, const char *name)\n+{\n+\tstruct strbuf buf = STRBUF_INIT;\n+\tstruct child_process proc;\n+\tconst char *argv[3];\n+\tint code, i;\n+\n+\targv[0] = find_hook(\"post-rewrite\");\n+\tif (!argv[0])\n+\t\treturn 0;\n+\n+\targv[1] = name;\n+\targv[2] = NULL;\n+\n+\tmemset(&proc, 0, sizeof(proc));\n+\tproc.argv = argv;\n+\tproc.in = -1;\n+\tproc.stdout_to_stderr = 1;\n+\n+\tcode = start_command(&proc);\n+\tif (code)\n+\t\treturn code;\n+\tfor (i = 0; i < list->nr; i++) {\n+\t\tstruct rewritten_item *item = &list->items[i];\n+\t\tstrbuf_addf(&buf, \"%s %s\\n\", sha1_to_hex(item->from), sha1_to_hex(item->to));\n+\t}\n+\twrite_in_full(proc.in, buf.buf, buf.len);\n+\tclose(proc.in);\n+\treturn finish_command(&proc);\n+}\ndiff --git a/builtin/rewrite.h b/builtin/rewrite.h\nindex 09e7222..fd00e66 100644\n--- a/builtin/rewrite.h\n+++ b/builtin/rewrite.h\n@@ -14,5 +14,6 @@ struct rewritten {\n void add_rewritten(struct rewritten *list, unsigned char *from, unsigned char *to);\n int store_rewritten(struct rewritten *list, const char *file);\n void load_rewritten(struct rewritten *list, const char *file);\n+int run_rewrite_hook(struct rewritten *list, const char *name);\n \n #endif\n-- \n1.8.3.698.g079b096\n"},{"id":"219986","messageId":"1370796057-25312-20-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 19/45] builtin: add copy_rewrite_notes()","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:31Z","receivedAt":"2013-06-09T16:40:31Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"And use it on commit.c.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/commit.c  |  8 +-------\n builtin/rewrite.c | 17 +++++++++++++++++\n builtin/rewrite.h |  1 +\n 3 files changed, 19 insertions(+), 7 deletions(-)\n\ndiff --git a/builtin/commit.c b/builtin/commit.c\nindex 56dab4f..4f35794 100644\n--- a/builtin/commit.c\n+++ b/builtin/commit.c\n@@ -1557,16 +1557,10 @@ int cmd_commit(int argc, const char **argv, const char *prefix)\n \trerere(0);\n \trun_hook(get_index_file(), \"post-commit\", NULL);\n \tif (amend && !no_post_rewrite) {\n-\t\tstruct notes_rewrite_cfg *cfg;\n \t\tstruct rewritten rewrite;\n \t\tmemset(&rewrite, 0, sizeof(rewrite));\n-\t\tcfg = init_copy_notes_for_rewrite(\"amend\");\n-\t\tif (cfg) {\n-\t\t\t/* we are amending, so current_head is not NULL */\n-\t\t\tcopy_note_for_rewrite(cfg, current_head->object.sha1, sha1);\n-\t\t\tfinish_copy_notes_for_rewrite(cfg);\n-\t\t}\n \t\tadd_rewritten(&rewrite, current_head->object.sha1, sha1);\n+\t\tcopy_rewrite_notes(&rewrite, \"amend\");\n \t\trun_rewrite_hook(&rewrite, \"amend\");\n \t}\n \tif (!quiet)\ndiff --git a/builtin/rewrite.c b/builtin/rewrite.c\nindex 15fcd1a..02e0ea9 100644\n--- a/builtin/rewrite.c\n+++ b/builtin/rewrite.c\n@@ -104,3 +104,20 @@ int run_rewrite_hook(struct rewritten *list, const char *name)\n \tclose(proc.in);\n \treturn finish_command(&proc);\n }\n+\n+void copy_rewrite_notes(struct rewritten *list, const char *name)\n+{\n+\tstruct notes_rewrite_cfg *cfg;\n+\tint i;\n+\n+\tcfg = init_copy_notes_for_rewrite(name);\n+\tif (!cfg)\n+\t\treturn;\n+\n+\tfor (i = 0; i < list->nr; i++) {\n+\t\tstruct rewritten_item *item = &list->items[i];\n+\t\tcopy_note_for_rewrite(cfg, item->from, item->to);\n+\t}\n+\n+\tfinish_copy_notes_for_rewrite(cfg);\n+}\ndiff --git a/builtin/rewrite.h b/builtin/rewrite.h\nindex fd00e66..38b2caf 100644\n--- a/builtin/rewrite.h\n+++ b/builtin/rewrite.h\n@@ -15,5 +15,6 @@ void add_rewritten(struct rewritten *list, unsigned char *from, unsigned char *t\n int store_rewritten(struct rewritten *list, const char *file);\n void load_rewritten(struct rewritten *list, const char *file);\n int run_rewrite_hook(struct rewritten *list, const char *name);\n+void copy_rewrite_notes(struct rewritten *list, const char *name);\n \n #endif\n-- \n1.8.3.698.g079b096\n"},{"id":"219988","messageId":"1370796057-25312-21-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 20/45] cherry-pick: copy notes and run hooks","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:32Z","receivedAt":"2013-06-09T16:40:32Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/rewrite.c   |  1 +\n builtin/sequencer.c | 18 +++++++++++++++++-\n 2 files changed, 18 insertions(+), 1 deletion(-)\n\ndiff --git a/builtin/rewrite.c b/builtin/rewrite.c\nindex 02e0ea9..acbad44 100644\n--- a/builtin/rewrite.c\n+++ b/builtin/rewrite.c\n@@ -1,6 +1,7 @@\n #include \"cache.h\"\n #include \"rewrite.h\"\n #include \"run-command.h\"\n+#include \"builtin.h\"\n \n void add_rewritten(struct rewritten *list, unsigned char *from, unsigned char *to)\n {\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex d40fda9..fe96f1f 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -21,6 +21,15 @@\n \n static struct rewritten rewritten;\n \n+static void finish(struct replay_opts *opts)\n+{\n+\tif (opts->action != REPLAY_PICK)\n+\t\treturn;\n+\n+\trun_rewrite_hook(&rewritten, \"cherry-pick\");\n+\tcopy_rewrite_notes(&rewritten, \"cherry-pick\");\n+}\n+\n static void remove_sequencer_state(void)\n {\n \tstruct strbuf seq_dir = STRBUF_INIT;\n@@ -935,6 +944,8 @@ static int pick_commits(struct commit_list *todo_list, struct replay_opts *opts)\n \t\t}\n \t}\n \n+\tfinish(opts);\n+\n \t/*\n \t * Sequence of picks finished successfully; cleanup by\n \t * removing the .git/sequencer directory\n@@ -1006,8 +1017,13 @@ static int sequencer_skip(struct replay_opts *opts)\n \n static int single_pick(struct commit *cmit, struct replay_opts *opts)\n {\n+\tint ret;\n \tsetenv(GIT_REFLOG_ACTION, action_name(opts), 0);\n-\treturn do_pick_commit(cmit, opts);\n+\tret = do_pick_commit(cmit, opts);\n+\tif (ret)\n+\t\treturn ret;\n+\tfinish(opts);\n+\treturn 0;\n }\n \n int sequencer_pick_revisions(struct replay_opts *opts)\n-- \n1.8.3.698.g079b096\n"},{"id":"219991","messageId":"1370796057-25312-22-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 21/45] cherry-pick: add --action-name option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:33Z","receivedAt":"2013-06-09T16:40:33Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"So it can be used by other tools (e.g. git rebase), and the right action\nis passed to the hooks and notes rewrite stuff.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/revert.c           |  2 ++\n builtin/sequencer.c        | 17 ++++++++++++++---\n builtin/sequencer.h        |  2 ++\n git-rebase--interactive.sh |  4 ++--\n 4 files changed, 20 insertions(+), 5 deletions(-)\n\ndiff --git a/builtin/revert.c b/builtin/revert.c\nindex d3d5600..6066ad2 100644\n--- a/builtin/revert.c\n+++ b/builtin/revert.c\n@@ -122,6 +122,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\tOPT_END(),\n \t\tOPT_END(),\n \t\tOPT_END(),\n+\t\tOPT_END(),\n \t};\n \n \tif (opts->action == REPLAY_PICK) {\n@@ -132,6 +133,7 @@ static void parse_args(int argc, const char **argv, struct replay_opts *opts)\n \t\t\tOPT_BOOLEAN(0, \"allow-empty-message\", &opts->allow_empty_message, N_(\"allow commits with empty messages\")),\n \t\t\tOPT_BOOLEAN(0, \"keep-redundant-commits\", &opts->keep_redundant_commits, N_(\"keep redundant, empty commits\")),\n \t\t\tOPT_BOOLEAN(0, \"skip-empty\", &opts->skip_empty, N_(\"skip empty commits\")),\n+\t\t\tOPT_STRING(0, \"action-name\", &opts->action_name, N_(\"name\"), N_(\"action name\")),\n \t\t\tOPT_END(),\n \t\t};\n \t\tif (parse_options_concat(options, ARRAY_SIZE(options), cp_extra))\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex fe96f1f..a419387 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -23,11 +23,18 @@ static struct rewritten rewritten;\n \n static void finish(struct replay_opts *opts)\n {\n+\tconst char *name;\n+\n \tif (opts->action != REPLAY_PICK)\n \t\treturn;\n \n-\trun_rewrite_hook(&rewritten, \"cherry-pick\");\n-\tcopy_rewrite_notes(&rewritten, \"cherry-pick\");\n+\tname = opts->action_name ? opts->action_name : \"cherry-pick\";\n+\n+\tif (!*name)\n+\t\treturn;\n+\n+\trun_rewrite_hook(&rewritten, name);\n+\tcopy_rewrite_notes(&rewritten, name);\n }\n \n static void remove_sequencer_state(void)\n@@ -744,7 +751,9 @@ static int populate_opts_cb(const char *key, const char *value, void *data)\n \telse if (!strcmp(key, \"options.strategy-option\")) {\n \t\tALLOC_GROW(opts->xopts, opts->xopts_nr + 1, opts->xopts_alloc);\n \t\topts->xopts[opts->xopts_nr++] = xstrdup(value);\n-\t} else\n+\t} else if (!strcmp(key, \"options.action-name\"))\n+\t\tgit_config_string(&opts->action_name, key, value);\n+\telse\n \t\treturn error(_(\"Invalid key: %s\"), key);\n \n \tif (!error_flag)\n@@ -921,6 +930,8 @@ static void save_opts(struct replay_opts *opts)\n \t\t\t\t\t\t\t\"options.strategy-option\",\n \t\t\t\t\t\t\topts->xopts[i], \"^$\", 0);\n \t}\n+\tif (opts->action_name)\n+\t\tgit_config_set_in_file(opts_file, \"options.action-name\", opts->action_name);\n }\n \n static int pick_commits(struct commit_list *todo_list, struct replay_opts *opts)\ndiff --git a/builtin/sequencer.h b/builtin/sequencer.h\nindex 63ba274..c69eeff 100644\n--- a/builtin/sequencer.h\n+++ b/builtin/sequencer.h\n@@ -46,6 +46,8 @@ struct replay_opts {\n \n \t/* Only used by REPLAY_NONE */\n \tstruct rev_info *revs;\n+\n+\tconst char *action_name;\n };\n \n int sequencer_pick_revisions(struct replay_opts *opts);\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex f953d8d..9f42a71 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -239,7 +239,7 @@ pick_one () {\n \n \ttest -d \"$rewritten\" &&\n \t\tpick_one_preserving_merges \"$@\" && return\n-\toutput git cherry-pick $empty_args $ff \"$@\"\n+\toutput git cherry-pick --action-name '' $empty_args $ff \"$@\"\n }\n \n pick_one_preserving_merges () {\n@@ -350,7 +350,7 @@ pick_one_preserving_merges () {\n \t\t\techo \"$sha1 $(git rev-parse HEAD^0)\" >> \"$rewritten_list\"\n \t\t\t;;\n \t\t*)\n-\t\t\toutput git cherry-pick \"$@\" ||\n+\t\t\toutput git cherry-pick --action-name '' \"$@\" ||\n \t\t\t\tdie_with_patch $sha1 \"Could not pick $sha1\"\n \t\t\t;;\n \t\tesac\n-- \n1.8.3.698.g079b096\n"},{"id":"219990","messageId":"1370796057-25312-23-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 22/45] cherry-pick: remember rerere-autoupdate","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:34Z","receivedAt":"2013-06-09T16:40:34Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n builtin/sequencer.c | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex a419387..ddd369f 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -753,6 +753,8 @@ static int populate_opts_cb(const char *key, const char *value, void *data)\n \t\topts->xopts[opts->xopts_nr++] = xstrdup(value);\n \t} else if (!strcmp(key, \"options.action-name\"))\n \t\tgit_config_string(&opts->action_name, key, value);\n+\telse if (!strcmp(key, \"options.allow-rerere-auto\"))\n+\t\topts->allow_rerere_auto = git_config_int(key, value);\n \telse\n \t\treturn error(_(\"Invalid key: %s\"), key);\n \n@@ -932,6 +934,12 @@ static void save_opts(struct replay_opts *opts)\n \t}\n \tif (opts->action_name)\n \t\tgit_config_set_in_file(opts_file, \"options.action-name\", opts->action_name);\n+\tif (opts->allow_rerere_auto) {\n+\t\tstruct strbuf buf = STRBUF_INIT;\n+\t\tstrbuf_addf(&buf, \"%d\", opts->allow_rerere_auto);\n+\t\tgit_config_set_in_file(opts_file, \"options.allow-rerere-auto\", buf.buf);\n+\t\tstrbuf_release(&buf);\n+\t}\n }\n \n static int pick_commits(struct commit_list *todo_list, struct replay_opts *opts)\n-- \n1.8.3.698.g079b096\n"},{"id":"219989","messageId":"1370796057-25312-24-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 23/45] rebase: split the cherry-pick stuff","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:35Z","receivedAt":"2013-06-09T16:40:35Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"They do something completely different from 'git am', it belongs in a\ndifferent file.\n\nNo functional changes.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n .gitignore                |  1 +\n Makefile                  |  1 +\n git-rebase--am.sh         | 11 +----------\n git-rebase--cherrypick.sh | 30 ++++++++++++++++++++++++++++++\n git-rebase.sh             |  4 ++++\n 5 files changed, 37 insertions(+), 10 deletions(-)\n create mode 100644 git-rebase--cherrypick.sh\n\ndiff --git a/.gitignore b/.gitignore\nindex 1640c3a..2a3dbae 100644\n--- a/.gitignore\n+++ b/.gitignore\n@@ -113,6 +113,7 @@\n /git-read-tree\n /git-rebase\n /git-rebase--am\n+/git-rebase--cherrypick\n /git-rebase--interactive\n /git-rebase--merge\n /git-receive-pack\ndiff --git a/Makefile b/Makefile\nindex a167e68..4719979 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -473,6 +473,7 @@ SCRIPT_SH += git-web--browse.sh\n SCRIPT_LIB += git-mergetool--lib\n SCRIPT_LIB += git-parse-remote\n SCRIPT_LIB += git-rebase--am\n+SCRIPT_LIB += git-rebase--cherrypick\n SCRIPT_LIB += git-rebase--interactive\n SCRIPT_LIB += git-rebase--merge\n SCRIPT_LIB += git-sh-setup\ndiff --git a/git-rebase--am.sh b/git-rebase--am.sh\nindex 34e3102..6460028 100644\n--- a/git-rebase--am.sh\n+++ b/git-rebase--am.sh\n@@ -19,15 +19,7 @@ esac\n test -n \"$rebase_root\" && root_flag=--root\n \n ret=0\n-if test -n \"$keep_empty\"\n-then\n-\t# we have to do this the hard way.  git format-patch completely squashes\n-\t# empty commits and even if it didn't the format doesn't really lend\n-\t# itself well to recording empty patches.  fortunately, cherry-pick\n-\t# makes this easy\n-\tgit cherry-pick --allow-empty \"$revisions\"\n-\tret=$?\n-else\n+\n rm -f \"$GIT_DIR/rebased-patches\"\n \n git format-patch -k --stdout --full-index --ignore-if-in-upstream \\\n@@ -63,7 +55,6 @@ else\n ret=$?\n \n rm -f \"$GIT_DIR/rebased-patches\"\n-fi\n \n if test 0 != $ret\n then\ndiff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh\nnew file mode 100644\nindex 0000000..2c16995\n--- /dev/null\n+++ b/git-rebase--cherrypick.sh\n@@ -0,0 +1,30 @@\n+#!/bin/sh\n+#\n+# Copyright (c) 2010 Junio C Hamano.\n+#\n+\n+case \"$action\" in\n+continue)\n+\tgit am --resolved --resolvemsg=\"$resolvemsg\" &&\n+\tmove_to_original_branch\n+\treturn\n+\t;;\n+skip)\n+\tgit am --skip --resolvemsg=\"$resolvemsg\" &&\n+\tmove_to_original_branch\n+\treturn\n+\t;;\n+esac\n+\n+test -n \"$rebase_root\" && root_flag=--root\n+\n+git cherry-pick --allow-empty \"$revisions\"\n+ret=$?\n+\n+if test 0 != $ret\n+then\n+\ttest -d \"$state_dir\" && write_basic_state\n+\treturn $ret\n+fi\n+\n+move_to_original_branch\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex d0c11a9..70762f1 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -413,6 +413,10 @@ elif test -n \"$do_merge\"\n then\n \ttype=merge\n \tstate_dir=\"$merge_dir\"\n+elif test -n \"$keep_empty\"\n+then\n+\ttype=cherrypick\n+\tstate_dir=\"$apply_dir\"\n else\n \ttype=am\n \tstate_dir=\"$apply_dir\"\n-- \n1.8.3.698.g079b096\n"},{"id":"219992","messageId":"1370796057-25312-25-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 24/45] rebase: cherry-pick: fix mode storage","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:36Z","receivedAt":"2013-06-09T16:40:36Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We don't use the 'rebase-apply'.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-rebase--cherrypick.sh | 5 ++++-\n git-rebase.sh             | 5 ++++-\n 2 files changed, 8 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh\nindex 2c16995..e142cfb 100644\n--- a/git-rebase--cherrypick.sh\n+++ b/git-rebase--cherrypick.sh\n@@ -18,12 +18,15 @@ esac\n \n test -n \"$rebase_root\" && root_flag=--root\n \n+mkdir -p \"$state_dir\" || die \"Could not create temporary $state_dir\"\n+: > \"$state_dir\"/cherrypick || die \"Could not mark as cherrypick\"\n+\n git cherry-pick --allow-empty \"$revisions\"\n ret=$?\n \n if test 0 != $ret\n then\n-\ttest -d \"$state_dir\" && write_basic_state\n+\twrite_basic_state\n \treturn $ret\n fi\n \ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 70762f1..4465daf 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -205,6 +205,9 @@ then\n \tthen\n \t\ttype=interactive\n \t\tinteractive_rebase=explicit\n+\telif test -f \"$merge_dir\"/cherrypick\n+\tthen\n+\t\ttype=cherrypick\n \telse\n \t\ttype=merge\n \tfi\n@@ -416,7 +419,7 @@ then\n elif test -n \"$keep_empty\"\n then\n \ttype=cherrypick\n-\tstate_dir=\"$apply_dir\"\n+\tstate_dir=\"$merge_dir\"\n else\n \ttype=am\n \tstate_dir=\"$apply_dir\"\n-- \n1.8.3.698.g079b096\n"},{"id":"219996","messageId":"1370796057-25312-26-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 25/45] rebase: cherry-pick: fix sequence continuation","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:37Z","receivedAt":"2013-06-09T16:40:37Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We are not in am mode.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-rebase--cherrypick.sh | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh\nindex e142cfb..d8d32fe 100644\n--- a/git-rebase--cherrypick.sh\n+++ b/git-rebase--cherrypick.sh\n@@ -5,12 +5,12 @@\n \n case \"$action\" in\n continue)\n-\tgit am --resolved --resolvemsg=\"$resolvemsg\" &&\n+\tgit cherry-pick --continue &&\n \tmove_to_original_branch\n \treturn\n \t;;\n skip)\n-\tgit am --skip --resolvemsg=\"$resolvemsg\" &&\n+\tgit cherry-pick --skip &&\n \tmove_to_original_branch\n \treturn\n \t;;\n-- \n1.8.3.698.g079b096\n"},{"id":"219995","messageId":"1370796057-25312-27-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 26/45] rebase: cherry-pick: fix abort of cherry mode","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:38Z","receivedAt":"2013-06-09T16:40:38Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-rebase.sh | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 4465daf..0937e2c 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -369,6 +369,7 @@ skip)\n \trun_specific_rebase\n \t;;\n abort)\n+\ttest \"$type\" == \"cherrypick\" && git cherry-pick --abort\n \tgit rerere clear\n \tread_basic_state\n \tcase \"$head_name\" in\n-- \n1.8.3.698.g079b096\n"},{"id":"219994","messageId":"1370796057-25312-28-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 27/45] rebase: cherry-pick: fix command invocations","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:39Z","receivedAt":"2013-06-09T16:40:39Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"So that all the tests pass.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-rebase--cherrypick.sh | 17 ++++++++++++++++-\n 1 file changed, 16 insertions(+), 1 deletion(-)\n\ndiff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh\nindex d8d32fe..e9ecccc 100644\n--- a/git-rebase--cherrypick.sh\n+++ b/git-rebase--cherrypick.sh\n@@ -21,7 +21,22 @@ test -n \"$rebase_root\" && root_flag=--root\n mkdir -p \"$state_dir\" || die \"Could not create temporary $state_dir\"\n : > \"$state_dir\"/cherrypick || die \"Could not mark as cherrypick\"\n \n-git cherry-pick --allow-empty \"$revisions\"\n+if test -n \"$rebase_root\"\n+then\n+\trevisions=\"$onto...$orig_head\"\n+else\n+\trevisions=\"$upstream...$orig_head\"\n+fi\n+\n+if test -n \"$keep_empty\"\n+then\n+\textra=\"--allow-empty\"\n+else\n+\textra=\"--skip-empty --cherry-pick\"\n+fi\n+test -n \"$GIT_QUIET\" && extra=\"$extra -q\"\n+test -z \"$force_rebase\" && extra=\"$extra --ff\"\n+git cherry-pick --no-merges --right-only --topo-order --do-walk $extra \"$revisions\"\n ret=$?\n \n if test 0 != $ret\n-- \n1.8.3.698.g079b096\n"},{"id":"219993","messageId":"1370796057-25312-29-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 28/45] rebase: cherry-pick: fix status messages","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:40Z","receivedAt":"2013-06-09T16:40:40Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-rebase--cherrypick.sh | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh\nindex e9ecccc..be17ec4 100644\n--- a/git-rebase--cherrypick.sh\n+++ b/git-rebase--cherrypick.sh\n@@ -3,6 +3,9 @@\n # Copyright (c) 2010 Junio C Hamano.\n #\n \n+GIT_CHERRY_PICK_HELP=\"$resolvemsg\"\n+export GIT_CHERRY_PICK_HELP\n+\n case \"$action\" in\n continue)\n \tgit cherry-pick --continue &&\n-- \n1.8.3.698.g079b096\n"},{"id":"219997","messageId":"1370796057-25312-30-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 29/45] rebase: cherry-pick: automatically commit stage","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:41Z","receivedAt":"2013-06-09T16:40:41Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"When there's changes in the staging area. Just like the other rebase\nmodes.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-rebase--cherrypick.sh | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh\nindex be17ec4..241cda7 100644\n--- a/git-rebase--cherrypick.sh\n+++ b/git-rebase--cherrypick.sh\n@@ -8,6 +8,12 @@ export GIT_CHERRY_PICK_HELP\n \n case \"$action\" in\n continue)\n+\t# do we have anything to commit?\n+\tif ! git diff-index --cached --quiet HEAD --\n+\tthen\n+\t\tgit commit --no-verify -e ||\n+\t\t\tdie \"Could not commit staged changes.\"\n+\tfi\n \tgit cherry-pick --continue &&\n \tmove_to_original_branch\n \treturn\n-- \n1.8.3.698.g079b096\n"},{"id":"219998","messageId":"1370796057-25312-31-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 30/45] rebase: cherry-pick: set correct action-name","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:42Z","receivedAt":"2013-06-09T16:40:42Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-rebase--cherrypick.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh\nindex 241cda7..d36b0dc 100644\n--- a/git-rebase--cherrypick.sh\n+++ b/git-rebase--cherrypick.sh\n@@ -45,7 +45,7 @@ else\n fi\n test -n \"$GIT_QUIET\" && extra=\"$extra -q\"\n test -z \"$force_rebase\" && extra=\"$extra --ff\"\n-git cherry-pick --no-merges --right-only --topo-order --do-walk $extra \"$revisions\"\n+git cherry-pick --no-merges --right-only --topo-order --do-walk --action-name rebase $extra \"$revisions\"\n ret=$?\n \n if test 0 != $ret\n-- \n1.8.3.698.g079b096\n"},{"id":"220011","messageId":"1370796057-25312-32-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 31/45] rebase: trivial cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:43Z","receivedAt":"2013-06-09T16:40:43Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-rebase--am.sh | 1 +\n git-rebase.sh     | 1 -\n 2 files changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-rebase--am.sh b/git-rebase--am.sh\nindex 6460028..2ce7570 100644\n--- a/git-rebase--am.sh\n+++ b/git-rebase--am.sh\n@@ -51,6 +51,7 @@ then\n \treturn $?\n fi\n \n+test -n \"$GIT_QUIET\" && git_am_opt=\"$git_am_opt -q\"\n git am $git_am_opt --rebasing --resolvemsg=\"$resolvemsg\" <\"$GIT_DIR/rebased-patches\"\n ret=$?\n \ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 0937e2c..6be247d 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -285,7 +285,6 @@ do\n \t\t;;\n \t-q)\n \t\tGIT_QUIET=t\n-\t\tgit_am_opt=\"$git_am_opt -q\"\n \t\tverbose=\n \t\tdiffstat=\n \t\t;;\n-- \n1.8.3.698.g079b096\n"},{"id":"220014","messageId":"1370796057-25312-33-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 32/45] rebase: use 'cherrypick' mode instead of 'am'","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:44Z","receivedAt":"2013-06-09T16:40:44Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Unless any specific 'git am' options are used.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-prompt.sh       | 2 ++\n git-rebase.sh                          | 8 ++++----\n t/t3407-rebase-abort.sh                | 2 +-\n t/t3420-rebase-autostash.sh            | 2 +-\n t/t5520-pull.sh                        | 2 +-\n t/t9106-git-svn-commit-diff-clobber.sh | 2 +-\n 6 files changed, 10 insertions(+), 8 deletions(-)\n\ndiff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh\nindex 86a4f3f..3a14665 100644\n--- a/contrib/completion/git-prompt.sh\n+++ b/contrib/completion/git-prompt.sh\n@@ -352,6 +352,8 @@ __git_ps1 ()\n \t\t\ttotal=$(cat \"$g/rebase-merge/end\")\n \t\t\tif [ -f \"$g/rebase-merge/interactive\" ]; then\n \t\t\t\tr=\"|REBASE-i\"\n+\t\t\telif [ -f \"$g/rebase-merge/cherrypick\" ]; then\n+\t\t\t\tr=\"|REBASE\"\n \t\t\telse\n \t\t\t\tr=\"|REBASE-m\"\n \t\t\tfi\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex 6be247d..f2efff9 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -416,13 +416,13 @@ elif test -n \"$do_merge\"\n then\n \ttype=merge\n \tstate_dir=\"$merge_dir\"\n-elif test -n \"$keep_empty\"\n+elif test -n \"$git_am_opt\"\n then\n-\ttype=cherrypick\n-\tstate_dir=\"$merge_dir\"\n-else\n \ttype=am\n \tstate_dir=\"$apply_dir\"\n+else\n+\ttype=cherrypick\n+\tstate_dir=\"$merge_dir\"\n fi\n \n if test -z \"$rebase_root\"\ndiff --git a/t/t3407-rebase-abort.sh b/t/t3407-rebase-abort.sh\nindex a6a6c40..2699b08 100755\n--- a/t/t3407-rebase-abort.sh\n+++ b/t/t3407-rebase-abort.sh\n@@ -96,7 +96,7 @@ testrebase() {\n \t'\n }\n \n-testrebase \"\" .git/rebase-apply\n+testrebase \"\" .git/rebase-merge\n testrebase \" --merge\" .git/rebase-merge\n \n test_done\ndiff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh\nindex 479cbb2..a5e69f3 100755\n--- a/t/t3420-rebase-autostash.sh\n+++ b/t/t3420-rebase-autostash.sh\n@@ -141,7 +141,7 @@ testrebase() {\n \t'\n }\n \n-testrebase \"\" .git/rebase-apply\n+testrebase \"\" .git/rebase-merge\n testrebase \" --merge\" .git/rebase-merge\n testrebase \" --interactive\" .git/rebase-merge\n \ndiff --git a/t/t5520-pull.sh b/t/t5520-pull.sh\nindex 6af6c63..ec2373b 100755\n--- a/t/t5520-pull.sh\n+++ b/t/t5520-pull.sh\n@@ -244,7 +244,7 @@ test_expect_success 'setup for avoiding reapplying old patches' '\n test_expect_success 'git pull --rebase does not reapply old patches' '\n \t(cd dst &&\n \t test_must_fail git pull --rebase &&\n-\t test 1 = $(find .git/rebase-apply -name \"000*\" | wc -l)\n+\t test 1 = $(cat .git/sequencer/todo | wc -l)\n \t)\n '\n \ndiff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh\nindex f6d7ac7..b9cec33 100755\n--- a/t/t9106-git-svn-commit-diff-clobber.sh\n+++ b/t/t9106-git-svn-commit-diff-clobber.sh\n@@ -92,7 +92,7 @@ test_expect_success 'multiple dcommit from git svn will not clobber svn' \"\n \n \n test_expect_success 'check that rebase really failed' '\n-\ttest -d .git/rebase-apply\n+\ttest -d .git/rebase-merge\n '\n \n test_expect_success 'resolve, continue the rebase and dcommit' \"\n-- \n1.8.3.698.g079b096\n"},{"id":"220001","messageId":"1370796057-25312-34-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 33/45] rebase: cherry-pick: fix for shell prompt","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:45Z","receivedAt":"2013-06-09T16:40:45Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n contrib/completion/git-prompt.sh |  2 ++\n git-rebase--cherrypick.sh        | 11 +++++++++--\n 2 files changed, 11 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh\nindex 3a14665..3d10f21 100644\n--- a/contrib/completion/git-prompt.sh\n+++ b/contrib/completion/git-prompt.sh\n@@ -354,6 +354,8 @@ __git_ps1 ()\n \t\t\t\tr=\"|REBASE-i\"\n \t\t\telif [ -f \"$g/rebase-merge/cherrypick\" ]; then\n \t\t\t\tr=\"|REBASE\"\n+\t\t\t\tstep=$(cat \"$g/sequencer/rewritten\" | wc -l)\n+\t\t\t\tlet step+=1\n \t\t\telse\n \t\t\t\tr=\"|REBASE-m\"\n \t\t\tfi\ndiff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh\nindex d36b0dc..6f63618 100644\n--- a/git-rebase--cherrypick.sh\n+++ b/git-rebase--cherrypick.sh\n@@ -37,19 +37,26 @@ else\n \trevisions=\"$upstream...$orig_head\"\n fi\n \n+rev_args=\"--no-merges --right-only --topo-order --do-walk \"$revisions\"\"\n+\n if test -n \"$keep_empty\"\n then\n \textra=\"--allow-empty\"\n else\n-\textra=\"--skip-empty --cherry-pick\"\n+\textra=\"--skip-empty\"\n+\trev_args=\"--cherry-pick $rev_args\"\n fi\n test -n \"$GIT_QUIET\" && extra=\"$extra -q\"\n test -z \"$force_rebase\" && extra=\"$extra --ff\"\n-git cherry-pick --no-merges --right-only --topo-order --do-walk --action-name rebase $extra \"$revisions\"\n+\n+git rev-list $rev_args > \"$state_dir\"/list\n+git cherry-pick --action-name rebase $extra $rev_args\n ret=$?\n \n if test 0 != $ret\n then\n+\t# for shell prompt\n+\tcat \"$state_dir\"/list | wc -l > \"$state_dir\"/end\n \twrite_basic_state\n \treturn $ret\n fi\n-- \n1.8.3.698.g079b096\n"},{"id":"220000","messageId":"1370796057-25312-35-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 34/45] rebase: cherry-pick: add merge options","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:46Z","receivedAt":"2013-06-09T16:40:46Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-rebase--cherrypick.sh | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh\nindex 6f63618..644d45e 100644\n--- a/git-rebase--cherrypick.sh\n+++ b/git-rebase--cherrypick.sh\n@@ -48,6 +48,14 @@ else\n fi\n test -n \"$GIT_QUIET\" && extra=\"$extra -q\"\n test -z \"$force_rebase\" && extra=\"$extra --ff\"\n+test -n \"$strategy\" && extra=\"$extra --strategy=$strategy\"\n+for x in \"$strategy_opts\"\n+do\n+\ttest -z \"$x\" && continue\n+\tx=$(eval \"echo $x\")\n+\textra=\"$extra -X${x#--}\"\n+done\n+test -n \"$allow_rerere_autoupdate\" && extra=\"$extra $allow_rerere_autoupdate\"\n \n git rev-list $rev_args > \"$state_dir\"/list\n git cherry-pick --action-name rebase $extra $rev_args\n-- \n1.8.3.698.g079b096\n"},{"id":"220002","messageId":"1370796057-25312-36-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 35/45] rebase: remove merge mode","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:47Z","receivedAt":"2013-06-09T16:40:47Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"The cherrypick mode does the job.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n Makefile                         |   1 -\n contrib/completion/git-prompt.sh |   4 +-\n git-rebase--merge.sh             | 151 ---------------------------------------\n git-rebase.sh                    |  13 +---\n t/t3406-rebase-message.sh        |  15 ----\n t/t9903-bash-prompt.sh           |   2 +-\n 6 files changed, 3 insertions(+), 183 deletions(-)\n delete mode 100644 git-rebase--merge.sh\n\ndiff --git a/Makefile b/Makefile\nindex 4719979..609fa9e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -475,7 +475,6 @@ SCRIPT_LIB += git-parse-remote\n SCRIPT_LIB += git-rebase--am\n SCRIPT_LIB += git-rebase--cherrypick\n SCRIPT_LIB += git-rebase--interactive\n-SCRIPT_LIB += git-rebase--merge\n SCRIPT_LIB += git-sh-setup\n SCRIPT_LIB += git-sh-i18n\n \ndiff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh\nindex 3d10f21..5036795 100644\n--- a/contrib/completion/git-prompt.sh\n+++ b/contrib/completion/git-prompt.sh\n@@ -352,12 +352,10 @@ __git_ps1 ()\n \t\t\ttotal=$(cat \"$g/rebase-merge/end\")\n \t\t\tif [ -f \"$g/rebase-merge/interactive\" ]; then\n \t\t\t\tr=\"|REBASE-i\"\n-\t\t\telif [ -f \"$g/rebase-merge/cherrypick\" ]; then\n+\t\t\telse\n \t\t\t\tr=\"|REBASE\"\n \t\t\t\tstep=$(cat \"$g/sequencer/rewritten\" | wc -l)\n \t\t\t\tlet step+=1\n-\t\t\telse\n-\t\t\t\tr=\"|REBASE-m\"\n \t\t\tfi\n \t\telse\n \t\t\tif [ -d \"$g/rebase-apply\" ]; then\ndiff --git a/git-rebase--merge.sh b/git-rebase--merge.sh\ndeleted file mode 100644\nindex 16d1817..0000000\n--- a/git-rebase--merge.sh\n+++ /dev/null\n@@ -1,151 +0,0 @@\n-#!/bin/sh\n-#\n-# Copyright (c) 2010 Junio C Hamano.\n-#\n-\n-prec=4\n-\n-read_state () {\n-\tonto_name=$(cat \"$state_dir\"/onto_name) &&\n-\tend=$(cat \"$state_dir\"/end) &&\n-\tmsgnum=$(cat \"$state_dir\"/msgnum)\n-}\n-\n-continue_merge () {\n-\ttest -d \"$state_dir\" || die \"$state_dir directory does not exist\"\n-\n-\tunmerged=$(git ls-files -u)\n-\tif test -n \"$unmerged\"\n-\tthen\n-\t\techo \"You still have unmerged paths in your index\"\n-\t\techo \"did you forget to use git add?\"\n-\t\tdie \"$resolvemsg\"\n-\tfi\n-\n-\tcmt=`cat \"$state_dir/current\"`\n-\tif ! git diff-index --quiet --ignore-submodules HEAD --\n-\tthen\n-\t\tif ! git commit --no-verify -C \"$cmt\"\n-\t\tthen\n-\t\t\techo \"Commit failed, please do not call \\\"git commit\\\"\"\n-\t\t\techo \"directly, but instead do one of the following: \"\n-\t\t\tdie \"$resolvemsg\"\n-\t\tfi\n-\t\tif test -z \"$GIT_QUIET\"\n-\t\tthen\n-\t\t\tprintf \"Committed: %0${prec}d \" $msgnum\n-\t\tfi\n-\t\techo \"$cmt $(git rev-parse HEAD^0)\" >> \"$state_dir/rewritten\"\n-\telse\n-\t\tif test -z \"$GIT_QUIET\"\n-\t\tthen\n-\t\t\tprintf \"Already applied: %0${prec}d \" $msgnum\n-\t\tfi\n-\tfi\n-\ttest -z \"$GIT_QUIET\" &&\n-\tGIT_PAGER='' git log --format=%s -1 \"$cmt\"\n-\n-\t# onto the next patch:\n-\tmsgnum=$(($msgnum + 1))\n-\techo \"$msgnum\" >\"$state_dir/msgnum\"\n-}\n-\n-call_merge () {\n-\tcmt=\"$(cat \"$state_dir/cmt.$1\")\"\n-\techo \"$cmt\" > \"$state_dir/current\"\n-\thd=$(git rev-parse --verify HEAD)\n-\tcmt_name=$(git symbolic-ref HEAD 2> /dev/null || echo HEAD)\n-\tmsgnum=$(cat \"$state_dir/msgnum\")\n-\teval GITHEAD_$cmt='\"${cmt_name##refs/heads/}~$(($end - $msgnum))\"'\n-\teval GITHEAD_$hd='$onto_name'\n-\texport GITHEAD_$cmt GITHEAD_$hd\n-\tif test -n \"$GIT_QUIET\"\n-\tthen\n-\t\tGIT_MERGE_VERBOSITY=1 && export GIT_MERGE_VERBOSITY\n-\tfi\n-\ttest -z \"$strategy\" && strategy=recursive\n-\teval 'git-merge-$strategy' $strategy_opts '\"$cmt^\" -- \"$hd\" \"$cmt\"'\n-\trv=$?\n-\tcase \"$rv\" in\n-\t0)\n-\t\tunset GITHEAD_$cmt GITHEAD_$hd\n-\t\treturn\n-\t\t;;\n-\t1)\n-\t\tgit rerere $allow_rerere_autoupdate\n-\t\tdie \"$resolvemsg\"\n-\t\t;;\n-\t2)\n-\t\techo \"Strategy: $strategy failed, try another\" 1>&2\n-\t\tdie \"$resolvemsg\"\n-\t\t;;\n-\t*)\n-\t\tdie \"Unknown exit code ($rv) from command:\" \\\n-\t\t\t\"git-merge-$strategy $cmt^ -- HEAD $cmt\"\n-\t\t;;\n-\tesac\n-}\n-\n-finish_rb_merge () {\n-\tmove_to_original_branch\n-\tif test -s \"$state_dir\"/rewritten\n-\tthen\n-\t\tgit notes copy --for-rewrite=rebase <\"$state_dir\"/rewritten\n-\t\tif test -x \"$GIT_DIR\"/hooks/post-rewrite\n-\t\tthen\n-\t\t\t\"$GIT_DIR\"/hooks/post-rewrite rebase <\"$state_dir\"/rewritten\n-\t\tfi\n-\tfi\n-\tsay All done.\n-}\n-\n-case \"$action\" in\n-continue)\n-\tread_state\n-\tcontinue_merge\n-\twhile test \"$msgnum\" -le \"$end\"\n-\tdo\n-\t\tcall_merge \"$msgnum\"\n-\t\tcontinue_merge\n-\tdone\n-\tfinish_rb_merge\n-\treturn\n-\t;;\n-skip)\n-\tread_state\n-\tgit rerere clear\n-\tmsgnum=$(($msgnum + 1))\n-\twhile test \"$msgnum\" -le \"$end\"\n-\tdo\n-\t\tcall_merge \"$msgnum\"\n-\t\tcontinue_merge\n-\tdone\n-\tfinish_rb_merge\n-\treturn\n-\t;;\n-esac\n-\n-mkdir -p \"$state_dir\"\n-echo \"$onto_name\" > \"$state_dir/onto_name\"\n-write_basic_state\n-\n-msgnum=0\n-for cmt in `git rev-list --reverse --no-merges \"$revisions\"`\n-do\n-\tmsgnum=$(($msgnum + 1))\n-\techo \"$cmt\" > \"$state_dir/cmt.$msgnum\"\n-done\n-\n-echo 1 >\"$state_dir/msgnum\"\n-echo $msgnum >\"$state_dir/end\"\n-\n-end=$msgnum\n-msgnum=1\n-\n-while test \"$msgnum\" -le \"$end\"\n-do\n-\tcall_merge \"$msgnum\"\n-\tcontinue_merge\n-done\n-\n-finish_rb_merge\ndiff --git a/git-rebase.sh b/git-rebase.sh\nindex f2efff9..8ddf270 100755\n--- a/git-rebase.sh\n+++ b/git-rebase.sh\n@@ -59,7 +59,6 @@ unset onto\n cmd=\n strategy=\n strategy_opts=\n-do_merge=\n merge_dir=\"$GIT_DIR\"/rebase-merge\n apply_dir=\"$GIT_DIR\"/rebase-apply\n verbose=\n@@ -205,11 +204,8 @@ then\n \tthen\n \t\ttype=interactive\n \t\tinteractive_rebase=explicit\n-\telif test -f \"$merge_dir\"/cherrypick\n-\tthen\n-\t\ttype=cherrypick\n \telse\n-\t\ttype=merge\n+\t\ttype=cherrypick\n \tfi\n \tstate_dir=\"$merge_dir\"\n fi\n@@ -256,18 +252,15 @@ do\n \t\tautosquash=\n \t\t;;\n \t-M|-m)\n-\t\tdo_merge=t\n \t\t;;\n \t-X)\n \t\tshift\n \t\tstrategy_opts=\"$strategy_opts $(git rev-parse --sq-quote \"--$1\")\"\n-\t\tdo_merge=t\n \t\ttest -z \"$strategy\" && strategy=recursive\n \t\t;;\n \t-s)\n \t\tshift\n \t\tstrategy=\"$1\"\n-\t\tdo_merge=t\n \t\t;;\n \t-n)\n \t\tdiffstat=\n@@ -412,10 +405,6 @@ if test -n \"$interactive_rebase\"\n then\n \ttype=interactive\n \tstate_dir=\"$merge_dir\"\n-elif test -n \"$do_merge\"\n-then\n-\ttype=merge\n-\tstate_dir=\"$merge_dir\"\n elif test -n \"$git_am_opt\"\n then\n \ttype=am\ndiff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh\nindex e6a9a0d..37d19c5 100755\n--- a/t/t3406-rebase-message.sh\n+++ b/t/t3406-rebase-message.sh\n@@ -27,21 +27,6 @@ test_expect_success setup '\n \n '\n \n-cat >expect <<\\EOF\n-Already applied: 0001 A\n-Already applied: 0002 B\n-Committed: 0003 Z\n-EOF\n-\n-test_expect_success 'rebase -m' '\n-\n-\tgit rebase -m master >report &&\n-\tsed -n -e \"/^Already applied: /p\" \\\n-\t\t-e \"/^Committed: /p\" report >actual &&\n-\ttest_cmp expect actual\n-\n-'\n-\n test_expect_success 'rebase --stat' '\n \tgit reset --hard start &&\n         git rebase --stat master >diffstat.txt &&\ndiff --git a/t/t9903-bash-prompt.sh b/t/t9903-bash-prompt.sh\nindex 15521cc..2e46f93 100755\n--- a/t/t9903-bash-prompt.sh\n+++ b/t/t9903-bash-prompt.sh\n@@ -266,7 +266,7 @@ EOF\n '\n \n test_expect_success 'prompt - rebase merge' '\n-\tprintf \" (b2|REBASE-m 1/3)\" > expected &&\n+\tprintf \" (b2|REBASE 1/3)\" > expected &&\n \tgit checkout b2 &&\n \ttest_when_finished \"git checkout master\" &&\n \ttest_must_fail git rebase --merge b1 b2 &&\n-- \n1.8.3.698.g079b096\n"},{"id":"220004","messageId":"1370796057-25312-37-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 36/45] rebase: cherry-pick: add copyright","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:48Z","receivedAt":"2013-06-09T16:40:48Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Probably enough changes to warrant that.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n git-rebase--cherrypick.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-rebase--cherrypick.sh b/git-rebase--cherrypick.sh\nindex 644d45e..e36e104 100644\n--- a/git-rebase--cherrypick.sh\n+++ b/git-rebase--cherrypick.sh\n@@ -1,6 +1,6 @@\n #!/bin/sh\n #\n-# Copyright (c) 2010 Junio C Hamano.\n+# Copyright (c) 2013 Felipe Contreras\n #\n \n GIT_CHERRY_PICK_HELP=\"$resolvemsg\"\n-- \n1.8.3.698.g079b096\n"},{"id":"220005","messageId":"1370796057-25312-38-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 37/45] tests: fix autostash","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:49Z","receivedAt":"2013-06-09T16:40:49Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"We should call 'git rebase --abort', like a normal user would do.\n\nSigned-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n t/t3420-rebase-autostash.sh | 3 +--\n 1 file changed, 1 insertion(+), 2 deletions(-)\n\ndiff --git a/t/t3420-rebase-autostash.sh b/t/t3420-rebase-autostash.sh\nindex a5e69f3..ff370a3 100755\n--- a/t/t3420-rebase-autostash.sh\n+++ b/t/t3420-rebase-autostash.sh\n@@ -71,8 +71,7 @@ testrebase() {\n \t\ttest_must_fail git rebase$type related-onto-branch &&\n \t\ttest_path_is_file $dotest/autostash &&\n \t\t! grep dirty file3 &&\n-\t\trm -rf $dotest &&\n-\t\tgit reset --hard &&\n+\t\tgit rebase --abort &&\n \t\tgit checkout feature-branch\n \t'\n \n-- \n1.8.3.698.g079b096\n"},{"id":"220003","messageId":"1370796057-25312-39-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 38/45] add simple tests of consistency across rebase types","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:50Z","receivedAt":"2013-06-09T16:40:50Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Martin von Zweigbergk <martinvonz@gmail.com>\n\nHelped-by: Johannes Sixt <j6t@kdbg.org>\nSigned-off-by: Martin von Zweigbergk <martinvonz@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/lib-rebase.sh                   | 16 ++++++++\n t/t3421-rebase-topology-linear.sh | 78 +++++++++++++++++++++++++++++++++++++++\n 2 files changed, 94 insertions(+)\n create mode 100755 t/t3421-rebase-topology-linear.sh\n\ndiff --git a/t/lib-rebase.sh b/t/lib-rebase.sh\nindex 6ccf797..1e0ff28 100644\n--- a/t/lib-rebase.sh\n+++ b/t/lib-rebase.sh\n@@ -65,3 +65,19 @@ EOF\n \ttest_set_editor \"$(pwd)/fake-editor.sh\"\n \tchmod a+x fake-editor.sh\n }\n+\n+# checks that the revisions in \"$2\" represent a linear range with the\n+# subjects in \"$1\"\n+test_linear_range () {\n+\trevlist_merges=$(git rev-list --merges \"$2\") &&\n+\ttest -z \"$revlist_merges\" &&\n+\texpected=$1\n+\tset -- $(git log --reverse --format=%s \"$2\")\n+\ttest \"$expected\" = \"$*\"\n+}\n+\n+reset_rebase () {\n+\ttest_might_fail git rebase --abort &&\n+\tgit reset --hard &&\n+\tgit clean -f\n+}\ndiff --git a/t/t3421-rebase-topology-linear.sh b/t/t3421-rebase-topology-linear.sh\nnew file mode 100755\nindex 0000000..60365d1\n--- /dev/null\n+++ b/t/t3421-rebase-topology-linear.sh\n@@ -0,0 +1,78 @@\n+#!/bin/sh\n+\n+test_description='basic rebase topology tests'\n+. ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-rebase.sh\n+\n+# a---b---c\n+#      \\\n+#       d---e\n+test_expect_success 'setup' '\n+\ttest_commit a &&\n+\ttest_commit b &&\n+\ttest_commit c &&\n+\tgit checkout b &&\n+\ttest_commit d &&\n+\ttest_commit e\n+'\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"simple rebase $*\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* c e &&\n+\t\ttest_cmp_rev c HEAD~2 &&\n+\t\ttest_linear_range 'd e' c..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase success -m\n+test_run_rebase success -i\n+test_run_rebase success -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* is no-op if upstream is an ancestor\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* b e &&\n+\t\ttest_cmp_rev e HEAD\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase success -m\n+test_run_rebase success -i\n+test_run_rebase success -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* -f rewrites even if upstream is an ancestor\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* -f b e &&\n+\t\t! test_cmp_rev e HEAD &&\n+\t\ttest_cmp_rev b HEAD~2 &&\n+\t\ttest_linear_range 'd e' b..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase success -m\n+test_run_rebase success -i\n+test_run_rebase failure -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* fast-forwards from ancestor of upstream\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* e b &&\n+\t\ttest_cmp_rev e HEAD\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase success -m\n+test_run_rebase success -i\n+test_run_rebase success -p\n+\n+test_done\n-- \n1.8.3.698.g079b096\n"},{"id":"220007","messageId":"1370796057-25312-40-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 39/45] add tests for rebasing with patch-equivalence present","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:51Z","receivedAt":"2013-06-09T16:40:51Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Martin von Zweigbergk <martinvonz@gmail.com>\n\nSigned-off-by: Martin von Zweigbergk <martinvonz@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/lib-rebase.sh                   | 17 ++++++++\n t/t3421-rebase-topology-linear.sh | 85 +++++++++++++++++++++++++++++++++++++++\n 2 files changed, 102 insertions(+)\n\ndiff --git a/t/lib-rebase.sh b/t/lib-rebase.sh\nindex 1e0ff28..4b74ae4 100644\n--- a/t/lib-rebase.sh\n+++ b/t/lib-rebase.sh\n@@ -81,3 +81,20 @@ reset_rebase () {\n \tgit reset --hard &&\n \tgit clean -f\n }\n+\n+cherry_pick () {\n+\tgit cherry-pick -n \"$2\" &&\n+\tgit commit -m \"$1\" &&\n+\tgit tag \"$1\"\n+}\n+\n+revert () {\n+\tgit revert -n \"$2\" &&\n+\tgit commit -m \"$1\" &&\n+\tgit tag \"$1\"\n+}\n+\n+make_empty () {\n+\tgit commit --allow-empty -m \"$1\" &&\n+\tgit tag \"$1\"\n+}\ndiff --git a/t/t3421-rebase-topology-linear.sh b/t/t3421-rebase-topology-linear.sh\nindex 60365d1..ddcbfc6 100755\n--- a/t/t3421-rebase-topology-linear.sh\n+++ b/t/t3421-rebase-topology-linear.sh\n@@ -75,4 +75,89 @@ test_run_rebase success -m\n test_run_rebase success -i\n test_run_rebase success -p\n \n+#       f\n+#      /\n+# a---b---c---g---h\n+#      \\\n+#       d---G---i\n+#\n+# uppercase = cherry-picked\n+# h = reverted g\n+#\n+# Reverted patches are there for tests to be able to check if a commit\n+# that introduced the same change as another commit is\n+# dropped. Without reverted commits, we could get false positives\n+# because applying the patch succeeds, but simply results in no\n+# changes.\n+test_expect_success 'setup of linear history for range selection tests' '\n+\tgit checkout c &&\n+\ttest_commit g &&\n+\trevert h g &&\n+\tgit checkout d &&\n+\tcherry_pick G g &&\n+\ttest_commit i &&\n+\tgit checkout b &&\n+\ttest_commit f\n+'\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* drops patches in upstream\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* h i &&\n+\t\ttest_cmp_rev h HEAD~2 &&\n+\t\ttest_linear_range 'd i' h..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase failure -m\n+test_run_rebase success -i\n+test_run_rebase success -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* can drop last patch if in upstream\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* h G &&\n+\t\ttest_cmp_rev h HEAD^ &&\n+\t\ttest_linear_range 'd' h..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase failure -m\n+test_run_rebase success -i\n+test_run_rebase success -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* --onto drops patches in upstream\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* --onto f h i &&\n+\t\ttest_cmp_rev f HEAD~2 &&\n+\t\ttest_linear_range 'd i' f..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase failure -m\n+test_run_rebase success -i\n+test_run_rebase success -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* --onto does not drop patches in onto\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* --onto h f i &&\n+\t\ttest_cmp_rev h HEAD~3 &&\n+\t\ttest_linear_range 'd G i' h..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase success -m\n+test_run_rebase success -i\n+test_run_rebase success -p\n+\n test_done\n-- \n1.8.3.698.g079b096\n"},{"id":"220006","messageId":"1370796057-25312-41-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 40/45] add tests for rebasing of empty commits","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:52Z","receivedAt":"2013-06-09T16:40:52Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Martin von Zweigbergk <martinvonz@gmail.com>\n\nSigned-off-by: Martin von Zweigbergk <martinvonz@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t3401-rebase-partial.sh         | 24 ----------------\n t/t3421-rebase-topology-linear.sh | 58 +++++++++++++++++++++++++++++++++++++++\n 2 files changed, 58 insertions(+), 24 deletions(-)\n\ndiff --git a/t/t3401-rebase-partial.sh b/t/t3401-rebase-partial.sh\nindex 58f4823..7ba1797 100755\n--- a/t/t3401-rebase-partial.sh\n+++ b/t/t3401-rebase-partial.sh\n@@ -42,28 +42,4 @@ test_expect_success 'rebase --merge topic branch that was partially merged upstr\n \ttest_path_is_missing .git/rebase-merge\n '\n \n-test_expect_success 'rebase ignores empty commit' '\n-\tgit reset --hard A &&\n-\tgit commit --allow-empty -m empty &&\n-\ttest_commit D &&\n-\tgit rebase C &&\n-\ttest \"$(git log --format=%s C..)\" = \"D\"\n-'\n-\n-test_expect_success 'rebase --keep-empty' '\n-\tgit reset --hard D &&\n-\tgit rebase --keep-empty C &&\n-\ttest \"$(git log --format=%s C..)\" = \"D\n-empty\"\n-'\n-\n-test_expect_success 'rebase --keep-empty keeps empty even if already in upstream' '\n-\tgit reset --hard A &&\n-\tgit commit --allow-empty -m also-empty &&\n-\tgit rebase --keep-empty D &&\n-\ttest \"$(git log --format=%s A..)\" = \"also-empty\n-D\n-empty\"\n-'\n-\n test_done\ndiff --git a/t/t3421-rebase-topology-linear.sh b/t/t3421-rebase-topology-linear.sh\nindex ddcbfc6..f19f0d0 100755\n--- a/t/t3421-rebase-topology-linear.sh\n+++ b/t/t3421-rebase-topology-linear.sh\n@@ -160,4 +160,62 @@ test_run_rebase success -m\n test_run_rebase success -i\n test_run_rebase success -p\n \n+# a---b---c---j!\n+#      \\\n+#       d---k!--l\n+#\n+# ! = empty\n+test_expect_success 'setup of linear history for empty commit tests' '\n+\tgit checkout c &&\n+\tmake_empty j &&\n+\tgit checkout d &&\n+\tmake_empty k &&\n+\ttest_commit l\n+'\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* drops empty commit\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* c l &&\n+\t\ttest_cmp_rev c HEAD~2 &&\n+\t\ttest_linear_range 'd l' c..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase success -m\n+test_run_rebase success -i\n+test_run_rebase success -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* --keep-empty\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* --keep-empty c l &&\n+\t\ttest_cmp_rev c HEAD~3 &&\n+\t\ttest_linear_range 'd k l' c..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase failure -m\n+test_run_rebase success -i\n+test_run_rebase failure -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* --keep-empty keeps empty even if already in upstream\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* --keep-empty j l &&\n+\t\ttest_cmp_rev j HEAD~3 &&\n+\t\ttest_linear_range 'd k l' j..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase failure -m\n+test_run_rebase failure -i\n+test_run_rebase failure -p\n+\n test_done\n-- \n1.8.3.698.g079b096\n"},{"id":"220008","messageId":"1370796057-25312-42-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 41/45] add tests for rebasing root","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:53Z","receivedAt":"2013-06-09T16:40:53Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Martin von Zweigbergk <martinvonz@gmail.com>\n\nSigned-off-by: Martin von Zweigbergk <martinvonz@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t3421-rebase-topology-linear.sh | 129 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 129 insertions(+)\n\ndiff --git a/t/t3421-rebase-topology-linear.sh b/t/t3421-rebase-topology-linear.sh\nindex f19f0d0..e67add6 100755\n--- a/t/t3421-rebase-topology-linear.sh\n+++ b/t/t3421-rebase-topology-linear.sh\n@@ -218,4 +218,133 @@ test_run_rebase failure -m\n test_run_rebase failure -i\n test_run_rebase failure -p\n \n+#       m\n+#      /\n+# a---b---c---g\n+#\n+# x---y---B\n+#\n+# uppercase = cherry-picked\n+# m = reverted b\n+#\n+# Reverted patches are there for tests to be able to check if a commit\n+# that introduced the same change as another commit is\n+# dropped. Without reverted commits, we could get false positives\n+# because applying the patch succeeds, but simply results in no\n+# changes.\n+test_expect_success 'setup of linear history for test involving root' '\n+\tgit checkout b &&\n+\trevert m b &&\n+\tgit checkout --orphan disjoint &&\n+\tgit rm -rf . &&\n+\ttest_commit x &&\n+\ttest_commit y &&\n+\tcherry_pick B b\n+'\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* --onto --root\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* --onto c --root y &&\n+\t\ttest_cmp_rev c HEAD~2 &&\n+\t\ttest_linear_range 'x y' c..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase failure -m\n+test_run_rebase success -i\n+test_run_rebase success -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* without --onto --root with disjoint history\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* c y &&\n+\t\ttest_cmp_rev c HEAD~2 &&\n+\t\ttest_linear_range 'x y' c..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase failure -m\n+test_run_rebase success -i\n+test_run_rebase failure -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* --onto --root drops patch in onto\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* --onto m --root B &&\n+\t\ttest_cmp_rev m HEAD~2 &&\n+\t\ttest_linear_range 'x y' m..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase failure -m\n+test_run_rebase success -i\n+test_run_rebase success -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* --onto --root with merge-base does not go to root\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* --onto m --root g &&\n+\t\ttest_cmp_rev m HEAD~2 &&\n+\t\ttest_linear_range 'c g' m..\n+\t\"\n+}\n+\n+test_run_rebase success ''\n+test_run_rebase success -m\n+test_run_rebase success -i\n+test_run_rebase failure -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* without --onto --root with disjoint history drops patch in onto\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* m B &&\n+\t\ttest_cmp_rev m HEAD~2 &&\n+\t\ttest_linear_range 'x y' m..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase failure -m\n+test_run_rebase success -i\n+test_run_rebase failure -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* --root on linear history is a no-op\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* --root c &&\n+\t\ttest_cmp_rev c HEAD\n+\t\"\n+}\n+test_run_rebase failure ''\n+test_run_rebase failure -m\n+test_run_rebase failure -i\n+test_run_rebase failure -p\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* -f --root on linear history causes re-write\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* -f --root c &&\n+\t\t! test_cmp_rev a HEAD~2 &&\n+\t\ttest_linear_range 'a b c' HEAD\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase success -m\n+test_run_rebase success -i\n+test_run_rebase success -p\n+\n test_done\n-- \n1.8.3.698.g079b096\n"},{"id":"220010","messageId":"1370796057-25312-43-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 42/45] add tests for rebasing merged history","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:54Z","receivedAt":"2013-06-09T16:40:54Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Martin von Zweigbergk <martinvonz@gmail.com>\n\nSigned-off-by: Martin von Zweigbergk <martinvonz@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t3400-rebase.sh                 |  31 +----\n t/t3401-rebase-partial.sh         |  45 -------\n t/t3404-rebase-interactive.sh     |  10 +-\n t/t3409-rebase-preserve-merges.sh |  53 --------\n t/t3425-rebase-topology-merges.sh | 258 ++++++++++++++++++++++++++++++++++++++\n 5 files changed, 260 insertions(+), 137 deletions(-)\n delete mode 100755 t/t3401-rebase-partial.sh\n create mode 100755 t/t3425-rebase-topology-merges.sh\n\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex b58fa1a..b436ef4 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -40,13 +40,6 @@ test_expect_success 'prepare repository with topic branches' '\n \techo Side >>C &&\n \tgit add C &&\n \tgit commit -m \"Add C\" &&\n-\tgit checkout -b nonlinear my-topic-branch &&\n-\techo Edit >>B &&\n-\tgit add B &&\n-\tgit commit -m \"Modify B\" &&\n-\tgit merge side &&\n-\tgit checkout -b upstream-merged-nonlinear &&\n-\tgit merge master &&\n \tgit checkout -f my-topic-branch &&\n \tgit tag topic\n '\n@@ -106,31 +99,9 @@ test_expect_success 'rebase from ambiguous branch name' '\n \tgit rebase master\n '\n \n-test_expect_success 'rebase after merge master' '\n-\tgit checkout --detach refs/tags/topic &&\n-\tgit branch -D topic &&\n-\tgit reset --hard topic &&\n-\tgit merge master &&\n-\tgit rebase master &&\n-\t! (git show | grep \"^Merge:\")\n-'\n-\n-test_expect_success 'rebase of history with merges is linearized' '\n-\tgit checkout nonlinear &&\n-\ttest 4 = $(git rev-list master.. | wc -l) &&\n-\tgit rebase master &&\n-\ttest 3 = $(git rev-list master.. | wc -l)\n-'\n-\n-test_expect_success 'rebase of history with merges after upstream merge is linearized' '\n-\tgit checkout upstream-merged-nonlinear &&\n-\ttest 5 = $(git rev-list master.. | wc -l) &&\n-\tgit rebase master &&\n-\ttest 3 = $(git rev-list master.. | wc -l)\n-'\n-\n test_expect_success 'rebase a single mode change' '\n \tgit checkout master &&\n+\tgit branch -D topic &&\n \techo 1 >X &&\n \tgit add X &&\n \ttest_tick &&\ndiff --git a/t/t3401-rebase-partial.sh b/t/t3401-rebase-partial.sh\ndeleted file mode 100755\nindex 7ba1797..0000000\n--- a/t/t3401-rebase-partial.sh\n+++ /dev/null\n@@ -1,45 +0,0 @@\n-#!/bin/sh\n-#\n-# Copyright (c) 2006 Yann Dirson, based on t3400 by Amos Waterland\n-#\n-\n-test_description='git rebase should detect patches integrated upstream\n-\n-This test cherry-picks one local change of two into master branch, and\n-checks that git rebase succeeds with only the second patch in the\n-local branch.\n-'\n-. ./test-lib.sh\n-\n-test_expect_success 'prepare repository with topic branch' '\n-\ttest_commit A &&\n-\tgit checkout -b my-topic-branch &&\n-\ttest_commit B &&\n-\ttest_commit C &&\n-\tgit checkout -f master &&\n-\ttest_commit A2 A.t\n-'\n-\n-test_expect_success 'pick top patch from topic branch into master' '\n-\tgit cherry-pick C &&\n-\tgit checkout -f my-topic-branch\n-'\n-\n-test_debug '\n-\tgit cherry master &&\n-\tgit format-patch -k --stdout --full-index master >/dev/null &&\n-\tgitk --all & sleep 1\n-'\n-\n-test_expect_success 'rebase topic branch against new master and check git am did not get halted' '\n-\tgit rebase master &&\n-\ttest_path_is_missing .git/rebase-apply\n-'\n-\n-test_expect_success 'rebase --merge topic branch that was partially merged upstream' '\n-\tgit reset --hard C &&\n-\tgit rebase --merge master &&\n-\ttest_path_is_missing .git/rebase-merge\n-'\n-\n-test_done\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 79e8d3c..0d3c573 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -477,19 +477,11 @@ test_expect_success 'interrupted squash works as expected (case 2)' '\n \ttest $one = $(git rev-parse HEAD~2)\n '\n \n-test_expect_success 'ignore patch if in upstream' '\n-\tHEAD=$(git rev-parse HEAD) &&\n-\tgit checkout -b has-cherry-picked HEAD^ &&\n+test_expect_success '--continue tries to commit, even for \"edit\"' '\n \techo unrelated > file7 &&\n \tgit add file7 &&\n \ttest_tick &&\n \tgit commit -m \"unrelated change\" &&\n-\tgit cherry-pick $HEAD &&\n-\tEXPECT_COUNT=1 git rebase -i $HEAD &&\n-\ttest $HEAD = $(git rev-parse HEAD^)\n-'\n-\n-test_expect_success '--continue tries to commit, even for \"edit\"' '\n \tparent=$(git rev-parse HEAD^) &&\n \ttest_tick &&\n \tFAKE_LINES=\"edit 1\" git rebase -i HEAD^ &&\ndiff --git a/t/t3409-rebase-preserve-merges.sh b/t/t3409-rebase-preserve-merges.sh\nindex 6de4e22..2e0c364 100755\n--- a/t/t3409-rebase-preserve-merges.sh\n+++ b/t/t3409-rebase-preserve-merges.sh\n@@ -11,14 +11,6 @@ Run \"git rebase -p\" and check that merges are properly carried along\n GIT_AUTHOR_EMAIL=bogus_email_address\n export GIT_AUTHOR_EMAIL\n \n-# Clone 1 (trivial merge):\n-#\n-# A1--A2  <-- origin/master\n-#  \\   \\\n-#   B1--M  <-- topic\n-#    \\\n-#     B2  <-- origin/topic\n-#\n # Clone 2 (conflicting merge):\n #\n # A1--A2--B3   <-- origin/master\n@@ -36,16 +28,6 @@ export GIT_AUTHOR_EMAIL\n #     \\--A3    <-- topic2\n #      \\\n #       B2     <-- origin/topic\n-#\n-# Clone 4 (merge using second parent as base):\n-#\n-# A1--A2--B3   <-- origin/master\n-#  \\\n-#   B1--A3--M  <-- topic\n-#    \\     /\n-#     \\--A4    <-- topic2\n-#      \\\n-#       B2     <-- origin/topic\n \n test_expect_success 'setup for merge-preserving rebase' \\\n \t'echo First > A &&\n@@ -58,20 +40,6 @@ test_expect_success 'setup for merge-preserving rebase' \\\n \tgit checkout -f master &&\n \techo Third >> A &&\n \tgit commit -a -m \"Modify A2\" &&\n-\n-\tgit clone ./. clone1 &&\n-\t(cd clone1 &&\n-\tgit checkout -b topic origin/topic &&\n-\tgit merge origin/master\n-\t) &&\n-\n-\tgit clone ./. clone4 &&\n-\t(\n-\t\tcd clone4 &&\n-\t\tgit checkout -b topic origin/topic &&\n-\t\tgit merge origin/master\n-\t) &&\n-\n \techo Fifth > B &&\n \tgit add B &&\n \tgit commit -m \"Add different B\" &&\n@@ -101,16 +69,6 @@ test_expect_success 'setup for merge-preserving rebase' \\\n \tgit commit -a -m \"Modify B2\"\n '\n \n-test_expect_success 'rebase -p fakes interactive rebase' '\n-\t(\n-\tcd clone1 &&\n-\tgit fetch &&\n-\tgit rebase -p origin/topic &&\n-\ttest 1 = $(git rev-list --all --pretty=oneline | grep \"Modify A\" | wc -l) &&\n-\ttest 1 = $(git rev-list --all --pretty=oneline | grep \"Merge remote-tracking branch \" | wc -l)\n-\t)\n-'\n-\n test_expect_success '--continue works after a conflict' '\n \t(\n \tcd clone2 &&\n@@ -138,15 +96,4 @@ test_expect_success 'rebase -p preserves no-ff merges' '\n \t)\n '\n \n-test_expect_success 'rebase -p works when base inside second parent' '\n-\t(\n-\tcd clone4 &&\n-\tgit fetch &&\n-\tgit rebase -p HEAD^2 &&\n-\ttest 1 = $(git rev-list --all --pretty=oneline | grep \"Modify A\" | wc -l) &&\n-\ttest 1 = $(git rev-list --all --pretty=oneline | grep \"Modify B\" | wc -l) &&\n-\ttest 1 = $(git rev-list --all --pretty=oneline | grep \"Merge remote-tracking branch \" | wc -l)\n-\t)\n-'\n-\n test_done\ndiff --git a/t/t3425-rebase-topology-merges.sh b/t/t3425-rebase-topology-merges.sh\nnew file mode 100755\nindex 0000000..5400a05\n--- /dev/null\n+++ b/t/t3425-rebase-topology-merges.sh\n@@ -0,0 +1,258 @@\n+#!/bin/sh\n+\n+test_description='rebase topology tests with merges'\n+. ./test-lib.sh\n+. \"$TEST_DIRECTORY\"/lib-rebase.sh\n+\n+test_revision_subjects () {\n+\texpected=\"$1\"\n+\tshift\n+\tset -- $(git log --format=%s --no-walk=unsorted \"$@\")\n+\ttest \"$expected\" = \"$*\"\n+}\n+\n+# a---b-----------c\n+#      \\           \\\n+#       d-------e   \\\n+#        \\       \\   \\\n+#         n---o---w---v\n+#              \\\n+#               z\n+test_expect_success 'setup of non-linear-history' '\n+\ttest_commit a &&\n+\ttest_commit b &&\n+\ttest_commit c &&\n+\tgit checkout b &&\n+\ttest_commit d &&\n+\ttest_commit e\n+\n+\tgit checkout c &&\n+\ttest_commit g &&\n+\trevert h g &&\n+\tgit checkout d &&\n+\tcherry_pick G g &&\n+\ttest_commit i &&\n+\tgit checkout b &&\n+\ttest_commit f\n+\n+\tgit checkout d &&\n+\ttest_commit n &&\n+\ttest_commit o &&\n+\ttest_merge w e &&\n+\ttest_merge v c &&\n+\tgit checkout o &&\n+\ttest_commit z\n+'\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* after merge from upstream\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* e w &&\n+\t\ttest_cmp_rev e HEAD~2 &&\n+\t\ttest_linear_range 'n o' e..\n+\t\"\n+}\n+test_run_rebase success ''\n+test_run_rebase success -m\n+test_run_rebase success -i\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\texpected=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* of non-linear history is linearized in place\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* d w &&\n+\t\ttest_cmp_rev d HEAD~3 &&\n+\t\ttest_linear_range \"\\'\"$expected\"\\'\" d..\n+\t\"\n+}\n+#TODO: make order consistent across all flavors of rebase\n+test_run_rebase success 'e n o' ''\n+test_run_rebase success 'e n o' -m\n+test_run_rebase success 'n o e' -i\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\texpected=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* of non-linear history is linearized upstream\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* c w &&\n+\t\ttest_cmp_rev c HEAD~4 &&\n+\t\ttest_linear_range \"\\'\"$expected\"\\'\" c..\n+\t\"\n+}\n+#TODO: make order consistent across all flavors of rebase\n+test_run_rebase success 'd e n o' ''\n+test_run_rebase success 'd e n o' -m\n+test_run_rebase success 'd n o e' -i\n+\n+test_run_rebase () {\n+\tresult=$1\n+\tshift\n+\texpected=$1\n+\tshift\n+\ttest_expect_$result \"rebase $* of non-linear history with merges after upstream merge is linearized\" \"\n+\t\treset_rebase &&\n+\t\tgit rebase $* c v &&\n+\t\ttest_cmp_rev c HEAD~4 &&\n+\t\ttest_linear_range \"\\'\"$expected\"\\'\" c..\n+\t\"\n+}\n+#TODO: make order consistent across all flavors of rebase\n+test_run_rebase success 'd e n o' ''\n+test_run_rebase success 'd e n o' -m\n+test_run_rebase success 'd n o e' -i\n+\n+test_expect_success \"rebase -p is no-op in non-linear history\" \"\n+\treset_rebase &&\n+\tgit rebase -p d w &&\n+\ttest_cmp_rev w HEAD\n+\"\n+\n+test_expect_success \"rebase -p is no-op when base inside second parent\" \"\n+\treset_rebase &&\n+\tgit rebase -p e w &&\n+\ttest_cmp_rev w HEAD\n+\"\n+\n+test_expect_failure \"rebase -p --root on non-linear history is a no-op\" \"\n+\treset_rebase &&\n+\tgit rebase -p --root w &&\n+\ttest_cmp_rev w HEAD\n+\"\n+\n+test_expect_success \"rebase -p re-creates merge from side branch\" \"\n+\treset_rebase &&\n+\tgit rebase -p z w &&\n+\ttest_cmp_rev z HEAD^ &&\n+\ttest_cmp_rev w^2 HEAD^2\n+\"\n+\n+test_expect_success \"rebase -p re-creates internal merge\" \"\n+\treset_rebase &&\n+\tgit rebase -p c w &&\n+\ttest_cmp_rev c HEAD~4 &&\n+\ttest_cmp_rev HEAD^2^ HEAD~3 &&\n+\ttest_revision_subjects 'd n e o w' HEAD~3 HEAD~2 HEAD^2 HEAD^ HEAD\n+\"\n+\n+test_expect_success \"rebase -p can re-create two branches on onto\" \"\n+\treset_rebase &&\n+\tgit rebase -p --onto c d w &&\n+\ttest_cmp_rev c HEAD~3 &&\n+\ttest_cmp_rev c HEAD^2^ &&\n+\ttest_revision_subjects 'n e o w' HEAD~2 HEAD^2 HEAD^ HEAD\n+\"\n+\n+#       f\n+#      /\n+# a---b---c---g---h\n+#      \\\n+#       d---G---i\n+#        \\       \\\n+#         e-------u\n+#\n+# uppercase = cherry-picked\n+# h = reverted g\n+test_expect_success 'setup of non-linear-history for patch-equivalence tests' '\n+\tgit checkout e &&\n+\ttest_merge u i\n+'\n+\n+test_expect_success \"rebase -p re-creates history around dropped commit matching upstream\" \"\n+\treset_rebase &&\n+\tgit rebase -p h u &&\n+\ttest_cmp_rev h HEAD~3 &&\n+\ttest_cmp_rev HEAD^2^ HEAD~2 &&\n+\ttest_revision_subjects 'd i e u' HEAD~2 HEAD^2 HEAD^ HEAD\n+\"\n+\n+test_expect_success \"rebase -p --onto in merged history drops patches in upstream\" \"\n+\treset_rebase &&\n+\tgit rebase -p --onto f h u &&\n+\ttest_cmp_rev f HEAD~3 &&\n+\ttest_cmp_rev HEAD^2^ HEAD~2 &&\n+\ttest_revision_subjects 'd i e u' HEAD~2 HEAD^2 HEAD^ HEAD\n+\"\n+\n+test_expect_success \"rebase -p --onto in merged history does not drop patches in onto\" \"\n+\treset_rebase &&\n+\tgit rebase -p --onto h f u &&\n+\ttest_cmp_rev h HEAD~3 &&\n+\ttest_cmp_rev HEAD^2~2 HEAD~2 &&\n+\ttest_revision_subjects 'd G i e u' HEAD~2 HEAD^2^ HEAD^2 HEAD^ HEAD\n+\"\n+\n+# a---b---c---g---h\n+#      \\\n+#       d---G---s\n+#        \\   \\ /\n+#         \\   X\n+#          \\ / \\\n+#           e---t\n+#\n+# uppercase = cherry-picked\n+# h = reverted g\n+test_expect_success 'setup of non-linear-history for dropping whole side' '\n+\tgit checkout G &&\n+\ttest_merge s e &&\n+\tgit checkout e &&\n+\ttest_merge t G\n+'\n+\n+test_expect_failure \"rebase -p drops merge commit when entire first-parent side is dropped\" \"\n+\treset_rebase &&\n+\tgit rebase -p h s &&\n+\ttest_cmp_rev h HEAD~2 &&\n+\ttest_linear_range 'd e' h..\n+\"\n+\n+test_expect_success \"rebase -p drops merge commit when entire second-parent side is dropped\" \"\n+\treset_rebase &&\n+\tgit rebase -p h t &&\n+\ttest_cmp_rev h HEAD~2 &&\n+\ttest_linear_range 'd e' h..\n+\"\n+\n+# a---b---c\n+#      \\\n+#       d---e\n+#        \\   \\\n+#         n---r\n+#          \\\n+#           o\n+#\n+# r = tree-same with n\n+test_expect_success 'setup of non-linear-history for empty commits' '\n+\tgit checkout n &&\n+\tgit merge --no-commit e &&\n+\tgit reset n . &&\n+\tgit commit -m r &&\n+\tgit reset --hard &&\n+\tgit clean -f &&\n+\tgit tag r\n+'\n+\n+test_expect_success \"rebase -p re-creates empty internal merge commit\" \"\n+\treset_rebase &&\n+\tgit rebase -p c r &&\n+\ttest_cmp_rev c HEAD~3 &&\n+\ttest_cmp_rev HEAD^2^ HEAD~2 &&\n+\ttest_revision_subjects 'd e n r' HEAD~2 HEAD^2 HEAD^ HEAD\n+\"\n+\n+test_expect_success \"rebase -p re-creates empty merge commit\" \"\n+\treset_rebase &&\n+\tgit rebase -p o r &&\n+\ttest_cmp_rev e HEAD^2 &&\n+\ttest_cmp_rev o HEAD^ &&\n+\ttest_revision_subjects 'r' HEAD\n+\"\n+\n+test_done\n-- \n1.8.3.698.g079b096\n"},{"id":"220012","messageId":"1370796057-25312-44-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 43/45] t3406: modernize style","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:55Z","receivedAt":"2013-06-09T16:40:55Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Martin von Zweigbergk <martinvonz@gmail.com>\n\nUpdate the following:\n\n - Quote 'setup'\n - Remove blank lines within test case body\n - Use test_commit instead of custom quick_one\n - Create branch \"topic\" from tag created by test_commit\n\nSigned-off-by: Martin von Zweigbergk <martinvonz@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n\nConflicts:\n\tt/t3406-rebase-message.sh\n---\n t/t3406-rebase-message.sh | 30 ++++++++++--------------------\n 1 file changed, 10 insertions(+), 20 deletions(-)\n\ndiff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh\nindex 37d19c5..7f48d0f 100755\n--- a/t/t3406-rebase-message.sh\n+++ b/t/t3406-rebase-message.sh\n@@ -4,27 +4,17 @@ test_description='messages from rebase operation'\n \n . ./test-lib.sh\n \n-quick_one () {\n-\techo \"$1\" >\"file$1\" &&\n-\tgit add \"file$1\" &&\n-\ttest_tick &&\n-\tgit commit -m \"$1\"\n-}\n-\n-test_expect_success setup '\n-\tquick_one O &&\n-\tgit branch topic &&\n-\tquick_one X &&\n-\tquick_one A &&\n-\tquick_one B &&\n-\tquick_one Y &&\n-\n-\tgit checkout topic &&\n-\tquick_one A &&\n-\tquick_one B &&\n-\tquick_one Z &&\n+test_expect_success 'setup' '\n+\ttest_commit O fileO &&\n+\ttest_commit X fileX &&\n+\ttest_commit A fileA &&\n+\ttest_commit B fileB &&\n+\ttest_commit Y fileY &&\n+\n+\tgit checkout -b topic O &&\n+\tgit cherry-pick A B &&\n+\ttest_commit Z fileZ &&\n \tgit tag start\n-\n '\n \n test_expect_success 'rebase --stat' '\n-- \n1.8.3.698.g079b096\n"},{"id":"220009","messageId":"1370796057-25312-45-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 44/45] tests: move test for rebase messages from t3400 to t3406","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:56Z","receivedAt":"2013-06-09T16:40:56Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"From: Martin von Zweigbergk <martinvonz@gmail.com>\n\nt3406 is supposed to test \"messages from rebase operation\", so let's\nmove tests in t3400 that fit that description into 3406. Most of the\nfunctionality they tested, except for the messages, has now been\nsubsumed by t3420.\n\nSigned-off-by: Martin von Zweigbergk <martinvonz@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n\nConflicts:\n\tt/t3406-rebase-message.sh\n---\n t/t3400-rebase.sh         | 22 ----------------------\n t/t3406-rebase-message.sh | 23 +++++++++++++++++++++++\n 2 files changed, 23 insertions(+), 22 deletions(-)\n\ndiff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh\nindex b436ef4..45a55e9 100755\n--- a/t/t3400-rebase.sh\n+++ b/t/t3400-rebase.sh\n@@ -59,28 +59,6 @@ test_expect_success 'rebase against master' '\n \tgit rebase master\n '\n \n-test_expect_success 'rebase against master twice' '\n-\tgit rebase master >out &&\n-\ttest_i18ngrep \"Current branch my-topic-branch is up to date\" out\n-'\n-\n-test_expect_success 'rebase against master twice with --force' '\n-\tgit rebase --force-rebase master >out &&\n-\ttest_i18ngrep \"Current branch my-topic-branch is up to date, rebase forced\" out\n-'\n-\n-test_expect_success 'rebase against master twice from another branch' '\n-\tgit checkout my-topic-branch^ &&\n-\tgit rebase master my-topic-branch >out &&\n-\ttest_i18ngrep \"Current branch my-topic-branch is up to date\" out\n-'\n-\n-test_expect_success 'rebase fast-forward to master' '\n-\tgit checkout my-topic-branch^ &&\n-\tgit rebase my-topic-branch >out &&\n-\ttest_i18ngrep \"Fast-forwarded HEAD to my-topic-branch\" out\n-'\n-\n test_expect_success 'the rebase operation should not have destroyed author information' '\n \t! (git log | grep \"Author:\" | grep \"<>\")\n '\ndiff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh\nindex 7f48d0f..f03cc5f 100755\n--- a/t/t3406-rebase-message.sh\n+++ b/t/t3406-rebase-message.sh\n@@ -17,6 +17,29 @@ test_expect_success 'setup' '\n \tgit tag start\n '\n \n+test_expect_success 'rebase against master twice' '\n+\tgit rebase -m master &&\n+\tgit rebase master >out &&\n+\ttest_i18ngrep \"Current branch topic is up to date\" out\n+'\n+\n+test_expect_success 'rebase against master twice with --force' '\n+\tgit rebase --force-rebase master >out &&\n+\ttest_i18ngrep \"Current branch topic is up to date, rebase forced\" out\n+'\n+\n+test_expect_success 'rebase against master twice from another branch' '\n+\tgit checkout topic^ &&\n+\tgit rebase master topic >out &&\n+\ttest_i18ngrep \"Current branch topic is up to date\" out\n+'\n+\n+test_expect_success 'rebase fast-forward to master' '\n+\tgit checkout topic^ &&\n+\tgit rebase topic >out &&\n+\ttest_i18ngrep \"Fast-forwarded HEAD to topic\" out\n+'\n+\n test_expect_success 'rebase --stat' '\n \tgit reset --hard start &&\n         git rebase --stat master >diffstat.txt &&\n-- \n1.8.3.698.g079b096\n"},{"id":"220013","messageId":"1370796057-25312-46-git-send-email-felipe.contreras@gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v4 45/45] tests: update topology tests","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T16:40:57Z","receivedAt":"2013-06-09T16:40:57Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n---\n t/t3425-rebase-topology-merges.sh | 15 ++++++---------\n 1 file changed, 6 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t3425-rebase-topology-merges.sh b/t/t3425-rebase-topology-merges.sh\nindex 5400a05..96cc479 100755\n--- a/t/t3425-rebase-topology-merges.sh\n+++ b/t/t3425-rebase-topology-merges.sh\n@@ -70,9 +70,8 @@ test_run_rebase () {\n \t\ttest_linear_range \"\\'\"$expected\"\\'\" d..\n \t\"\n }\n-#TODO: make order consistent across all flavors of rebase\n-test_run_rebase success 'e n o' ''\n-test_run_rebase success 'e n o' -m\n+test_run_rebase success 'n o e' ''\n+test_run_rebase success 'n o e' -m\n test_run_rebase success 'n o e' -i\n \n test_run_rebase () {\n@@ -87,9 +86,8 @@ test_run_rebase () {\n \t\ttest_linear_range \"\\'\"$expected\"\\'\" c..\n \t\"\n }\n-#TODO: make order consistent across all flavors of rebase\n-test_run_rebase success 'd e n o' ''\n-test_run_rebase success 'd e n o' -m\n+test_run_rebase success 'd n o e' ''\n+test_run_rebase success 'd n o e' -m\n test_run_rebase success 'd n o e' -i\n \n test_run_rebase () {\n@@ -104,9 +102,8 @@ test_run_rebase () {\n \t\ttest_linear_range \"\\'\"$expected\"\\'\" c..\n \t\"\n }\n-#TODO: make order consistent across all flavors of rebase\n-test_run_rebase success 'd e n o' ''\n-test_run_rebase success 'd e n o' -m\n+test_run_rebase success 'd n o e' ''\n+test_run_rebase success 'd n o e' -m\n test_run_rebase success 'd n o e' -i\n \n test_expect_success \"rebase -p is no-op in non-linear history\" \"\n-- \n1.8.3.698.g079b096\n"},{"id":"220019","messageId":"CALWbr2z_VArUi_4iKgdUgmUTA0hQ0EDF9ZuMs4RdEEZfnFOxMw@mail.gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-7-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v4 06/45] Move sequencer to builtin","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-06-09T17:02:23Z","receivedAt":"2013-06-09T17:02:23Z","isPatch":true,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"On Sun, Jun 9, 2013 at 6:40 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n>\n> This code is only useful for cherry-pick and revert built-ins, nothing\n> else, so let's make it a builtin object.\n>\n> The first source file that doesn't generate a git-foo builtin, but does\n> go into the builtin library. Hopefully the first of many to clean\n> libgit.a.\n\nHey Felipe,\nI don't understand why the code doesn't belong to libgit.a, and how\nit's gonna make it more \"clean\". I can see that it is needed only by\nrevert and cherry-pick, but is that the only reason ?\n\nThanks for taking the time to enlighten me :)\n"},{"id":"220021","messageId":"CAMP44s34-rq_jer5T8ovcbM4u+wsSSnd3RSQkK6yoEDqzEb9QA@mail.gmail.com","threadId":"34075","inReplyTo":"CALWbr2z_VArUi_4iKgdUgmUTA0hQ0EDF9ZuMs4RdEEZfnFOxMw@mail.gmail.com","subject":"Re: [PATCH v4 06/45] Move sequencer to builtin","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T17:06:40Z","receivedAt":"2013-06-09T17:06:40Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 12:02 PM, Antoine Pelisse <apelisse@gmail.com> wrote:\n> On Sun, Jun 9, 2013 at 6:40 PM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n>>\n>> This code is only useful for cherry-pick and revert built-ins, nothing\n>> else, so let's make it a builtin object.\n>>\n>> The first source file that doesn't generate a git-foo builtin, but does\n>> go into the builtin library. Hopefully the first of many to clean\n>> libgit.a.\n>\n> Hey Felipe,\n> I don't understand why the code doesn't belong to libgit.a, and how\n> it's gonna make it more \"clean\". I can see that it is needed only by\n> revert and cherry-pick, but is that the only reason ?\n>\n> Thanks for taking the time to enlighten me :)\n\nA libgit library should be useful for things other than builtin\ncommands. Eventually libgit.a should be similar to libgit2, therefore\nif libgit2 wouldn't want sequencer.c in it (it doesn't) neither should\nwe want this code in libgit.a. It belongs in builtin/lib.a.\n\nIf we don't start moving non-library stuff out of libgit.a, libgit.a\nwill never be a library.\n\n-- \nFelipe Contreras\n"},{"id":"220022","messageId":"CALkWK0nA=27wqds-FZfPFtzdsAm1VKsZOF4hAOCLNi==FjrkKw@mail.gmail.com","threadId":"34075","inReplyTo":"CALWbr2z_VArUi_4iKgdUgmUTA0hQ0EDF9ZuMs4RdEEZfnFOxMw@mail.gmail.com","subject":"Re: [PATCH v4 06/45] Move sequencer to builtin","fromName":"Ramkumar Ramachandra","fromEmail":"artagnon@gmail.com","sentAt":"2013-06-09T17:07:52Z","receivedAt":"2013-06-09T17:07:52Z","isPatch":true,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Antoine Pelisse wrote:\n> I don't understand why the code doesn't belong to libgit.a, and how\n> it's gonna make it more \"clean\". I can see that it is needed only by\n> revert and cherry-pick, but is that the only reason ?\n\nPerhaps this will help? [1].  Join into the discussion.\n\n[1]: http://thread.gmane.org/gmane.comp.version-control.git/226845\n"},{"id":"220023","messageId":"CALWbr2yfbmkFQzm_GJHJWTXwge4WRReOokcRDCfEdAjTP9_y2A@mail.gmail.com","threadId":"34075","inReplyTo":"CALkWK0nA=27wqds-FZfPFtzdsAm1VKsZOF4hAOCLNi==FjrkKw@mail.gmail.com","subject":"Re: [PATCH v4 06/45] Move sequencer to builtin","fromName":"Antoine Pelisse","fromEmail":"apelisse@gmail.com","sentAt":"2013-06-09T17:10:37Z","receivedAt":"2013-06-09T17:10:37Z","isPatch":true,"sender":{"key":"apelisse@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1929644?v=4"},"body":"On Sun, Jun 9, 2013 at 7:07 PM, Ramkumar Ramachandra <artagnon@gmail.com> wrote:\n> Antoine Pelisse wrote:\n>> I don't understand why the code doesn't belong to libgit.a, and how\n>> it's gonna make it more \"clean\". I can see that it is needed only by\n>> revert and cherry-pick, but is that the only reason ?\n>\n> Perhaps this will help? [1].  Join into the discussion.\n>\n> [1]: http://thread.gmane.org/gmane.comp.version-control.git/226845\n\nOK Thanks, missed that. I'm catching up the last two hours of discussions.\n"},{"id":"220031","messageId":"20130609171741.GA2091@goldbirke","threadId":"34075","inReplyTo":"1370796057-25312-4-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v4 03/45] build: trivial cleanup","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2013-06-09T17:17:41Z","receivedAt":"2013-06-09T17:17:41Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sun, Jun 09, 2013 at 11:40:15AM -0500, Felipe Contreras wrote:\n> There's no need to list again the prerequisites.\n> \n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n\nPlease write more shortlog-friendly subject lines describing what the\nactual change is.\n\nIn this case for example: \"build: substitute library prerequisites\nusing $^\"\n"},{"id":"220032","messageId":"20130609171810.GA10858@goldbirke","threadId":"34075","inReplyTo":"1370796057-25312-11-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2013-06-09T17:18:10Z","receivedAt":"2013-06-09T17:18:10Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sun, Jun 09, 2013 at 11:40:22AM -0500, Felipe Contreras wrote:\n> We should free objects before leaving.\n> \n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n\nA shortlog-friendlier subject could be: \"sequencer: free objects\nbefore leaving\".\n"},{"id":"220033","messageId":"871u8bdwrb.fsf@hexa.v.cablecom.net","threadId":"34075","inReplyTo":"1370796057-25312-21-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v4 20/45] cherry-pick: copy notes and run hooks","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2013-06-09T17:22:48Z","receivedAt":"2013-06-09T17:22:48Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> +static void finish(struct replay_opts *opts)\n> +{\n> +\tif (opts->action != REPLAY_PICK)\n> +\t\treturn;\n> +\n> +\trun_rewrite_hook(&rewritten, \"cherry-pick\");\n> +\tcopy_rewrite_notes(&rewritten, \"cherry-pick\");\n> +}\n> +\n\nOk, so I see that with the previous two commits, you automatically get\nhandling of the notes.rewrite.cherry-pick variable and friends.  This is\ngood.\n\nHowever, there are some open points:\n\n* The docs in git-config(1) \"notes.rewrite.cherry-pick\" and githooks(5)\n  \"post-rewrite\" and are now stale in so far as they contain a list of\n  commands doing rewriting.\n\n* This pretends to be cherry-pick even when the hook is called from\n  rebase.\n\n  We could claim (and document) that git-rebase with certain options\n  shall be the same as running cherry-pick with some other options.\n  However, git-am already goes out of its way to ensure that it only\n  does the rewriting/post-rewrite if called from rebase (so that the\n  user-facing git-am command is not affected).  So it's more consistent\n  to ensure that git-cherry-pick, when called from rebase, also pretends\n  to be rebase.\n\n* githooks(5) documents explicitly that by the time post-rewrite is\n  called, the notes have been rewritten.  Your change does it in the\n  opposite order.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"220034","messageId":"CAMP44s3yhVbgkhtrSfHpk=VwcwMkb66ELA-xR0i6FCVGyRwHJw@mail.gmail.com","threadId":"34075","inReplyTo":"20130609171810.GA10858@goldbirke","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T17:23:01Z","receivedAt":"2013-06-09T17:23:01Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 12:18 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n> On Sun, Jun 09, 2013 at 11:40:22AM -0500, Felipe Contreras wrote:\n>> We should free objects before leaving.\n>>\n>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>\n> A shortlog-friendlier subject could be: \"sequencer: free objects\n> before leaving\".\n\nI already defended my rationale for this succinct commit message:\n\nhttp://thread.gmane.org/gmane.comp.version-control.git/225609/focus=225610\n\n-- \nFelipe Contreras\n"},{"id":"220035","messageId":"87wqq3ci1n.fsf@hexa.v.cablecom.net","threadId":"34075","inReplyTo":"1370796057-25312-43-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v4 42/45] add tests for rebasing merged history","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2013-06-09T17:25:56Z","receivedAt":"2013-06-09T17:25:56Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> +#TODO: make order consistent across all flavors of rebase\n> +test_run_rebase success 'd e n o' ''\n> +test_run_rebase success 'd e n o' -m\n> +test_run_rebase success 'd n o e' -i\n\n[45/45] would seem to imply that these tests fail as of this patch.  Is\nthat correct?\n\nIf so, please either squash that change or move the test further up\nmarked as 'failure'.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"220036","messageId":"CAMP44s0c-MCHSQSrx7qJaTSMTArv-Sfpi9nZSvPjmrLfVgMpQQ@mail.gmail.com","threadId":"34075","inReplyTo":"871u8bdwrb.fsf@hexa.v.cablecom.net","subject":"Re: [PATCH v4 20/45] cherry-pick: copy notes and run hooks","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T17:29:31Z","receivedAt":"2013-06-09T17:29:31Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 12:22 PM, Thomas Rast <trast@inf.ethz.ch> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> +static void finish(struct replay_opts *opts)\n>> +{\n>> +     if (opts->action != REPLAY_PICK)\n>> +             return;\n>> +\n>> +     run_rewrite_hook(&rewritten, \"cherry-pick\");\n>> +     copy_rewrite_notes(&rewritten, \"cherry-pick\");\n>> +}\n>> +\n>\n> Ok, so I see that with the previous two commits, you automatically get\n> handling of the notes.rewrite.cherry-pick variable and friends.  This is\n> good.\n>\n> However, there are some open points:\n>\n> * The docs in git-config(1) \"notes.rewrite.cherry-pick\" and githooks(5)\n>   \"post-rewrite\" and are now stale in so far as they contain a list of\n>   commands doing rewriting.\n\nFine.\n\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -28,9 +28,9 @@ static void finish(struct replay_opts *opts)\n        if (opts->action != REPLAY_PICK)\n                return;\n\n-       name = opts->action_name ? opts->action_name : \"cherry-pick\";\n+       name = opts->action_name\n\n-       if (!*name)\n+       if (!name || !*name)\n                return;\n\n        run_rewrite_hook(&rewritten, name);\n\nNow, we won't run when 'git cherry-pick' is called, only when an\naction-name is specified; when called from 'git rebase'.\n\n> * This pretends to be cherry-pick even when the hook is called from\n>   rebase.\n\nNo.\n\nhttp://mid.gmane.org/1370796057-25312-31-git-send-email-felipe.contreras@gmail.com\n\n> * githooks(5) documents explicitly that by the time post-rewrite is\n>   called, the notes have been rewritten.  Your change does it in the\n>   opposite order.\n\nOK.\n\nBut it doesn't matter, because the patch won't be applied.\n\n-- \nFelipe Contreras\n"},{"id":"220038","messageId":"CAMP44s30YkE5i7B==pyB8zkNxu=YoGvP1=V_2LqOe_frXV+cfQ@mail.gmail.com","threadId":"34075","inReplyTo":"87wqq3ci1n.fsf@hexa.v.cablecom.net","subject":"Re: [PATCH v4 42/45] add tests for rebasing merged history","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T17:31:45Z","receivedAt":"2013-06-09T17:31:45Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 12:25 PM, Thomas Rast <trast@inf.ethz.ch> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> +#TODO: make order consistent across all flavors of rebase\n>> +test_run_rebase success 'd e n o' ''\n>> +test_run_rebase success 'd e n o' -m\n>> +test_run_rebase success 'd n o e' -i\n>\n> [45/45] would seem to imply that these tests fail as of this patch.  Is\n> that correct?\n>\n> If so, please either squash that change or move the test further up\n> marked as 'failure'.\n\nI won't. The whole purpose of the last patch is to show these tests are fixed.\n\nMartin von Zweigbergk's patch series is independent of this one, I\nmerely added it to show the above.\n\nEventually Martin's patch series will be merged, while mine probably won't.\n\n-- \nFelipe Contreras\n"},{"id":"220039","messageId":"87obbfchqb.fsf@hexa.v.cablecom.net","threadId":"34075","inReplyTo":"CAMP44s30YkE5i7B==pyB8zkNxu=YoGvP1=V_2LqOe_frXV+cfQ@mail.gmail.com","subject":"Re: [PATCH v4 42/45] add tests for rebasing merged history","fromName":"Thomas Rast","fromEmail":"trast@inf.ethz.ch","sentAt":"2013-06-09T17:32:44Z","receivedAt":"2013-06-09T17:32:44Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Felipe Contreras <felipe.contreras@gmail.com> writes:\n\n> On Sun, Jun 9, 2013 at 12:25 PM, Thomas Rast <trast@inf.ethz.ch> wrote:\n>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>>\n>>> +#TODO: make order consistent across all flavors of rebase\n>>> +test_run_rebase success 'd e n o' ''\n>>> +test_run_rebase success 'd e n o' -m\n>>> +test_run_rebase success 'd n o e' -i\n>>\n>> [45/45] would seem to imply that these tests fail as of this patch.  Is\n>> that correct?\n>>\n>> If so, please either squash that change or move the test further up\n>> marked as 'failure'.\n>\n> I won't. The whole purpose of the last patch is to show these tests are fixed.\n>\n> Martin von Zweigbergk's patch series is independent of this one, I\n> merely added it to show the above.\n\nSo you would deliberately break a bisection on this test file?\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"220041","messageId":"20130609173342.GB2091@goldbirke","threadId":"34075","inReplyTo":"CAMP44s3yhVbgkhtrSfHpk=VwcwMkb66ELA-xR0i6FCVGyRwHJw@mail.gmail.com","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2013-06-09T17:33:42Z","receivedAt":"2013-06-09T17:33:42Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sun, Jun 09, 2013 at 12:23:01PM -0500, Felipe Contreras wrote:\n> On Sun, Jun 9, 2013 at 12:18 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n> > On Sun, Jun 09, 2013 at 11:40:22AM -0500, Felipe Contreras wrote:\n> >> We should free objects before leaving.\n> >>\n> >> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> >\n> > A shortlog-friendlier subject could be: \"sequencer: free objects\n> > before leaving\".\n> \n> I already defended my rationale for this succinct commit message:\n> \n> http://thread.gmane.org/gmane.comp.version-control.git/225609/focus=225610\n\nYour arguments were unconvincing.  The mere fact that I raised this\nissue unbeknownst to the earlier posting clearly shows that there's\ndemand for descriptive subjects.\n"},{"id":"220043","messageId":"20130609173739.GF22905@serenity.lan","threadId":"34075","inReplyTo":"20130609173342.GB2091@goldbirke","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-06-09T17:37:39Z","receivedAt":"2013-06-09T17:37:39Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Sun, Jun 09, 2013 at 07:33:42PM +0200, SZEDER Gábor wrote:\n> On Sun, Jun 09, 2013 at 12:23:01PM -0500, Felipe Contreras wrote:\n> > On Sun, Jun 9, 2013 at 12:18 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n> > > On Sun, Jun 09, 2013 at 11:40:22AM -0500, Felipe Contreras wrote:\n> > >> We should free objects before leaving.\n> > >>\n> > >> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> > >\n> > > A shortlog-friendlier subject could be: \"sequencer: free objects\n> > > before leaving\".\n> > \n> > I already defended my rationale for this succinct commit message:\n> > \n> > http://thread.gmane.org/gmane.comp.version-control.git/225609/focus=225610\n> \n> Your arguments were unconvincing.  The mere fact that I raised this\n> issue unbeknownst to the earlier posting clearly shows that there's\n> demand for descriptive subjects.\n\nNot to mention that with your subject no body is needed, making the\noverall message more succinct.\n\nWhen reading a log, as soon as I see \"trivial\" I become suspicious that\nsomeone is trying to cover something up, much like \"left as an exercise\nfor the reader\".  If the subject says \"fix memory leak\" then it's\nobvious what the patch is meant to do, and when there is no subtlety to\nbe explained (as there isn't in this patch) there is no need for a body.\n"},{"id":"220050","messageId":"CAMP44s1DKUqXgZLfkHT45ST3WtqkrWZD0KEwQwriVoN5GMT=SQ@mail.gmail.com","threadId":"34075","inReplyTo":"87obbfchqb.fsf@hexa.v.cablecom.net","subject":"Re: [PATCH v4 42/45] add tests for rebasing merged history","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T17:46:07Z","receivedAt":"2013-06-09T17:46:07Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 12:32 PM, Thomas Rast <trast@inf.ethz.ch> wrote:\n> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>\n>> On Sun, Jun 9, 2013 at 12:25 PM, Thomas Rast <trast@inf.ethz.ch> wrote:\n>>> Felipe Contreras <felipe.contreras@gmail.com> writes:\n>>>\n>>>> +#TODO: make order consistent across all flavors of rebase\n>>>> +test_run_rebase success 'd e n o' ''\n>>>> +test_run_rebase success 'd e n o' -m\n>>>> +test_run_rebase success 'd n o e' -i\n>>>\n>>> [45/45] would seem to imply that these tests fail as of this patch.  Is\n>>> that correct?\n>>>\n>>> If so, please either squash that change or move the test further up\n>>> marked as 'failure'.\n>>\n>> I won't. The whole purpose of the last patch is to show these tests are fixed.\n>>\n>> Martin von Zweigbergk's patch series is independent of this one, I\n>> merely added it to show the above.\n>\n> So you would deliberately break a bisection on this test file?\n\nNo, this patch series won't be applied.\n\n-- \nFelipe Contreras\n"},{"id":"220051","messageId":"CAMP44s2YdG_pE7gnKfUJJP0SaO5pKu+kxPB=T74p14fuqXU9OQ@mail.gmail.com","threadId":"34075","inReplyTo":"20130609173342.GB2091@goldbirke","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T17:47:16Z","receivedAt":"2013-06-09T17:47:16Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 12:33 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n> On Sun, Jun 09, 2013 at 12:23:01PM -0500, Felipe Contreras wrote:\n>> On Sun, Jun 9, 2013 at 12:18 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n>> > On Sun, Jun 09, 2013 at 11:40:22AM -0500, Felipe Contreras wrote:\n>> >> We should free objects before leaving.\n>> >>\n>> >> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>> >\n>> > A shortlog-friendlier subject could be: \"sequencer: free objects\n>> > before leaving\".\n>>\n>> I already defended my rationale for this succinct commit message:\n>>\n>> http://thread.gmane.org/gmane.comp.version-control.git/225609/focus=225610\n>\n> Your arguments were unconvincing.\n\nThat's your opinion. The commit message I write and send is my decision.\n\n-- \nFelipe Contreras\n"},{"id":"220053","messageId":"CAMP44s1F5O3vjHuL=cGys=p_dbnnE-f-Mv+j5Q1ZbyVAJCjLSA@mail.gmail.com","threadId":"34075","inReplyTo":"20130609173739.GF22905@serenity.lan","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T17:53:38Z","receivedAt":"2013-06-09T17:53:38Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 12:37 PM, John Keeping <john@keeping.me.uk> wrote:\n> On Sun, Jun 09, 2013 at 07:33:42PM +0200, SZEDER Gábor wrote:\n>> On Sun, Jun 09, 2013 at 12:23:01PM -0500, Felipe Contreras wrote:\n>> > On Sun, Jun 9, 2013 at 12:18 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n>> > > On Sun, Jun 09, 2013 at 11:40:22AM -0500, Felipe Contreras wrote:\n>> > >> We should free objects before leaving.\n>> > >>\n>> > >> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>> > >\n>> > > A shortlog-friendlier subject could be: \"sequencer: free objects\n>> > > before leaving\".\n>> >\n>> > I already defended my rationale for this succinct commit message:\n>> >\n>> > http://thread.gmane.org/gmane.comp.version-control.git/225609/focus=225610\n>>\n>> Your arguments were unconvincing.  The mere fact that I raised this\n>> issue unbeknownst to the earlier posting clearly shows that there's\n>> demand for descriptive subjects.\n>\n> Not to mention that with your subject no body is needed, making the\n> overall message more succinct.\n\nIt's not succinct at all, because there's no short and quick\ndescription of what the patch actually is; a trivial fix.\n\n> When reading a log, as soon as I see \"trivial\" I become suspicious that\n> someone is trying to cover something up, much like \"left as an exercise\n> for the reader\".  If the subject says \"fix memory leak\" then it's\n> obvious what the patch is meant to do, and when there is no subtlety to\n> be explained (as there isn't in this patch) there is no need for a body.\n\nYou are not a rational person then. The commit message has absolutely\nno bearing on the quality of the code. If you are less suspicious of a\ncommit message that says \"fix memory leak\", you are being completely\nbiased.\n\nWhether the commit message says \"fix memory leak\", or \"trivial fix\",\nor \"foobar\", the code might still be doing something wrong, and you\ncan't decide that until you look at the code.\n\nIf you don't care about the code, but still want to know what the\npatch is doing, then you can look at the whole commit message, and \"We\nshould free objects before leaving.\" explains that perfectly.\n\nFor the people that only read the summary, the vast majority of them\nneed to know what this patch is, not what it does, and when they see\n\"trivial fix\" they most likely can skip it.\n\n-- \nFelipe Contreras\n"},{"id":"220054","messageId":"20130609175353.GC2091@goldbirke","threadId":"34075","inReplyTo":"CAMP44s2YdG_pE7gnKfUJJP0SaO5pKu+kxPB=T74p14fuqXU9OQ@mail.gmail.com","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2013-06-09T17:53:53Z","receivedAt":"2013-06-09T17:53:53Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sun, Jun 09, 2013 at 12:47:16PM -0500, Felipe Contreras wrote:\n> On Sun, Jun 9, 2013 at 12:33 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n> > On Sun, Jun 09, 2013 at 12:23:01PM -0500, Felipe Contreras wrote:\n> >> On Sun, Jun 9, 2013 at 12:18 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n> >> > On Sun, Jun 09, 2013 at 11:40:22AM -0500, Felipe Contreras wrote:\n> >> >> We should free objects before leaving.\n> >> >>\n> >> >> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> >> >\n> >> > A shortlog-friendlier subject could be: \"sequencer: free objects\n> >> > before leaving\".\n> >>\n> >> I already defended my rationale for this succinct commit message:\n> >>\n> >> http://thread.gmane.org/gmane.comp.version-control.git/225609/focus=225610\n> >\n> > Your arguments were unconvincing.\n> \n> That's your opinion.\n\nAnd Duy's.  And John's, too, apparently.\n\n> The commit message I write and send is my decision.\n\nIt's always a pleasure to work with you.\n\nGuess I should've known better.\n\n\nBye,\nGábor\n"},{"id":"220080","messageId":"20130609181724.GA11516@paksenarrion.iveqy.com","threadId":"34075","inReplyTo":"1370796057-25312-10-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v4 09/45] sequencer: remove useless indentation","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-06-09T18:17:24Z","receivedAt":"2013-06-09T18:17:24Z","isPatch":true,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Sun, Jun 09, 2013 at 11:40:21AM -0500, Felipe Contreras wrote:\n> By using good ol' goto.\n> \n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n\nI don't see this as an indentation change but as a restructing of the\ncode. I would prefer something more like\n\"Replace early return with goto cleanup\" (but better phrased).\n\nThe same goes for the next patch in this serie, I would prefer if the\nshortlog tells what have been done, not how hard it was to do. Even\ntrivial changes can introduce bugs and when the commit message is just\nthat \"this is trivial\" it forces me to read the diff to know if that's\nsomething that can effect me or not.\n\n> +leave:\n>  \tfree_message(&msg);\n>  \tfree(defmsg);\n\nleave: should be cleanup: or out: to conform with already written code. I\nsuppose there will be a lot of those changes from now on and it will be\neasier if the name of the cleanup-label always is the same.\n\nMaybe small things to review, but I think those things will lead to a\nbetter code-base in the long term.\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"220082","messageId":"CAMP44s3VL-uDPcsUyaYX3ESFbdj7h0XGuVZD+y8J_KewHcPC5g@mail.gmail.com","threadId":"34075","inReplyTo":"20130609181724.GA11516@paksenarrion.iveqy.com","subject":"Re: [PATCH v4 09/45] sequencer: remove useless indentation","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T18:19:03Z","receivedAt":"2013-06-09T18:19:03Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 1:17 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> On Sun, Jun 09, 2013 at 11:40:21AM -0500, Felipe Contreras wrote:\n>> By using good ol' goto.\n>>\n>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>\n> I don't see this as an indentation change but as a restructing of the\n> code. I would prefer something more like\n> \"Replace early return with goto cleanup\" (but better phrased).\n\nThe explains what the patch is doing, but not why. Why is more important.\n\n> The same goes for the next patch in this serie, I would prefer if the\n> shortlog tells what have been done, not how hard it was to do.\n\nIt explains what it is, and why it makes sense.\n\n-- \nFelipe Contreras\n"},{"id":"220083","messageId":"CAMP44s2MrV+dFk+vv-NXyWAd0_M+Nb+SaHANNmv-hatWF1mYEg@mail.gmail.com","threadId":"34075","inReplyTo":"20130609175353.GC2091@goldbirke","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T18:21:02Z","receivedAt":"2013-06-09T18:21:02Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 12:53 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n> On Sun, Jun 09, 2013 at 12:47:16PM -0500, Felipe Contreras wrote:\n>> On Sun, Jun 9, 2013 at 12:33 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n>> > On Sun, Jun 09, 2013 at 12:23:01PM -0500, Felipe Contreras wrote:\n>> >> On Sun, Jun 9, 2013 at 12:18 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n>> >> > On Sun, Jun 09, 2013 at 11:40:22AM -0500, Felipe Contreras wrote:\n>> >> >> We should free objects before leaving.\n>> >> >>\n>> >> >> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>> >> >\n>> >> > A shortlog-friendlier subject could be: \"sequencer: free objects\n>> >> > before leaving\".\n>> >>\n>> >> I already defended my rationale for this succinct commit message:\n>> >>\n>> >> http://thread.gmane.org/gmane.comp.version-control.git/225609/focus=225610\n>> >\n>> > Your arguments were unconvincing.\n>>\n>> That's your opinion.\n>\n> And Duy's.  And John's, too, apparently.\n\nAnd it could the opinion of a thousand more people, it doesn't make it\nanything more than an opinion. To think anything else is to fall in\nargumentum ad populum.\n\n-- \nFelipe Contreras\n"},{"id":"220098","messageId":"20130609190103.GG22905@serenity.lan","threadId":"34075","inReplyTo":"CAMP44s1F5O3vjHuL=cGys=p_dbnnE-f-Mv+j5Q1ZbyVAJCjLSA@mail.gmail.com","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-06-09T19:01:03Z","receivedAt":"2013-06-09T19:01:03Z","isPatch":true,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Sun, Jun 09, 2013 at 12:53:38PM -0500, Felipe Contreras wrote:\n> On Sun, Jun 9, 2013 at 12:37 PM, John Keeping <john@keeping.me.uk> wrote:\n> > On Sun, Jun 09, 2013 at 07:33:42PM +0200, SZEDER Gábor wrote:\n> >> On Sun, Jun 09, 2013 at 12:23:01PM -0500, Felipe Contreras wrote:\n> >> > On Sun, Jun 9, 2013 at 12:18 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n> >> > > On Sun, Jun 09, 2013 at 11:40:22AM -0500, Felipe Contreras wrote:\n> >> > >> We should free objects before leaving.\n> >> > >>\n> >> > >> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> >> > >\n> >> > > A shortlog-friendlier subject could be: \"sequencer: free objects\n> >> > > before leaving\".\n> >> >\n> >> > I already defended my rationale for this succinct commit message:\n> >> >\n> >> > http://thread.gmane.org/gmane.comp.version-control.git/225609/focus=225610\n> >>\n> >> Your arguments were unconvincing.  The mere fact that I raised this\n> >> issue unbeknownst to the earlier posting clearly shows that there's\n> >> demand for descriptive subjects.\n> >\n> > Not to mention that with your subject no body is needed, making the\n> > overall message more succinct.\n> \n> It's not succinct at all, because there's no short and quick\n> description of what the patch actually is; a trivial fix.\n\nIs it not equally succinct to say \"fix memory leak\"?\n\n> > When reading a log, as soon as I see \"trivial\" I become suspicious that\n> > someone is trying to cover something up, much like \"left as an exercise\n> > for the reader\".  If the subject says \"fix memory leak\" then it's\n> > obvious what the patch is meant to do, and when there is no subtlety to\n> > be explained (as there isn't in this patch) there is no need for a body.\n> \n> You are not a rational person then. The commit message has absolutely\n> no bearing on the quality of the code. If you are less suspicious of a\n> commit message that says \"fix memory leak\", you are being completely\n> biased.\n>\n> Whether the commit message says \"fix memory leak\", or \"trivial fix\",\n> or \"foobar\", the code might still be doing something wrong, and you\n> can't decide that until you look at the code.\n\nI have a certain level of trust that commit summaries in git.git will be\naccurate.  If I want to know what has changed, then \"fix memory leak\"\nimplies \"no functional change\"; if I see \"trivial fix\" then how do I\nknow what that is?  It could be a whitespace change, a fix to a memory\nleak, a typo correction, a change to a separator in a message shown to\nthe user, or even a small change to corner case behaviour.\n\n> If you don't care about the code, but still want to know what the\n> patch is doing, then you can look at the whole commit message, and \"We\n> should free objects before leaving.\" explains that perfectly.\n\nThe short message is what appears in \"What's Cooking\", why should I need\nto break out of my mail client to find out what it means?\n"},{"id":"220099","messageId":"20130609190814.GA12122@paksenarrion.iveqy.com","threadId":"34075","inReplyTo":"CAMP44s3VL-uDPcsUyaYX3ESFbdj7h0XGuVZD+y8J_KewHcPC5g@mail.gmail.com","subject":"Re: [PATCH v4 09/45] sequencer: remove useless indentation","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-06-09T19:08:14Z","receivedAt":"2013-06-09T19:08:14Z","isPatch":true,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Sun, Jun 09, 2013 at 01:19:03PM -0500, Felipe Contreras wrote:\n> The explains what the patch is doing, but not why. Why is more important.\n\nYou're right. Why are the indentation useless? It doesn't seem to be\nuseless until you added goto. So why is your goto solution better than\nthe previous existing solution?\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"220100","messageId":"CAMP44s15nxOmZb4L5qGJ1+6dy0DkUTnCq6u=SRJgqO18tK-H4Q@mail.gmail.com","threadId":"34075","inReplyTo":"20130609190103.GG22905@serenity.lan","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:11:18Z","receivedAt":"2013-06-09T19:11:18Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 2:01 PM, John Keeping <john@keeping.me.uk> wrote:\n> On Sun, Jun 09, 2013 at 12:53:38PM -0500, Felipe Contreras wrote:\n>> On Sun, Jun 9, 2013 at 12:37 PM, John Keeping <john@keeping.me.uk> wrote:\n>> > On Sun, Jun 09, 2013 at 07:33:42PM +0200, SZEDER Gábor wrote:\n>> >> On Sun, Jun 09, 2013 at 12:23:01PM -0500, Felipe Contreras wrote:\n>> >> > On Sun, Jun 9, 2013 at 12:18 PM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n>> >> > > On Sun, Jun 09, 2013 at 11:40:22AM -0500, Felipe Contreras wrote:\n>> >> > >> We should free objects before leaving.\n>> >> > >>\n>> >> > >> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>> >> > >\n>> >> > > A shortlog-friendlier subject could be: \"sequencer: free objects\n>> >> > > before leaving\".\n>> >> >\n>> >> > I already defended my rationale for this succinct commit message:\n>> >> >\n>> >> > http://thread.gmane.org/gmane.comp.version-control.git/225609/focus=225610\n>> >>\n>> >> Your arguments were unconvincing.  The mere fact that I raised this\n>> >> issue unbeknownst to the earlier posting clearly shows that there's\n>> >> demand for descriptive subjects.\n>> >\n>> > Not to mention that with your subject no body is needed, making the\n>> > overall message more succinct.\n>>\n>> It's not succinct at all, because there's no short and quick\n>> description of what the patch actually is; a trivial fix.\n>\n> Is it not equally succinct to say \"fix memory leak\"?\n\nAlmost. \"fix memory leak\" doesn't say anything about the scope; it can\nbe a huge change, or a trivial one.\n\nPerhaps \"trivial memory leak fix\" would be better.\n\n>> > When reading a log, as soon as I see \"trivial\" I become suspicious that\n>> > someone is trying to cover something up, much like \"left as an exercise\n>> > for the reader\".  If the subject says \"fix memory leak\" then it's\n>> > obvious what the patch is meant to do, and when there is no subtlety to\n>> > be explained (as there isn't in this patch) there is no need for a body.\n>>\n>> You are not a rational person then. The commit message has absolutely\n>> no bearing on the quality of the code. If you are less suspicious of a\n>> commit message that says \"fix memory leak\", you are being completely\n>> biased.\n>>\n>> Whether the commit message says \"fix memory leak\", or \"trivial fix\",\n>> or \"foobar\", the code might still be doing something wrong, and you\n>> can't decide that until you look at the code.\n>\n> I have a certain level of trust that commit summaries in git.git will be\n> accurate.  If I want to know what has changed, then \"fix memory leak\"\n> implies \"no functional change\"; if I see \"trivial fix\" then how do I\n> know what that is?\n\nIt is a trivial fix, that's what it is. You don't need to bother\nyourself with it. Unless you plan to see the code.\n\n> It could be a whitespace change,\n\nThat's not a fix, that's a cleanup.\n\n> a fix to a memory leak, a typo correction, a change to a separator in a message shown to\n> the user,\n\nYou might be right, but I don't think you _need_ to know which one of\nthem it is; they are all trivial. In 90% of the cases you want to skip\nthem and keep reading. In the 10% where you do need more, well, you\nprobably need to look at the code either way.\n\n> or even a small change to corner case behaviour.\n\nThat's not trivial.\n\n>> If you don't care about the code, but still want to know what the\n>> patch is doing, then you can look at the whole commit message, and \"We\n>> should free objects before leaving.\" explains that perfectly.\n>\n> The short message is what appears in \"What's Cooking\", why should I need\n> to break out of my mail client to find out what it means?\n\nYou don't, it's a trivial fix, and you said you have a certain level\nof trust on commit summaries ;)\n\n-- \nFelipe Contreras\n"},{"id":"220102","messageId":"20130609191518.GB12122@paksenarrion.iveqy.com","threadId":"34075","inReplyTo":"1370796057-25312-32-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v4 31/45] rebase: trivial cleanup","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-06-09T19:15:18Z","receivedAt":"2013-06-09T19:15:18Z","isPatch":true,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Sun, Jun 09, 2013 at 11:40:43AM -0500, Felipe Contreras wrote:\n> -\t\tgit_am_opt=\"$git_am_opt -q\"\n\nThis one makes me wonder a bit. I'm not sure about how this works in\ngit, so I would appriciate if someone can explain. I might also have\nmisunderstood something.\n\nHere we have two sh-scripts (git rebase\nand git am) interacting witch eachother. Both uses GIT_QUIET, so if\nGIT_QUIET already is set by the caller (git rebase) the callee doesn't\nhave to set it to.\n\nHowever GIT_QUIET is undocumented for git-am (in Git Manual). If we\ntranslate git am to C/ruby/python/perl/etc. will we catch this?\n\nThis raises a few more generall questions:\ndo we already pass information between processes(!) with enviroment\nvariables? And is this documented the way it should be?\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"220103","messageId":"CAMP44s0dNM2L7u=XPP82DnKFXmgC-kC6yeJYAgCPLeMEgJaH3A@mail.gmail.com","threadId":"34075","inReplyTo":"20130609190814.GA12122@paksenarrion.iveqy.com","subject":"Re: [PATCH v4 09/45] sequencer: remove useless indentation","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:16:29Z","receivedAt":"2013-06-09T19:16:29Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 2:08 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> On Sun, Jun 09, 2013 at 01:19:03PM -0500, Felipe Contreras wrote:\n>> The explains what the patch is doing, but not why. Why is more important.\n>\n> You're right. Why are the indentation useless? It doesn't seem to be\n> useless until you added goto. So why is your goto solution better than\n> the previous existing solution?\n\nBecause it removes useless indentation :)\n\nThis is what they do in the Linux kernel, you tell me which looks better:\n\na)\n\n\tif (function1())\n\t\tgoto leave;\n\tif (function2())\n\t\tgoto leave;\n\tif (function3())\n\t\tgoto leave;\n\tif (function4())\n\t\tgoto leave;\n\tgood_stuff();\nleave:\n\tfinal_stuff();\n\nor b)\n\n\tif (!function1()) {\n\t\tif (!function2()) {\n\t\t\tif (!function3()) {\n\t\t\t\tif (!function4()) {\n\t\t\t\t\tgood_stuff();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfinal_stuff();\n\n-- \nFelipe Contreras\n"},{"id":"220106","messageId":"20130609192050.GD2091@goldbirke","threadId":"34075","inReplyTo":"CAMP44s15nxOmZb4L5qGJ1+6dy0DkUTnCq6u=SRJgqO18tK-H4Q@mail.gmail.com","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2013-06-09T19:20:50Z","receivedAt":"2013-06-09T19:20:50Z","isPatch":true,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sun, Jun 09, 2013 at 02:11:18PM -0500, Felipe Contreras wrote:\n> Perhaps \"trivial memory leak fix\" would be better.\n\nThat's fine with me, thanks.\n\nIf only we could have got there like 10 emails ago.\n\n\nGábor\n"},{"id":"220104","messageId":"20130609192143.GC12122@paksenarrion.iveqy.com","threadId":"34075","inReplyTo":"1370796057-25312-12-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v4 11/45] cherry-pick: don't barf when there's nothing to do","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-06-09T19:21:43Z","receivedAt":"2013-06-09T19:21:43Z","isPatch":true,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Sun, Jun 09, 2013 at 11:40:23AM -0500, Felipe Contreras wrote:\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  builtin/sequencer.c             | 4 ++--\n>  t/t3510-cherry-pick-sequence.sh | 2 +-\n>  2 files changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/builtin/sequencer.c b/builtin/sequencer.c\n> index 23b01b7..4d7dc8b 100644\n> --- a/builtin/sequencer.c\n> +++ b/builtin/sequencer.c\n> @@ -565,8 +565,8 @@ static void prepare_revs(struct replay_opts *opts)\n>  \tif (prepare_revision_walk(opts->revs))\n>  \t\tdie(_(\"revision walk setup failed\"));\n>  \n> -\tif (!opts->revs->commits)\n> -\t\tdie(_(\"empty commit set passed\"));\n> +\tif (!opts->revs->commits && !opts->quiet)\n> +\t\terror(_(\"empty commit set passed\"));\n>  }\n>  \n>  static void read_and_refresh_cache(struct replay_opts *opts)\n> diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\n> index 7b7a89d..33c5512 100755\n> --- a/t/t3510-cherry-pick-sequence.sh\n> +++ b/t/t3510-cherry-pick-sequence.sh\n> @@ -472,7 +472,7 @@ test_expect_success 'malformed instruction sheet 2' '\n>  \n>  test_expect_success 'empty commit set' '\n>  \tpristine_detach initial &&\n> -\ttest_expect_code 128 git cherry-pick base..base\n> +\tgit cherry-pick base..base\n\nShouldn't this result in the error \"empty commit set passed\"? If so,\nshouldn't that be checked to actually print that error?\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"220147","messageId":"CAMP44s1we+wVc6pwNFr+CxusEKp+yLswZKCL8RCiw4PVbA1ahw@mail.gmail.com","threadId":"34075","inReplyTo":"20130609192143.GC12122@paksenarrion.iveqy.com","subject":"Re: [PATCH v4 11/45] cherry-pick: don't barf when there's nothing to do","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:32:53Z","receivedAt":"2013-06-09T19:32:53Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Sun, Jun 9, 2013 at 2:21 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> On Sun, Jun 09, 2013 at 11:40:23AM -0500, Felipe Contreras wrote:\n>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>> ---\n>>  builtin/sequencer.c             | 4 ++--\n>>  t/t3510-cherry-pick-sequence.sh | 2 +-\n>>  2 files changed, 3 insertions(+), 3 deletions(-)\n>>\n>> diff --git a/builtin/sequencer.c b/builtin/sequencer.c\n>> index 23b01b7..4d7dc8b 100644\n>> --- a/builtin/sequencer.c\n>> +++ b/builtin/sequencer.c\n>> @@ -565,8 +565,8 @@ static void prepare_revs(struct replay_opts *opts)\n>>       if (prepare_revision_walk(opts->revs))\n>>               die(_(\"revision walk setup failed\"));\n>>\n>> -     if (!opts->revs->commits)\n>> -             die(_(\"empty commit set passed\"));\n>> +     if (!opts->revs->commits && !opts->quiet)\n>> +             error(_(\"empty commit set passed\"));\n>>  }\n>>\n>>  static void read_and_refresh_cache(struct replay_opts *opts)\n>> diff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\n>> index 7b7a89d..33c5512 100755\n>> --- a/t/t3510-cherry-pick-sequence.sh\n>> +++ b/t/t3510-cherry-pick-sequence.sh\n>> @@ -472,7 +472,7 @@ test_expect_success 'malformed instruction sheet 2' '\n>>\n>>  test_expect_success 'empty commit set' '\n>>       pristine_detach initial &&\n>> -     test_expect_code 128 git cherry-pick base..base\n>> +     git cherry-pick base..base\n>\n> Shouldn't this result in the error \"empty commit set passed\"? If so,\n> shouldn't that be checked to actually print that error?\n\nProbably, yeah.\n\n-- \nFelipe Contreras\n"},{"id":"220155","messageId":"20130609194850.GD12122@paksenarrion.iveqy.com","threadId":"34075","inReplyTo":"CAMP44s0dNM2L7u=XPP82DnKFXmgC-kC6yeJYAgCPLeMEgJaH3A@mail.gmail.com","subject":"Re: [PATCH v4 09/45] sequencer: remove useless indentation","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-06-09T19:48:50Z","receivedAt":"2013-06-09T19:48:50Z","isPatch":true,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Sun, Jun 09, 2013 at 02:16:29PM -0500, Felipe Contreras wrote:\n> On Sun, Jun 9, 2013 at 2:08 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> > On Sun, Jun 09, 2013 at 01:19:03PM -0500, Felipe Contreras wrote:\n> >> The explains what the patch is doing, but not why. Why is more important.\n> >\n> > You're right. Why are the indentation useless? It doesn't seem to be\n> > useless until you added goto. So why is your goto solution better than\n> > the previous existing solution?\n> \n> Because it removes useless indentation :)\n> \n> This is what they do in the Linux kernel, you tell me which looks better:\n> \n> a)\n> \n> \tif (function1())\n> \t\tgoto leave;\n> \tif (function2())\n> \t\tgoto leave;\n> \tif (function3())\n> \t\tgoto leave;\n> \tif (function4())\n> \t\tgoto leave;\n> \tgood_stuff();\n> leave:\n> \tfinal_stuff();\n> \n> or b)\n> \n> \tif (!function1()) {\n> \t\tif (!function2()) {\n> \t\t\tif (!function3()) {\n> \t\t\t\tif (!function4()) {\n> \t\t\t\t\tgood_stuff();\n> \t\t\t\t}\n> \t\t\t}\n> \t\t}\n> \t}\n> \tfinal_stuff();\n> \n> -- \n> Felipe Contreras\n\nOh, so this is purely a \"this code style is better than the current\ncode style\"-patch? I won't argue with that. I simply trust Junio in such\ncases, I had such discussions with him before.\n\nI thought it was partly to increase cleanup capabilities to. For\nexample, why isn't msg and defmsg freed when \"return allow\"?\n\nStill wonder about introducing a new label name for cleanup.\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"220167","messageId":"AD9D4E5DA7694BF297CDE2DA871CB3B6@PhilipOakley","threadId":"34075","inReplyTo":"CAMP44s3yhVbgkhtrSfHpk=VwcwMkb66ELA-xR0i6FCVGyRwHJw@mail.gmail.com","subject":"Re: [PATCH v4 10/45] sequencer: trivial fix","fromName":"Philip Oakley","fromEmail":"philipoakley@iee.org","sentAt":"2013-06-09T21:09:23Z","receivedAt":"2013-06-09T21:09:23Z","isPatch":true,"sender":{"key":"philipoakley@iee.email","avatar":"https://avatars.githubusercontent.com/u/914343?v=4"},"body":"From: \"Felipe Contreras\" <felipe.contreras@gmail.com>\nSent: Sunday, June 09, 2013 6:23 PM\n> On Sun, Jun 9, 2013 at 12:18 PM, SZEDER Gábor <szeder@ira.uka.de> \n> wrote:\n>> On Sun, Jun 09, 2013 at 11:40:22AM -0500, Felipe Contreras wrote:\n>>> We should free objects before leaving.\n>>>\n>>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>>\n>> A shortlog-friendlier subject could be: \"sequencer: free objects\n>> before leaving\".\n>\n> I already defended my rationale for this succinct commit message:\n>\n> http://thread.gmane.org/gmane.comp.version-control.git/225609/focus=225610\n>\n> -- \n> Felipe Contreras\n\nI think I'd prefer a mixture of both.\n\n\"sequencer: trivial fix: free objects before leaving\".\nThis gives the best of both worlds in that the 'triviality' is plainly \nthere to see, and so is the type of triviality, just in case it has some \nun-noticed side effect that someone is looking for at a leter date\n\nSame goes for \"build: trivial cleanup: don't repeat prerequisites\" \n[PATCH v4 03/45]\n\nAll the best,\n\nPhilip\n"},{"id":"220410","messageId":"CANiSa6iFYgkgXJ9SdkiOJc-iwfCxfsoU+Nfs5hjhx45Am=kixw@mail.gmail.com","threadId":"34075","inReplyTo":"1370796057-25312-46-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v4 45/45] tests: update topology tests","fromName":"Martin von Zweigbergk","fromEmail":"martinvonz@gmail.com","sentAt":"2013-06-11T04:37:59Z","receivedAt":"2013-06-11T04:37:59Z","isPatch":true,"sender":{"key":"martinvonz@gmail.com","avatar":"https://avatars.githubusercontent.com/u/891642?v=4"},"body":"On Sun, Jun 9, 2013 at 9:40 AM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n> ---\n>  t/t3425-rebase-topology-merges.sh | 15 ++++++---------\n>  1 file changed, 6 insertions(+), 9 deletions(-)\n>\n> diff --git a/t/t3425-rebase-topology-merges.sh b/t/t3425-rebase-topology-merges.sh\n> index 5400a05..96cc479 100755\n> --- a/t/t3425-rebase-topology-merges.sh\n> +++ b/t/t3425-rebase-topology-merges.sh\n> @@ -70,9 +70,8 @@ test_run_rebase () {\n>                 test_linear_range \"\\'\"$expected\"\\'\" d..\n>         \"\n>  }\n> -#TODO: make order consistent across all flavors of rebase\n> -test_run_rebase success 'e n o' ''\n> -test_run_rebase success 'e n o' -m\n> +test_run_rebase success 'n o e' ''\n> +test_run_rebase success 'n o e' -m\n>  test_run_rebase success 'n o e' -i\n\nIf you do end up re-sending the series on top of my series, I'd prefer\nto see the end result having the first argument inlined, so these few\nlines become simply:\n\ntest_run_rebase success ''\ntest_run_rebase success -m\ntest_run_rebase success -i\n"},{"id":"220412","messageId":"CAMP44s27ZRpUuEvt8DZyzqoB5AovEkM1HMPEi-kxpZg9STsU4g@mail.gmail.com","threadId":"34075","inReplyTo":"CANiSa6iFYgkgXJ9SdkiOJc-iwfCxfsoU+Nfs5hjhx45Am=kixw@mail.gmail.com","subject":"Re: [PATCH v4 45/45] tests: update topology tests","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-11T04:41:47Z","receivedAt":"2013-06-11T04:41:47Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Jun 10, 2013 at 11:37 PM, Martin von Zweigbergk\n<martinvonz@gmail.com> wrote:\n> On Sun, Jun 9, 2013 at 9:40 AM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>\n>> ---\n>>  t/t3425-rebase-topology-merges.sh | 15 ++++++---------\n>>  1 file changed, 6 insertions(+), 9 deletions(-)\n>>\n>> diff --git a/t/t3425-rebase-topology-merges.sh b/t/t3425-rebase-topology-merges.sh\n>> index 5400a05..96cc479 100755\n>> --- a/t/t3425-rebase-topology-merges.sh\n>> +++ b/t/t3425-rebase-topology-merges.sh\n>> @@ -70,9 +70,8 @@ test_run_rebase () {\n>>                 test_linear_range \"\\'\"$expected\"\\'\" d..\n>>         \"\n>>  }\n>> -#TODO: make order consistent across all flavors of rebase\n>> -test_run_rebase success 'e n o' ''\n>> -test_run_rebase success 'e n o' -m\n>> +test_run_rebase success 'n o e' ''\n>> +test_run_rebase success 'n o e' -m\n>>  test_run_rebase success 'n o e' -i\n>\n> If you do end up re-sending the series on top of my series, I'd prefer\n> to see the end result having the first argument inlined, so these few\n> lines become simply:\n\nSomebody else would need to do that, there's no point in me sending\nthese patches, just to increase the number of my patches that get\ncompletely ignored by Junio.\n\n-- \nFelipe Contreras\n"},{"id":"220454","messageId":"7vhah4d3sk.fsf@alter.siamese.dyndns.org","threadId":"34075","inReplyTo":"20130609191518.GB12122@paksenarrion.iveqy.com","subject":"Re: [PATCH v4 31/45] rebase: trivial cleanup","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-11T16:12:59Z","receivedAt":"2013-06-11T16:12:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Fredrik Gustafsson <iveqy@iveqy.com> writes:\n\n> Here we have two sh-scripts (git rebase\n> and git am) interacting with each other.\n> Both uses GIT_QUIET,\n\nCorrect.\n\n> so if GIT_QUIET already is set by the caller (git rebase) the\n> callee doesn't have to set it to.\n\nIncorrect.  \"git rebase\" invokes \"git am\", not dot-sources it, so it\ndoes not propagate.\n\nBoth do dot-source git-sh-setup, which clears GIT_QUIET pretty\nearly, so even GIT_QUIET exported into the environment by mistake\nwill not affect them.\n\n> However GIT_QUIET is undocumented for git-am (in Git Manual). If we\n> translate git am to C/ruby/python/perl/etc. will we catch this?\n\nI think it is irrelevant.  git-am uses many shell variables,\ne.g. HAS_HEAD, interactive, abort_safety, etc. but they are\nimplementation details of the program and there is no point\ndocumenting it, and somebody rewriting it in C does not have to\nstick to the same name.\n\nWhat may deserve to be documented in Documentation/technical/\nsomewhere is the way how some shell variables (OPTIONS_SPEC,\nOPTIONS_KEEPDASHDASH, LONG_USAGE, USAGE, GIT_REFLOG_ACTION, etc.)\nare used in git-sh-setup, which is a collection of helper shell\nfunctions for use in scripted Porcelains that dot-source it.  It\nallows the scripted Porcelains to say things like:\n\n\tdie \"message\"\n        say \"message\"\n\nand the latter pays attention to GIT_QUIET.\n\n> This raises a few more generall questions:\n> do we already pass information between processes(!) with enviroment\n> variables? And is this documented the way it should be?\n\nThere are a few used as implementation details, I think.  GIT_QUIET\nis not among them.\n"},{"id":"220461","messageId":"20130611170815.GA20009@paksenarrion.iveqy.com","threadId":"34075","inReplyTo":"7vhah4d3sk.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4 31/45] rebase: trivial cleanup","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-06-11T17:08:15Z","receivedAt":"2013-06-11T17:08:15Z","isPatch":true,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"Thank you for your reply. Although I agree with everything you say, it\nraised a few more questions.\n\nOn Tue, Jun 11, 2013 at 09:12:59AM -0700, Junio C Hamano wrote:\n> Incorrect.  \"git rebase\" invokes \"git am\", not dot-sources it, so it\n> does not propagate.\n\nThen git am wouldn't be quite and this patch is doing wrong by removing\nthe -q argument from the git am invokation. Correct?\n\n> I think it is irrelevant.  git-am uses many shell variables,\n> e.g. HAS_HEAD, interactive, abort_safety, etc. but they are\n> implementation details of the program and there is no point\n> documenting it, and somebody rewriting it in C does not have to\n> stick to the same name.\n\n<--snip-->\n\n> There are a few used as implementation details, I think.  GIT_QUIET\n> is not among them.\n\nI made a mistake here thinking that git rebase set an enviromental\nvariable that git am later red. That would have been a way to\ncommunicate, that the first processes that got the -q argument sets the\nenviromental variabel GIT_QUIET and all other git invokations read that\nenviromental variable.\n\nI do not like that solution. When communicating between different git\ncommands I prefer, pipes, files and command line arguments. I think it\nwill be dangerous to include temporary enviromental variables (if we\ndon't stick to a few of them and document them very well).\n\nIn the case of passing information with temporary enviromental variables\nit's no longer an implementation detail, but something a rewrite needs\nto honor.\n\nI hope I was able to make myself somewhat clear, and if I understand you\ncorrectly we are already agreeing on this?\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"220464","messageId":"CAMP44s0VksnZmi21u6T79AvMebWA3gXmWbQ6pp=FAHL=D4q6+Q@mail.gmail.com","threadId":"34075","inReplyTo":"20130611170815.GA20009@paksenarrion.iveqy.com","subject":"Re: [PATCH v4 31/45] rebase: trivial cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-11T17:09:32Z","receivedAt":"2013-06-11T17:09:32Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Jun 11, 2013 at 12:08 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> Thank you for your reply. Although I agree with everything you say, it\n> raised a few more questions.\n>\n> On Tue, Jun 11, 2013 at 09:12:59AM -0700, Junio C Hamano wrote:\n>> Incorrect.  \"git rebase\" invokes \"git am\", not dot-sources it, so it\n>> does not propagate.\n>\n> Then git am wouldn't be quite and this patch is doing wrong by removing\n> the -q argument from the git am invokation. Correct?\n\nIt's not removed. It's simply moved.\n\n-- \nFelipe Contreras\n"},{"id":"220466","messageId":"20130611172416.GB20009@paksenarrion.iveqy.com","threadId":"34075","inReplyTo":"CAMP44s0VksnZmi21u6T79AvMebWA3gXmWbQ6pp=FAHL=D4q6+Q@mail.gmail.com","subject":"Re: [PATCH v4 31/45] rebase: trivial cleanup","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-06-11T17:24:16Z","receivedAt":"2013-06-11T17:24:16Z","isPatch":true,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Tue, Jun 11, 2013 at 12:09:32PM -0500, Felipe Contreras wrote:\n> It's not removed. It's simply moved.\n\nSorry about that, I wasn't paying enough attention. But why are you\nmoving it?\n\nAll other arguments to git am is set in git-rebase.sh, why just set\n-q just before the invokation in git-rebase--am.sh?\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"220468","messageId":"CAMP44s3OG2MSO=zwAvzTnTLYOJmhsmbjrVJOxP-0ZSaxgMuUXA@mail.gmail.com","threadId":"34075","inReplyTo":"20130611172416.GB20009@paksenarrion.iveqy.com","subject":"Re: [PATCH v4 31/45] rebase: trivial cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-11T17:26:42Z","receivedAt":"2013-06-11T17:26:42Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Jun 11, 2013 at 12:24 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> On Tue, Jun 11, 2013 at 12:09:32PM -0500, Felipe Contreras wrote:\n>> It's not removed. It's simply moved.\n>\n> Sorry about that, I wasn't paying enough attention. But why are you\n> moving it?\n>\n> All other arguments to git am is set in git-rebase.sh, why just set\n> -q just before the invokation in git-rebase--am.sh?\n\nBecause the next patch checks if there's any arguments meant for 'git\nam' to switch to am rebase mode. We shouldn't switch to that mode if\nthe only argument to 'git am' is going to be -q.\n\n-- \nFelipe Contreras\n"},{"id":"220471","messageId":"20130611174111.GA22235@paksenarrion.iveqy.com","threadId":"34075","inReplyTo":"CAMP44s3OG2MSO=zwAvzTnTLYOJmhsmbjrVJOxP-0ZSaxgMuUXA@mail.gmail.com","subject":"Re: [PATCH v4 31/45] rebase: trivial cleanup","fromName":"Fredrik Gustafsson","fromEmail":"iveqy@iveqy.com","sentAt":"2013-06-11T17:41:11Z","receivedAt":"2013-06-11T17:41:11Z","isPatch":true,"sender":{"key":"iveqy@iveqy.com","avatar":"https://avatars.githubusercontent.com/u/761743?v=4"},"body":"On Tue, Jun 11, 2013 at 12:26:42PM -0500, Felipe Contreras wrote:\n> On Tue, Jun 11, 2013 at 12:24 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> > On Tue, Jun 11, 2013 at 12:09:32PM -0500, Felipe Contreras wrote:\n> >> It's not removed. It's simply moved.\n> >\n> > Sorry about that, I wasn't paying enough attention. But why are you\n> > moving it?\n> >\n> > All other arguments to git am is set in git-rebase.sh, why just set\n> > -q just before the invokation in git-rebase--am.sh?\n> \n> Because the next patch checks if there's any arguments meant for 'git\n> am' to switch to am rebase mode. We shouldn't switch to that mode if\n> the only argument to 'git am' is going to be -q.\n\nOkay, that make sense. How about rephrase the commit message and add\nthis explanation. It's really not a cleanup but a preparation for the\nnext patch.\n\nIf I was a maintainer and only got this patch I would reject it. Every\npatch in a patch serie should be justified to be applied as a single\npatch, yes?\n\n-- \nMed vänliga hälsningar\nFredrik Gustafsson\n\ntel: 0733-608274\ne-post: iveqy@iveqy.com\n"},{"id":"220473","messageId":"CAMP44s3xpLtH5g5iZMi-A4P7MhE6xmb156f0ENFd851SHcpepg@mail.gmail.com","threadId":"34075","inReplyTo":"20130611174111.GA22235@paksenarrion.iveqy.com","subject":"Re: [PATCH v4 31/45] rebase: trivial cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-11T17:42:20Z","receivedAt":"2013-06-11T17:42:20Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Tue, Jun 11, 2013 at 12:41 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n> On Tue, Jun 11, 2013 at 12:26:42PM -0500, Felipe Contreras wrote:\n>> On Tue, Jun 11, 2013 at 12:24 PM, Fredrik Gustafsson <iveqy@iveqy.com> wrote:\n>> > On Tue, Jun 11, 2013 at 12:09:32PM -0500, Felipe Contreras wrote:\n>> >> It's not removed. It's simply moved.\n>> >\n>> > Sorry about that, I wasn't paying enough attention. But why are you\n>> > moving it?\n>> >\n>> > All other arguments to git am is set in git-rebase.sh, why just set\n>> > -q just before the invokation in git-rebase--am.sh?\n>>\n>> Because the next patch checks if there's any arguments meant for 'git\n>> am' to switch to am rebase mode. We shouldn't switch to that mode if\n>> the only argument to 'git am' is going to be -q.\n>\n> Okay, that make sense. How about rephrase the commit message and add\n> this explanation. It's really not a cleanup but a preparation for the\n> next patch.\n>\n> If I was a maintainer and only got this patch I would reject it. Every\n> patch in a patch serie should be justified to be applied as a single\n> patch, yes?\n\nYes, but it doesn't matter, because the maintainer has made it clear\nhe is not going to even read this patch series.\n\n-- \nFelipe Contreras\n"}]}