{"thread":{"id":"34079","subject":"[PATCH v5 00/36] Massive improvents to rebase and cherry-pick","startedAt":"2013-06-09T19:24:14Z","lastAt":"2013-06-11T03:52:21Z","messageCount":42,"participants":["Felipe Contreras","Phil Hord"],"isPatch":true,"patchVersion":5,"patchTotal":36},"messages":[{"id":"220108","messageId":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":null,"subject":"[PATCH v5 00/36] Massive improvents to rebase and cherry-pick","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:14Z","receivedAt":"2013-06-09T19:24:14Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Same as before, but:\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 7fd4035..d72d2d2 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1679,11 +1679,10 @@ GIT_NOTES_REF) is also implicitly added to the list of refs to be\n displayed.\n \n notes.rewrite.<command>::\n-\tWhen rewriting commits with <command> (currently `amend` or\n-\t`rebase`) and this variable is set to `true`, Git\n-\tautomatically copies your notes from the original to the\n-\trewritten commit.  Defaults to `true`, but see\n-\t\"notes.rewriteRef\" below.\n+\tWhen rewriting commits with <command> (currently `amend`, `rebase`, or\n+\t`cherry-pick`) and this variable is set to `true`, Git automatically\n+\tcopies your notes from the original to the rewritten commit.  Defaults\n+\tto `true`, but see \"notes.rewriteRef\" below.\n \n notes.rewriteMode::\n \tWhen copying notes during a rewrite (see the\ndiff --git a/Documentation/githooks.txt b/Documentation/githooks.txt\nindex d48bf4d..8cfa13b 100644\n--- a/Documentation/githooks.txt\n+++ b/Documentation/githooks.txt\n@@ -352,10 +352,10 @@ post-rewrite\n ~~~~~~~~~~~~\n \n This hook is invoked by commands that rewrite commits (`git commit\n---amend`, 'git-rebase'; currently 'git-filter-branch' does 'not' call\n-it!).  Its first argument denotes the command it was invoked by:\n-currently one of `amend` or `rebase`.  Further command-dependent\n-arguments may be passed in the future.\n+--amend`, `git rebase`, `git cherry-pick`; currently `git filter-branch` does\n+'not' call it!).  Its first argument denotes the command it was invoked by\n+(e.g. `rebase`).  Further command-dependent arguments may be passed in the\n+future.\n \n The hook receives a list of the rewritten commits on stdin, in the\n format\ndiff --git a/builtin/sequencer.c b/builtin/sequencer.c\nindex ddd369f..f805883 100644\n--- a/builtin/sequencer.c\n+++ b/builtin/sequencer.c\n@@ -33,8 +33,8 @@ static void finish(struct replay_opts *opts)\n \tif (!*name)\n \t\treturn;\n \n-\trun_rewrite_hook(&rewritten, name);\n \tcopy_rewrite_notes(&rewritten, name);\n+\trun_rewrite_hook(&rewritten, name);\n }\n \n static void remove_sequencer_state(void)\n\nFelipe Contreras (36):\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\n .gitignore                             |   1 +\n Documentation/config.txt               |   9 +-\n Documentation/git-cherry-pick.txt      |  10 +-\n Documentation/git-revert.txt           |   7 +-\n Documentation/githooks.txt             |   8 +-\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/t3406-rebase-message.sh              |  15 --\n t/t3407-rebase-abort.sh                |   2 +-\n t/t3420-rebase-autostash.sh            |   2 +-\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 31 files changed, 608 insertions(+), 426 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\n-- \n1.8.3.698.g079b096\n"},{"id":"220109","messageId":"1370805890-3453-2-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 01/36] build: generate and clean test scripts","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:15Z","receivedAt":"2013-06-09T19:24:15Z","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":"220111","messageId":"1370805890-3453-3-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 02/36] build: do not install git-remote-testgit","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:16Z","receivedAt":"2013-06-09T19:24: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 | 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":"220112","messageId":"1370805890-3453-4-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 03/36] build: trivial cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:17Z","receivedAt":"2013-06-09T19:24:17Z","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":"220114","messageId":"1370805890-3453-5-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 04/36] build: add builtin lib","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:18Z","receivedAt":"2013-06-09T19:24:18Z","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":"220113","messageId":"1370805890-3453-6-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 05/36] log-tree: remove dependency from sequencer","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:19Z","receivedAt":"2013-06-09T19:24:19Z","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":"220115","messageId":"1370805890-3453-7-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 06/36] Move sequencer to builtin","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:20Z","receivedAt":"2013-06-09T19:24:20Z","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":"220116","messageId":"1370805890-3453-8-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 07/36] unpack-trees: plug a memory leak","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:21Z","receivedAt":"2013-06-09T19:24:21Z","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":"220145","messageId":"1370805890-3453-9-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 08/36] read-cache: plug a few leaks","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:22Z","receivedAt":"2013-06-09T19:24:22Z","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":"220144","messageId":"1370805890-3453-10-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 09/36] sequencer: remove useless indentation","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:23Z","receivedAt":"2013-06-09T19:24:23Z","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":"220117","messageId":"1370805890-3453-11-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 10/36] sequencer: trivial fix","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:24Z","receivedAt":"2013-06-09T19:24:24Z","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":"220118","messageId":"1370805890-3453-12-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 11/36] cherry-pick: don't barf when there's nothing to do","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:25Z","receivedAt":"2013-06-09T19:24: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 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":"220119","messageId":"1370805890-3453-13-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 12/36] cherry-pick: add --skip-empty option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:26Z","receivedAt":"2013-06-09T19:24:26Z","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":"220120","messageId":"1370805890-3453-14-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 13/36] revert/cherry-pick: add --quiet option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:27Z","receivedAt":"2013-06-09T19:24:27Z","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":"220121","messageId":"1370805890-3453-15-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 14/36] revert/cherry-pick: add --skip option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:28Z","receivedAt":"2013-06-09T19:24:28Z","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":"220122","messageId":"1370805890-3453-16-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 15/36] builtin: add rewrite helper","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:29Z","receivedAt":"2013-06-09T19:24:29Z","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":"220124","messageId":"1370805890-3453-17-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 16/36] cherry-pick: store rewritten commits","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:30Z","receivedAt":"2013-06-09T19:24:30Z","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":"220123","messageId":"1370805890-3453-18-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 17/36] cherry-pick: don't store skipped commit","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:31Z","receivedAt":"2013-06-09T19:24:31Z","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":"220125","messageId":"1370805890-3453-19-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 18/36] builtin: move run_rewrite_hook() to rewrite.c","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:32Z","receivedAt":"2013-06-09T19:24:32Z","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":"220126","messageId":"1370805890-3453-20-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 19/36] builtin: add copy_rewrite_notes()","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:33Z","receivedAt":"2013-06-09T19:24:33Z","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":"220129","messageId":"1370805890-3453-21-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 20/36] cherry-pick: copy notes and run hooks","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:34Z","receivedAt":"2013-06-09T19:24: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 Documentation/config.txt   |  9 ++++-----\n Documentation/githooks.txt |  8 ++++----\n builtin/rewrite.c          |  1 +\n builtin/sequencer.c        | 18 +++++++++++++++++-\n 4 files changed, 26 insertions(+), 10 deletions(-)\n\ndiff --git a/Documentation/config.txt b/Documentation/config.txt\nindex 7fd4035..d72d2d2 100644\n--- a/Documentation/config.txt\n+++ b/Documentation/config.txt\n@@ -1679,11 +1679,10 @@ GIT_NOTES_REF) is also implicitly added to the list of refs to be\n displayed.\n \n notes.rewrite.<command>::\n-\tWhen rewriting commits with <command> (currently `amend` or\n-\t`rebase`) and this variable is set to `true`, Git\n-\tautomatically copies your notes from the original to the\n-\trewritten commit.  Defaults to `true`, but see\n-\t\"notes.rewriteRef\" below.\n+\tWhen rewriting commits with <command> (currently `amend`, `rebase`, or\n+\t`cherry-pick`) and this variable is set to `true`, Git automatically\n+\tcopies your notes from the original to the rewritten commit.  Defaults\n+\tto `true`, but see \"notes.rewriteRef\" below.\n \n notes.rewriteMode::\n \tWhen copying notes during a rewrite (see the\ndiff --git a/Documentation/githooks.txt b/Documentation/githooks.txt\nindex d48bf4d..8cfa13b 100644\n--- a/Documentation/githooks.txt\n+++ b/Documentation/githooks.txt\n@@ -352,10 +352,10 @@ post-rewrite\n ~~~~~~~~~~~~\n \n This hook is invoked by commands that rewrite commits (`git commit\n---amend`, 'git-rebase'; currently 'git-filter-branch' does 'not' call\n-it!).  Its first argument denotes the command it was invoked by:\n-currently one of `amend` or `rebase`.  Further command-dependent\n-arguments may be passed in the future.\n+--amend`, `git rebase`, `git cherry-pick`; currently `git filter-branch` does\n+'not' call it!).  Its first argument denotes the command it was invoked by\n+(e.g. `rebase`).  Further command-dependent arguments may be passed in the\n+future.\n \n The hook receives a list of the rewritten commits on stdin, in the\n format\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..c87008e 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+\tcopy_rewrite_notes(&rewritten, \"cherry-pick\");\n+\trun_rewrite_hook(&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":"220127","messageId":"1370805890-3453-22-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 21/36] cherry-pick: add --action-name option","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:35Z","receivedAt":"2013-06-09T19:24:35Z","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 c87008e..3fec505 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-\tcopy_rewrite_notes(&rewritten, \"cherry-pick\");\n-\trun_rewrite_hook(&rewritten, \"cherry-pick\");\n+\tname = opts->action_name ? opts->action_name : \"cherry-pick\";\n+\n+\tif (!*name)\n+\t\treturn;\n+\n+\tcopy_rewrite_notes(&rewritten, name);\n+\trun_rewrite_hook(&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":"220128","messageId":"1370805890-3453-23-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 22/36] cherry-pick: remember rerere-autoupdate","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:36Z","receivedAt":"2013-06-09T19:24:36Z","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 3fec505..f805883 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":"220130","messageId":"1370805890-3453-24-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 23/36] rebase: split the cherry-pick stuff","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:37Z","receivedAt":"2013-06-09T19:24:37Z","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":"220131","messageId":"1370805890-3453-25-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 24/36] rebase: cherry-pick: fix mode storage","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:38Z","receivedAt":"2013-06-09T19:24:38Z","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":"220134","messageId":"1370805890-3453-26-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 25/36] rebase: cherry-pick: fix sequence continuation","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:39Z","receivedAt":"2013-06-09T19:24:39Z","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":"220132","messageId":"1370805890-3453-27-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 26/36] rebase: cherry-pick: fix abort of cherry mode","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:40Z","receivedAt":"2013-06-09T19:24: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.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":"220136","messageId":"1370805890-3453-28-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 27/36] rebase: cherry-pick: fix command invocations","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:41Z","receivedAt":"2013-06-09T19:24:41Z","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":"220135","messageId":"1370805890-3453-29-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 28/36] rebase: cherry-pick: fix status messages","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:42Z","receivedAt":"2013-06-09T19:24: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 | 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":"220133","messageId":"1370805890-3453-30-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 29/36] rebase: cherry-pick: automatically commit stage","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:43Z","receivedAt":"2013-06-09T19:24:43Z","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":"220138","messageId":"1370805890-3453-31-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 30/36] rebase: cherry-pick: set correct action-name","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:44Z","receivedAt":"2013-06-09T19:24:44Z","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":"220137","messageId":"1370805890-3453-32-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 31/36] rebase: trivial cleanup","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:45Z","receivedAt":"2013-06-09T19:24: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 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":"220139","messageId":"1370805890-3453-33-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 32/36] rebase: use 'cherrypick' mode instead of 'am'","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:46Z","receivedAt":"2013-06-09T19:24:46Z","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":"220143","messageId":"1370805890-3453-34-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 33/36] rebase: cherry-pick: fix for shell prompt","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:47Z","receivedAt":"2013-06-09T19:24:47Z","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":"220140","messageId":"1370805890-3453-35-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 34/36] rebase: cherry-pick: add merge options","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:48Z","receivedAt":"2013-06-09T19:24:48Z","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":"220142","messageId":"1370805890-3453-36-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 35/36] rebase: remove merge mode","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:49Z","receivedAt":"2013-06-09T19:24:49Z","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":"220141","messageId":"1370805890-3453-37-git-send-email-felipe.contreras@gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"[PATCH v5 36/36] rebase: cherry-pick: add copyright","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:24:50Z","receivedAt":"2013-06-09T19:24:50Z","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":"220149","messageId":"CAMP44s2nbo97qFenwm3RaHYQ4K14knZpSvpLPPM3uPiFSRinuQ@mail.gmail.com","threadId":"34079","inReplyTo":"1370805890-3453-1-git-send-email-felipe.contreras@gmail.com","subject":"Re: [PATCH v5 00/36] Massive improvents to rebase and cherry-pick","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-09T19:37:44Z","receivedAt":"2013-06-09T19:37:44Z","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:24 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n> Same as before, but:\n\nAlso, remove the patches from Martin von Zweigbergk, because\napparently some people have trouble understanding that they were not\npart of this series.\n\n-- \nFelipe Contreras\n"},{"id":"220396","messageId":"CABURp0p7axsFHRLpXBCAZaMpeE1Ae5N1wNugEe3vsHCtX6_7EQ@mail.gmail.com","threadId":"34079","inReplyTo":"CAMP44s2nbo97qFenwm3RaHYQ4K14knZpSvpLPPM3uPiFSRinuQ@mail.gmail.com","subject":"Re: [PATCH v5 00/36] Massive improvents to rebase and cherry-pick","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2013-06-10T22:55:45Z","receivedAt":"2013-06-10T22:55:45Z","isPatch":true,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"On Sun, Jun 9, 2013 at 3:37 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n>\n> On Sun, Jun 9, 2013 at 2:24 PM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n> > Same as before, but:\n>\n> Also, remove the patches from Martin von Zweigbergk, because\n> apparently some people have trouble understanding that they were not\n> part of this series.\n\n\nPlease try not to sound disgruntled. This attitude is toxic. You have\nturned this change into a complaint: that \"some people have trouble\nunderstanding\" which shows a genuine lack of understanding and\ncompassion on your part.  Instead you can phrase your change notes\nmore helpfully if you make changes only when you yourself actually\nbelieve the change should be made.  If you cannot do this, perhaps you\ncan pretend.\n\n  Also, remove the patches from Martin von Zweigbergk, which\n  are not a part of this series.\n\nOr even this:\n\n  Also, remove the patches from Martin von Zweigbergk to avoid\n  confusing reviewers.\n\nThanks,\nPhil\n"},{"id":"220402","messageId":"CAMP44s10T55_OBQrzXg6jwPrtJh_J9dJnTfDKJhkUc_oCm_cOA@mail.gmail.com","threadId":"34079","inReplyTo":"CABURp0p7axsFHRLpXBCAZaMpeE1Ae5N1wNugEe3vsHCtX6_7EQ@mail.gmail.com","subject":"Re: [PATCH v5 00/36] Massive improvents to rebase and cherry-pick","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-10T23:43:55Z","receivedAt":"2013-06-10T23:43:55Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Jun 10, 2013 at 5:55 PM, Phil Hord <phil.hord@gmail.com> wrote:\n> On Sun, Jun 9, 2013 at 3:37 PM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n>>\n>> On Sun, Jun 9, 2013 at 2:24 PM, Felipe Contreras\n>> <felipe.contreras@gmail.com> wrote:\n>> > Same as before, but:\n>>\n>> Also, remove the patches from Martin von Zweigbergk, because\n>> apparently some people have trouble understanding that they were not\n>> part of this series.\n>\n> Please try not to sound disgruntled. This attitude is toxic. You have\n> turned this change into a complaint: that \"some people have trouble\n> understanding\" which shows a genuine lack of understanding and\n> compassion on your part.  Instead you can phrase your change notes\n> more helpfully if you make changes only when you yourself actually\n> believe the change should be made.  If you cannot do this, perhaps you\n> can pretend.\n\nThat would be dishonest. Moreover, there wasn't a good reason to\nremove these patches, I made it clear I added those patches only to\nmake sure the real patches of this series worked correctly. Also, I\nclarified that to Thomas Rast[1], only to receive a totally\nunconstructive comment[2].\n\nWhy don't you ask Thomas Rast to be more constructive[2]?\n\nThen Johan Herland uses that as an example of a constructive\ncomment[3]. Why don't you correct Johan Herland?\n\nNo, you pick the easy target: me.\n\nI already dd more than my fair share by carrying these 36 patches\nthrough several iterations, yet you ask *more* of me. Why don't you\nask more of the people that just hit reply on their MUA?\n\nThomas' task was easy; he simply had to say \"Oh, these aren't meant to\nbe applied, got it.\"\n\n[1] http://article.gmane.org/gmane.comp.version-control.git/227039\n[2] http://article.gmane.org/gmane.comp.version-control.git/227040\n[3] http://article.gmane.org/gmane.comp.version-control.git/227102\n\n-- \nFelipe Contreras\n"},{"id":"220405","messageId":"CABURp0qG6AqR-y1YLB0FdX-=kniHoZBfwUs0d7gPnfDfh9Pajw@mail.gmail.com","threadId":"34079","inReplyTo":"CAMP44s10T55_OBQrzXg6jwPrtJh_J9dJnTfDKJhkUc_oCm_cOA@mail.gmail.com","subject":"Re: [PATCH v5 00/36] Massive improvents to rebase and cherry-pick","fromName":"Phil Hord","fromEmail":"phil.hord@gmail.com","sentAt":"2013-06-11T01:09:59Z","receivedAt":"2013-06-11T01:09:59Z","isPatch":true,"sender":{"key":"phil.hord@gmail.com","avatar":"https://avatars.githubusercontent.com/u/123908?v=4"},"body":"On Mon, Jun 10, 2013 at 7:43 PM, Felipe Contreras\n<felipe.contreras@gmail.com> wrote:\n> On Mon, Jun 10, 2013 at 5:55 PM, Phil Hord <phil.hord@gmail.com> wrote:\n>> On Sun, Jun 9, 2013 at 3:37 PM, Felipe Contreras\n>> <felipe.contreras@gmail.com> wrote:\n>>>\n>>> On Sun, Jun 9, 2013 at 2:24 PM, Felipe Contreras\n>>> <felipe.contreras@gmail.com> wrote:\n>>> > Same as before, but:\n>>>\n>>> Also, remove the patches from Martin von Zweigbergk, because\n>>> apparently some people have trouble understanding that they were not\n>>> part of this series.\n>>\n>> Please try not to sound disgruntled. This attitude is toxic. You have\n>> turned this change into a complaint: that \"some people have trouble\n>> understanding\" which shows a genuine lack of understanding and\n>> compassion on your part.  Instead you can phrase your change notes\n>> more helpfully if you make changes only when you yourself actually\n>> believe the change should be made.  If you cannot do this, perhaps you\n>> can pretend.\n>\n> That would be dishonest. Moreover, there wasn't a good reason to\n> remove these patches, I made it clear I added those patches only to\n> make sure the real patches of this series worked correctly. Also, I\n> clarified that to Thomas Rast[1], only to receive a totally\n> unconstructive comment[2].\n>\n> Why don't you ask Thomas Rast to be more constructive[2]?\n>\n> Then Johan Herland uses that as an example of a constructive\n> comment[3]. Why don't you correct Johan Herland?\n\nI do not see what their comments have to do with your attitude.\nAren't your own man with cogent self-will and personal responsibility?\n Why should I also have to consider these other emails which I have\nnot bothered to read yet?\n\n> No, you pick the easy target: me.\n\nYou seem to have mistaken me for someone else.  Moreover, you seem to\nhave mistaken you for someone else.  You are the least easy target I\nknow of on this list.  Everyone else seems open to community\nstandards.\n\n\n> I already dd more than my fair share by carrying these 36 patches\n> through several iterations, yet you ask *more* of me. Why don't you\n> ask more of the people that just hit reply on their MUA?\n>\n> Thomas' task was easy; he simply had to say \"Oh, these aren't meant to\n> be applied, got it.\"\n>\n> [1] http://article.gmane.org/gmane.comp.version-control.git/227039\n> [2] http://article.gmane.org/gmane.comp.version-control.git/227040\n> [3] http://article.gmane.org/gmane.comp.version-control.git/227102\n\nI did not comment on their posts because they did not catch my eye.\nRebase and cherry-pick improvements are interesting to me, so I read\nyour post.  I will try not to make this mistake again.\n\nPhil\n"},{"id":"220407","messageId":"CAMP44s0+Qz5urzUtv-ZQr-4r-jzYMcnXD4=8f51sQbXdEyQvKg@mail.gmail.com","threadId":"34079","inReplyTo":"CABURp0qG6AqR-y1YLB0FdX-=kniHoZBfwUs0d7gPnfDfh9Pajw@mail.gmail.com","subject":"Re: [PATCH v5 00/36] Massive improvents to rebase and cherry-pick","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2013-06-11T03:52:21Z","receivedAt":"2013-06-11T03:52:21Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"On Mon, Jun 10, 2013 at 8:09 PM, Phil Hord <phil.hord@gmail.com> wrote:\n> On Mon, Jun 10, 2013 at 7:43 PM, Felipe Contreras\n> <felipe.contreras@gmail.com> wrote:\n>> On Mon, Jun 10, 2013 at 5:55 PM, Phil Hord <phil.hord@gmail.com> wrote:\n>>> On Sun, Jun 9, 2013 at 3:37 PM, Felipe Contreras\n>>> <felipe.contreras@gmail.com> wrote:\n>>>>\n>>>> On Sun, Jun 9, 2013 at 2:24 PM, Felipe Contreras\n>>>> <felipe.contreras@gmail.com> wrote:\n>>>> > Same as before, but:\n>>>>\n>>>> Also, remove the patches from Martin von Zweigbergk, because\n>>>> apparently some people have trouble understanding that they were not\n>>>> part of this series.\n>>>\n>>> Please try not to sound disgruntled. This attitude is toxic. You have\n>>> turned this change into a complaint: that \"some people have trouble\n>>> understanding\" which shows a genuine lack of understanding and\n>>> compassion on your part.  Instead you can phrase your change notes\n>>> more helpfully if you make changes only when you yourself actually\n>>> believe the change should be made.  If you cannot do this, perhaps you\n>>> can pretend.\n>>\n>> That would be dishonest. Moreover, there wasn't a good reason to\n>> remove these patches, I made it clear I added those patches only to\n>> make sure the real patches of this series worked correctly. Also, I\n>> clarified that to Thomas Rast[1], only to receive a totally\n>> unconstructive comment[2].\n>>\n>> Why don't you ask Thomas Rast to be more constructive[2]?\n>>\n>> Then Johan Herland uses that as an example of a constructive\n>> comment[3]. Why don't you correct Johan Herland?\n>\n> I do not see what their comments have to do with your attitude.\n\nMy attitude is fine. I sent a lot of patches, and I made clear that\nsome of them were meant only to test the rest. And I clarified that\ntwice.\n\nThere's nothing wrong with that.\n\n> Aren't your own man with cogent self-will and personal responsibility?\n>  Why should I also have to consider these other emails which I have\n> not bothered to read yet?\n\nDon't be that girlfriend that brings the times you haven't picked up\nthe towel properly when talking about something completely and totally\ndifferent.\n\nWhen talking about the attitude in *this* patch series, limit yourself\nto *this* patch series.\n\n>> No, you pick the easy target: me.\n>\n> You seem to have mistaken me for someone else.  Moreover, you seem to\n> have mistaken you for someone else.  You are the least easy target I\n> know of on this list.\n\n> Everyone else seems open to community standards.\n\nAnd yet you try to correct me, who did nothing wrong. And ignore the\ntransgressions of the other people, whom I already demonstrated\nactually *did* do something wrong. How convenient of you to not\nmention my arguments *at all*.\n\n>> I already dd more than my fair share by carrying these 36 patches\n>> through several iterations, yet you ask *more* of me. Why don't you\n>> ask more of the people that just hit reply on their MUA?\n>>\n>> Thomas' task was easy; he simply had to say \"Oh, these aren't meant to\n>> be applied, got it.\"\n>>\n>> [1] http://article.gmane.org/gmane.comp.version-control.git/227039\n>> [2] http://article.gmane.org/gmane.comp.version-control.git/227040\n>> [3] http://article.gmane.org/gmane.comp.version-control.git/227102\n>\n> I did not comment on their posts because they did not catch my eye.\n> Rebase and cherry-pick improvements are interesting to me, so I read\n> your post.  I will try not to make this mistake again.\n\nYes, because my patches are so obviously wrong.\n\nIf you were a truly productive member of this community, you would\nignore all the bullshit, take the patches, fix whatever is technically\nwrong with them (nothing), and resend them.\n\nBut no, that would be way too productive.\n\n-- \nFelipe Contreras\n"}]}