[PATCH] git-am: add am.threeWay config variable

2015-08-04 Thread Paul Tan
Lespinet remi.lespi...@ensimag.grenoble-inp.fr Signed-off-by: Paul Tan pyoka...@gmail.com --- I tweaked Remi's patch so it is implemented on top of builtin/am.c. Hopefully there will be no regressions this time ;) Documentation/config.txt | 8 Documentation/git-am.txt | 7 +-- builtin

Re: What's cooking in git.git (Aug 2015, #01; Mon, 3)

2015-08-03 Thread Paul Tan
On Tue, Aug 4, 2015 at 6:18 AM, Junio C Hamano gits...@pobox.com wrote: - I think pt/am-builtin is more or less ready, but the fix to the issue that options given to 'git am' when restarting were rejected must be queued on that topic before we can start thinking of merging it to

Re: [PATCH] am: let command-line options override saved options

2015-07-31 Thread Paul Tan
On Sat, Aug 1, 2015 at 12:04 AM, Junio C Hamano gits...@pobox.com wrote: Paul Tan pyoka...@gmail.com writes: I think I will introduce a format_patch() function that takes a single commit-ish so that we can use tag names to name the patches: # Given a single commit $commit, formats

Re: [PATCH] am: let command-line options override saved options

2015-07-31 Thread Paul Tan
On Wed, Jul 29, 2015 at 1:09 AM, Junio C Hamano gits...@pobox.com wrote: Paul Tan pyoka...@gmail.com writes: diff --git a/t/t4153-am-resume-override-opts.sh b/t/t4153-am-resume-override-opts.sh new file mode 100755 index 000..c49457c --- /dev/null +++ b/t/t4153-am-resume-override

Re: [PATCH] pull.sh: quote $upload_pack when passing it to git-fetch

2015-07-31 Thread Paul Tan
On Fri, Jul 31, 2015 at 4:40 AM, Matthieu Moy matthieu@imag.fr wrote: The previous code broke for example git pull --upload-pack 'echo --foo' Reported-by: Joey Hess i...@joeyh.name Fix-suggested-by: Junio C Hamano gits...@pobox.com Signed-off-by: Matthieu Moy matthieu@imag.fr

[PATCH] am: let command-line options override saved options

2015-07-28 Thread Paul Tan
...@pobox.com Helped-by: Jeff King p...@peff.net Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 9 ++- t/t4153-am-resume-override-opts.sh | 144 + 2 files changed, 150 insertions(+), 3 deletions(-) create mode 100755 t/t4153

Re: git am and then git am -3 regression?

2015-07-25 Thread Paul Tan
On Sat, Jul 25, 2015 at 2:09 AM, Jeff King p...@peff.net wrote: Yeah, I think this hunk is to blame (though I just read the code and did not test): @@ -658,6 +665,8 @@ fi if test $(cat $dotest/threeway) = t then threeway=t +else + threeway=f fi It comes after the

[PATCH v6 21/45] builtin-am: implement --rebasing mode

2015-07-19 Thread Paul Tan
-rebase.sh. Re-implement the above in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 30 ++ 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index 7237fff..3107aba 100644 --- a/builtin/am.c +++ b

[PATCH v6 13/45] builtin-am: implement --skip

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am supported resuming from a failed patch application by skipping the current patch. Re-implement this feature by introducing am_skip(). Helped-by: Stefan Beller sbel...@google.com Signed-off-by: Paul Tan pyoka...@gmail.com

[PATCH v6 12/45] builtin-am: don't parse mail when resuming

2015-07-19 Thread Paul Tan
. Re-implement this in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes: v6 New patch. A test for this in t4150 would be something like this: test_expect_success 'do not parse mail when resuming' ' rm -fr .git/rebase-apply git reset --hard

[PATCH v6 10/45] builtin-am: refuse to apply patches if index is dirty

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am will refuse to apply patches if the index is dirty. Re-implement this behavior in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 45 + 1 file changed

[PATCH v6 20/45] builtin-am: implement --3way, am.threeWay

2015-07-19 Thread Paul Tan
. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 156 +-- 1 file changed, 152 insertions(+), 4 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index 7c0f604..7237fff 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -19,6

[PATCH v6 24/45] builtin-am: implement -u/--utf8

2015-07-19 Thread Paul Tan
to git-mailinfo, which disables the re-encoding. Since d84029b (--utf8 is now default for 'git-am', 2007-01-08), --utf8 is specified by default in git-am.sh. Re-implement the above in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 11 +++ 1 file changed, 11

[PATCH v6 17/45] builtin-am: exit with user friendly message on failure

2015-07-19 Thread Paul Tan
the die_user_resolve() function. Since cc12005 (Make git rebase interactive help match documentation., 2006-05-13), git-am supports the --resolvemsg option which is used by git-rebase to override the message printed out when git-am fails. Re-implement this option. Signed-off-by: Paul Tan pyoka

[PATCH v6 11/45] builtin-am: implement --resolved/--continue

2015-07-19 Thread Paul Tan
no sense for the user to run am --resolved when there is no session in progress, we error out in this case. Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes: v6 * Extracted out the validation of the state directory for resuming into a separate validate_resume_state() function, so

[PATCH v6 22/45] builtin-am: bypass git-mailinfo when --rebasing

2015-07-19 Thread Paul Tan
. The above 3 commits introduced a separate parse_mail() code path in git-am.sh's --rebasing mode that bypasses git-mailinfo. Re-implement this code path in builtin/am.c as parse_mail_rebase(). Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 134

[PATCH v6 08/45] builtin-am: apply patch with git-apply

2015-07-19 Thread Paul Tan
will refresh the index before applying patches. Re-implement this behavior. Helped-by: Junio C Hamano gits...@pobox.com Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes: v6 * refresh_and_write_cache(): use a heap-allocated lock_file instead of a static-allocated one to allow

[PATCH v6 16/45] builtin-am: implement -q/--quiet

2015-07-19 Thread Paul Tan
. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 31 --- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index fa522f5..e0b86d1 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -80,6 +80,9 @@ struct am_state

[PATCH v6 15/45] builtin-am: reject patches when there's a session in progress

2015-07-19 Thread Paul Tan
, by checking if stdin is not a tty and there is no resume command given. Re-implement the above two safety checks. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 8a054ee..fa522f5

[PATCH v6 18/45] builtin-am: implement -s/--signoff

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am supported the --signoff option which will append a signoff at the end of the commit messsage. Re-implement this feature in parse_mail() by calling append_signoff() if the option is set. Signed-off-by: Paul Tan pyoka

[PATCH v6 14/45] builtin-am: implement --abort

2015-07-19 Thread Paul Tan
the last failure from being lost, git-am will not rewind HEAD back to the original commit if HEAD moved since the last failure. Re-implement this through safe_to_abort(). Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 102 +-- 1

[PATCH v6 28/45] builtin-am: implement --[no-]scissors

2015-07-19 Thread Paul Tan
with mailinfo.scissors (and perhaps through other settings in the future), to be safe we make an explicit distinction between SCISSORS_UNSET, SCISSORS_TRUE and SCISSORS_FALSE. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 48 1 file changed, 48

[PATCH v6 29/45] builtin-am: pass git-apply's options to git-apply

2015-07-19 Thread Paul Tan
in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 45 + 1 file changed, 45 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 1f79750..9ff0736 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -106,6 +106,7 @@ struct

[PATCH v6 30/45] builtin-am: implement --ignore-date

2015-07-19 Thread Paul Tan
Since a79ec62 (git-am: Add --ignore-date option, 2009-01-24), git-am.sh supported the --ignore-date option, and would use the current timestamp instead of the one provided in the patch if the option was set. Re-implement this option in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com

[PATCH v6 02/45] wrapper: implement xfopen()

2015-07-19 Thread Paul Tan
of code and make the die() messages consistent. Helped-by: Jeff King p...@peff.net Helped-by: Johannes Schindelin johannes.schinde...@gmx.de Helped-by: Junio C Hamano gits...@pobox.com Signed-off-by: Paul Tan pyoka...@gmail.com --- git-compat-util.h | 1 + wrapper.c | 21

[PATCH v6 36/45] builtin-am: invoke pre-applypatch hook

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am.sg will invoke the pre-applypatch hook after applying the patch to the index, but before a commit is made. Should the hook exit with a non-zero status, git am will exit. Re-implement this in builtin/am.c. Signed-off-by: Paul

[PATCH v6 42/45] builtin-am: implement -i/--interactive

2015-07-19 Thread Paul Tan
. When --resolved-ing in --interactive mode, we need to take care to update the patch with the contents of the index, such that the correct patch will be displayed when the patch is viewed in interactive mode. Re-implement the above in builtin/am.c Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes

[PATCH v6 37/45] builtin-am: invoke post-applypatch hook

2015-07-19 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am.sh will invoke the post-applypatch hook after the patch is applied and a commit is made. The exit code of the hook is ignored. Re-implement this in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c

[PATCH v6 31/45] builtin-am: implement --committer-date-is-author-date

2015-07-19 Thread Paul Tan
-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 8 1 file changed, 8 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 7f068e2..1080df6 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -108,6 +108,7 @@ struct am_state { int scissors; /* enum scissors_type

[PATCH v6 35/45] builtin-am: invoke applypatch-msg hook

2015-07-19 Thread Paul Tan
this in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 24 1 file changed, 24 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 64b467f..764e955 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -458,6 +458,27 @@ static void am_destroy(const struct

[PATCH v6 23/45] builtin-am: handle stray state directory

2015-07-19 Thread Paul Tan
such a stray directory, and allows the user to remove it with am --abort. Re-implement this feature in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 17 + 1 file changed, 17 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 01f01bf..398debf

[PATCH v6 43/45] builtin-am: implement legacy -b/--binary option

2015-07-19 Thread Paul Tan
, the message: The -b/--binary option has been a no-op for long time, and it will be removed. Please do not use it anymore. will be printed. Re-implement this in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 7 +++ 1 file changed, 7 insertions(+) diff

[PATCH v6 41/45] builtin-am: support and auto-detect mercurial patches

2015-07-19 Thread Paul Tan
formats, 2009-05-27), git-am.sh was able to auto-detect mercurial patches by checking if the file begins with the line: # HG changeset patch Re-implement the above in builtin/am.c. Helped-by: Stefan Beller sbel...@google.com Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c

[PATCH v6 38/45] builtin-am: rerere support

2015-07-19 Thread Paul Tan
) * git rerere clear when --skip-ing. Since f131dd4 (rerere: record (or avoid misrecording) resolved, skipped or aborted rebase/am, 2006-12-08) * git rerere clear when --abort-ing. Since 3e5057a (git am --abort, 2008-07-16) Re-implement the above in builtin/am.c. Signed-off-by: Paul Tan pyoka

[PATCH v6 34/45] builtin-am: support automatic notes copying

2015-07-19 Thread Paul Tan
Since eb2151b (rebase: support automatic notes copying, 2010-03-12), git-am.sh supported automatic notes copying in --rebasing mode by invoking git notes copy once it has finished applying all the patches. Re-implement this feature in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com

[PATCH v6 19/45] cache-tree: introduce write_index_as_tree()

2015-07-19 Thread Paul Tan
file path. Signed-off-by: Paul Tan pyoka...@gmail.com --- cache-tree.c | 29 + cache-tree.h | 1 + 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/cache-tree.c b/cache-tree.c index 32772b9..feace8b 100644 --- a/cache-tree.c +++ b/cache-tree.c

[PATCH v6 33/45] builtin-am: invoke post-rewrite hook

2015-07-19 Thread Paul Tan
with the contents of the $state_dir/rewritten file. Re-implement this in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 55 +++ 1 file changed, 55 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 3612bb3..e99e1ec 100644

[PATCH v6 40/45] builtin-am: support and auto-detect StGit series files

2015-07-19 Thread Paul Tan
. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 59 ++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin/am.c index 101bca3..01f8a53 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -80,7 +80,8

[PATCH v6 09/45] builtin-am: implement committing applied patch

2015-07-19 Thread Paul Tan
that are created from making the commits. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 55 +++ 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index 1f198e4..a2811b6 100644 --- a/builtin

[PATCH v6 27/45] builtin-am: support --keep-cr, am.keepcr

2015-07-19 Thread Paul Tan
config setting, which controls whether --keep-cr is on by default. Re-implement the above in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 29 +++-- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/builtin/am.c b/builtin/am.c

[PATCH v6 44/45] builtin-am: check for valid committer ident

2015-07-19 Thread Paul Tan
if the committer ident has been configured, or a default one can be constructed, before even starting to apply patches. Re-implement this in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/am.c b/builtin/am.c

[PATCH v6 45/45] builtin-am: remove redirection to git-am.sh

2015-07-19 Thread Paul Tan
functionality has been re-implemented in builtin/am.c, remove this redirection, and retire git-am.sh into contrib/examples/. Signed-off-by: Paul Tan pyoka...@gmail.com --- Makefile| 1 - builtin/am.c| 15 --- git-am.sh = contrib

[PATCH v6 25/45] builtin-am: implement -k/--keep, --keep-non-patch

2015-07-19 Thread Paul Tan
. Re-implement these two options in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index a64a859..af08a22 100644 --- a/builtin/am.c +++ b

[PATCH v6 26/45] builtin-am: implement --[no-]message-id, am.messageid

2015-07-19 Thread Paul Tan
this option in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 13 + 1 file changed, 13 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index af08a22..e41a104 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -98,6 +98,7 @@ struct am_state { int

[PATCH v6 39/45] builtin-am: support and auto-detect StGit patches

2015-07-19 Thread Paul Tan
StGit patches. Re-implement this in builtin/am.c. Helped-by: Eric Sunshine sunsh...@sunshineco.com Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 132 ++- 1 file changed, 131 insertions(+), 1 deletion(-) diff --git a/builtin/am.c

[PATCH v3 11/12] t3418: non-interactive rebase --continue with rerere enabled

2015-07-19 Thread Paul Tan
Beller sbel...@google.com Reviewed-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t3418-rebase-continue.sh | 19 +++ 1 file changed, 19 insertions(+) diff --git a/t/t3418-rebase-continue.sh b/t/t3418-rebase-continue.sh index

[PATCH v3 10/12] t4150: tests for am --[no-]scissors

2015-07-19 Thread Paul Tan
of mailinfo.scissors. Reviewed-by: Stefan Beller sbel...@google.com Reviewed-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 48 1 file changed, 48 insertions(+) diff --git a/t

[PATCH v3 12/12] t3901: test git-am encoding conversion

2015-07-19 Thread Paul Tan
to check that no encoding conversion will occur if that option is set. Helped-by: Johannes Sixt j...@kdbg.org Reviewed-by: Stefan Beller sbel...@google.com Reviewed-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes: v3 * Added !MINGW

[PATCH v3 09/12] t4150: am with post-applypatch hook

2015-07-19 Thread Paul Tan
sbel...@google.com Reviewed-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 38 ++ 1 file changed, 38 insertions(+) diff --git a/t/t4150-am.sh b/t/t4150-am.sh index 957c63c..7494240 100755 --- a/t

[PATCH v6 01/45] wrapper: implement xopen()

2015-07-19 Thread Paul Tan
that we can save a few lines of code, and make the die() messages consistent. Helped-by: Torsten Bögershausen tbo...@web.de Helped-by: Jeff King p...@peff.net Helped-by: Johannes Schindelin johannes.schinde...@gmx.de Helped-by: Junio C Hamano gits...@pobox.com Signed-off-by: Paul Tan pyoka

[PATCH v6 04/45] builtin-am: implement patch queue mechanism

2015-07-19 Thread Paul Tan
...@google.com Helped-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 177 +++ 1 file changed, 177 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index fd32caf..ac172c4

[PATCH v6 03/45] builtin-am: implement skeletal builtin am

2015-07-19 Thread Paul Tan
= setup_git_directory(); trace_repo_setup(prefix); setup_work_tree(); This redirection should be removed when all the features of git-am.sh have been re-implemented in builtin/am.c. Helped-by: Junio C Hamano gits...@pobox.com Signed-off-by: Paul Tan pyoka...@gmail.com --- Makefile | 1

[PATCH v6 05/45] builtin-am: split out mbox/maildir patches with git-mailsplit

2015-07-19 Thread Paul Tan
foreign patch support: introduce patch_format, 2009-05-27)) to allow the user to choose between the different patch formats. Helped-by: Junio C Hamano gits...@pobox.com Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 107 +-- 1

[PATCH v6 06/45] builtin-am: auto-detect mbox patches

2015-07-19 Thread Paul Tan
by \r\n. To support this, implement strbuf_getline_crlf(), which will remove both '\n' and \r\n from the end of the line. Helped-by: Junio C Hamano gits...@pobox.com Helped-by: Eric Sunshine sunsh...@sunshineco.com Helped-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan

[PATCH v6 07/45] builtin-am: extract patch and commit info with git-mailinfo

2015-07-19 Thread Paul Tan
directly without spawning a new process. Helped-by: Junio C Hamano gits...@pobox.com Helped-by: Jeff King p...@peff.net Helped-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 317

[PATCH v6 00/45] Make git-am a builtin

2015-07-19 Thread Paul Tan
Paul Tan (45): wrapper: implement xopen() wrapper: implement xfopen() builtin-am: implement skeletal builtin am builtin-am: implement patch queue mechanism builtin-am: split out mbox/maildir patches with git-mailsplit builtin-am: auto-detect mbox patches builtin-am: extract patch

[PATCH v3 02/12] t4150: am fails if index is dirty

2015-07-19 Thread Paul Tan
-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 12 1 file changed, 12 insertions(+) diff --git a/t/t4150-am.sh b/t/t4150-am.sh index 264f53f..a85e06a 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -154,6 +154,18

[PATCH v3 07/12] t4150: am with applypatch-msg hook

2015-07-19 Thread Paul Tan
-by: Junio C Hamano gits...@pobox.com Reviewed-by: Stefan Beller sbel...@google.com Reviewed-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 35 +++ 1 file changed, 35 insertions(+) diff --git a/t

[PATCH v3 05/12] t4150: am --resolved fails if index has no changes

2015-07-19 Thread Paul Tan
Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 12 1 file changed, 12 insertions(+) diff --git a/t/t4150-am.sh b/t/t4150-am.sh index c350967..430ae71 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -425,6 +425,18

[PATCH v3 00/12] Improve git-am test coverage

2015-07-19 Thread Paul Tan
] http://pyokagan.github.io/git/20150702173751-2fdae08//kcov-merged/git-am.eb79278e.html [3] https://gist.github.com/pyokagan/1b7b0d1f4dab6ba3cef1 Paul Tan (12): t4150: am.messageid really adds the message id t4150: am fails if index is dirty t4151: am --abort will keep dirty index intact t4150

[PATCH v3 08/12] t4150: am with pre-applypatch hook

2015-07-19 Thread Paul Tan
...@pobox.com Reviewed-by: Stefan Beller sbel...@google.com Reviewed-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 33 + 1 file changed, 33 insertions(+) diff --git a/t/t4150-am.sh b/t/t4150-am.sh

[PATCH v3 03/12] t4151: am --abort will keep dirty index intact

2015-07-19 Thread Paul Tan
a test for this. Reviewed-by: Stefan Beller sbel...@google.com Reviewed-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4151-am-abort.sh | 15 +++ 1 file changed, 15 insertions(+) diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh

[PATCH v3 04/12] t4150: am refuses patches when paused

2015-07-19 Thread Paul Tan
-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 14 ++ 1 file changed, 14 insertions(+) diff --git a/t/t4150-am.sh b/t/t4150-am.sh index a85e06a..c350967 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -397,6 +397,20

[PATCH v3 06/12] t4150: am --resolved fails if index has unmerged entries

2015-07-19 Thread Paul Tan
-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 13 + 1 file changed, 13 insertions(+) diff --git a/t/t4150-am.sh b/t/t4150-am.sh index 430ae71..c1ec4d5 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -437,6 +437,19

[PATCH v3 01/12] t4150: am.messageid really adds the message id

2015-07-19 Thread Paul Tan
Since a078f73 (git-am: add --message-id/--no-message-id, 2014-11-25), the am.messageid setting determines whether the --message-id option is set by default. Add a test for this. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 12

[PATCH v6 32/45] builtin-am: implement -S/--gpg-sign, commit.gpgsign

2015-07-19 Thread Paul Tan
setting is true. Since we do not run commit-tree, we re-implement this behavior by handling the commit.gpgsign setting ourselves. Helped-by: Stefan Beller sbel...@google.com Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion

Re: [PATCH v5 12/44] builtin-am: implement --skip

2015-07-18 Thread Paul Tan
On Tue, Jul 14, 2015 at 09:54:10AM -0700, Stefan Beller wrote: So what I meant to suggest, was to only allocate the memory if we really need it by moving the allocation further down. static int clean_index(const unsigned char *head, const unsigned char *remote) { struct lock_file

Re: [PATCH v4 42/44] builtin-am: implement legacy -b/--binary option

2015-07-14 Thread Paul Tan
On Thu, Jul 9, 2015 at 5:17 PM, Erik Faye-Lund kusmab...@gmail.com wrote: On Jun 29, 2015 10:06 PM, Stefan Beller sbel...@google.com wrote: On Sun, Jun 28, 2015 at 7:06 AM, Paul Tan pyoka...@gmail.com wrote: The -b/--binary option was initially implemented in 087b674 (git-am: --binary

Re: [PATCH v5 19/44] builtin-am: implement --3way, am.threeWay

2015-07-14 Thread Paul Tan
On Wed, Jul 8, 2015 at 4:14 AM, Junio C Hamano gits...@pobox.com wrote: Paul Tan pyoka...@gmail.com writes: @@ -82,6 +84,8 @@ struct am_state { /* number of digits in patch filename */ int prec; + int threeway; + int quiet; int append_signoff; These one

Re: [PATCH v5 00/44] Make git-am a builtin

2015-07-14 Thread Paul Tan
On Mon, Jul 13, 2015 at 03:31:37PM -0700, Junio C Hamano wrote: A fix is to edit the patch to replace that flags); line with full return delete_ref() line and save it. Then running $ git am (no argument) is supposed to read from the corrected patch file and continue the application.

Re: [PATCH 12/12] t3901: test git-am encoding conversion

2015-07-14 Thread Paul Tan
On Thu, Jul 9, 2015 at 4:44 AM, Johannes Sixt j...@kdbg.org wrote: Am 02.07.2015 um 20:16 schrieb Paul Tan: diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh index 75cf3ff..b49bdb7 100755 --- a/t/t3901-i18n-patch.sh +++ b/t/t3901-i18n-patch.sh @@ -251,4 +251,66

Re: [PATCH v5 12/44] builtin-am: implement --skip

2015-07-14 Thread Paul Tan
On Tue, Jul 14, 2015 at 3:05 AM, Stefan Beller sbel...@google.com wrote: All returns before this point leak the memory of `lock_file`. Yeah, it's intentional. From Documentation/technical/api-lockfile.txt: * Allocates a `struct lock_file` either as a static variable or on the heap,

Re: [PATCH v5 00/44] Make git-am a builtin

2015-07-12 Thread Paul Tan
Hi, (Sorry for the late reply. Caught a nasty stomach bug that kept me in bed for a while ) On Thu, Jul 9, 2015 at 2:00 PM, Junio C Hamano gits...@pobox.com wrote: What I pushed out tonight should have SQUASH??? (or fixup!) that splits this into appropriate steps in your series. Please check.

Re: [PATCH v5 00/44] Make git-am a builtin

2015-07-08 Thread Paul Tan
On Wed, Jul 08, 2015 at 12:48:06AM -0700, Junio C Hamano wrote: Junio C Hamano gits...@pobox.com writes: $ git am -s ./+dt ... error: patch failed: builtin/update-ref.c:421 error: builtin/update-ref.c: patch does not apply Patch failed at 0007 update-ref and tag: add --create-reflog arg The

Re: [PATCH v5 00/44] Make git-am a builtin

2015-07-08 Thread Paul Tan
On Wed, Jul 8, 2015 at 3:31 PM, Junio C Hamano gits...@pobox.com wrote: Paul Tan pyoka...@gmail.com writes: This patch series rewrites git-am.sh into optimized C builtin/am.c, and is part of my GSoC project to rewrite git-pull and git-am into C builtins[1]. I merged this to 'jch

Re: [PATCH 02/12] t4150: am fails if index is dirty

2015-07-07 Thread Paul Tan
On Sun, Jul 5, 2015 at 11:38 PM, Johannes Schindelin johannes.schinde...@gmx.de wrote: On 2015-07-02 20:16, Paul Tan wrote: diff --git a/t/t4150-am.sh b/t/t4150-am.sh index 3f54bdf..0a19136 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -154,6 +154,17 @@ test_expect_success 'am applies

Re: [PATCH 09/12] t4150: am with post-applypatch hook

2015-07-07 Thread Paul Tan
On Sun, Jul 5, 2015 at 11:58 PM, Johannes Schindelin johannes.schinde...@gmx.de wrote: On 2015-07-02 20:16, Paul Tan wrote: diff --git a/t/t4150-am.sh b/t/t4150-am.sh index dd6fe81..62b678c 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -275,6 +275,48 @@ test_expect_success 'am

Re: [PATCH v4 27/44] builtin-am: implement --[no-]scissors

2015-07-07 Thread Paul Tan
On Sun, Jun 28, 2015 at 10:05 PM, Paul Tan pyoka...@gmail.com wrote: diff --git a/builtin/am.c b/builtin/am.c index 2387726..55989e5 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -74,6 +74,12 @@ enum keep_type { KEEP_NON_PATCH /* pass -b flag to git-mailinfo */ }; +enum

Re: [PATCH v5 00/44] Make git-am a builtin

2015-07-07 Thread Paul Tan
On Wed, Jul 8, 2015 at 2:52 AM, Junio C Hamano gits...@pobox.com wrote: Paul Tan pyoka...@gmail.com writes: This patch series rewrites git-am.sh into optimized C builtin/am.c, and is part of my GSoC project to rewrite git-pull and git-am into C builtins[1]. [1] https://gist.github.com

Re: [PATCH v4 04/44] builtin-am: implement patch queue mechanism

2015-07-07 Thread Paul Tan
On Mon, Jun 29, 2015 at 1:08 PM, Stefan Beller sbel...@google.com wrote: (optional nit, bikeshedding) In conjunction with the previous patch I just wonder when we put a TODO and when we want to put a NEEDSWORK, or if we're being inconsistent here as both issues will be resolved in a later

[PATCH v2 04/12] t4150: am refuses patches when paused

2015-07-07 Thread Paul Tan
Since c95b138 (Fix git-am safety checks, 2006-09-15), when there is a session in progress, git-am will check the command-line arguments and standard input to ensure that the user does not pass it any patches. Add a test for this. Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 14

[PATCH v2 03/12] t4151: am --abort will keep dirty index intact

2015-07-07 Thread Paul Tan
a test for this. Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4151-am-abort.sh | 15 +++ 1 file changed, 15 insertions(+) diff --git a/t/t4151-am-abort.sh b/t/t4151-am-abort.sh index 833e7b2..05bdc3e 100755 --- a/t/t4151-am-abort.sh +++ b/t/t4151-am-abort.sh @@ -95,6 +95,21

[PATCH v2 12/12] t3901: test git-am encoding conversion

2015-07-07 Thread Paul Tan
to check that no encoding conversion will occur if that option is set. Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t3901-i18n-patch.sh | 62 +++ 1 file changed, 62 insertions(+) diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh index 75cf3ff

[PATCH v2 07/12] t4150: am with applypatch-msg hook

2015-07-07 Thread Paul Tan
-by: Junio C Hamano gits...@pobox.com Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes: v2 * Use write_script() to shave off the shebang line and chmod. t/t4150-am.sh | 35 +++ 1 file changed, 35 insertions(+) diff --git a/t/t4150-am.sh b/t/t4150

[PATCH v2 01/12] t4150: am.messageid really adds the message id

2015-07-07 Thread Paul Tan
Since a078f73 (git-am: add --message-id/--no-message-id, 2014-11-25), the am.messageid setting determines whether the --message-id option is set by default. Add a test for this. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes: v2

[PATCH v2 02/12] t4150: am fails if index is dirty

2015-07-07 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am will ensure that the index is clean before applying the patch. This is to prevent changes unrelated to the patch from being committed. Add a test for this check. Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes: v2

[PATCH v2 00/12] Improve git-am test coverage

2015-07-07 Thread Paul Tan
/1b7b0d1f4dab6ba3cef1 Paul Tan (12): t4150: am.messageid really adds the message id t4150: am fails if index is dirty t4151: am --abort will keep dirty index intact t4150: am refuses patches when paused t4150: am --resolved fails if index has no changes t4150: am --resolved fails if index has

[PATCH v2 06/12] t4150: am --resolved fails if index has unmerged entries

2015-07-07 Thread Paul Tan
Since c1d1128 (git-am --resolved: more usable error message., 2006-04-28), git-am --resolved will check to see if there are any unmerged entries, and will error out with a user-friendly error message if there are. Add a test for this. Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh

[PATCH v2 09/12] t4150: am with post-applypatch hook

2015-07-07 Thread Paul Tan
Since d1c5f2a (Add git-am, applymbox replacement., 2005-10-07), git-am.sh will invoke the post-applypatch hook after the patch is applied and a commit is made. The exit code of the hook is ignored. Add tests for this hook. Helped-by: Junio C Hamano gits...@pobox.com Signed-off-by: Paul Tan pyoka

[PATCH v2 11/12] t3418: non-interactive rebase --continue with rerere enabled

2015-07-07 Thread Paul Tan
Since 8389b52 (git-rerere: reuse recorded resolve., 2006-01-28), git-am will call git-rerere to re-use recorded merge conflict resolutions if any occur in a threeway merge. Add a test to ensure that git-rerere is called by git-am (which handles the non-interactive rebase). Signed-off-by: Paul

[PATCH v2 08/12] t4150: am with pre-applypatch hook

2015-07-07 Thread Paul Tan
...@pobox.com Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes: v2 * Use write_script() to shave off the shebang line and chmod. t/t4150-am.sh | 33 + 1 file changed, 33 insertions(+) diff --git a/t/t4150-am.sh b/t/t4150-am.sh index 7878e32

[PATCH v2 05/12] t4150: am --resolved fails if index has no changes

2015-07-07 Thread Paul Tan
Since 6d28644 (git-am: do not allow empty commits by mistake., 2006-02-23), git-am --resolved will check to see if the index has any changes to prevent the user from creating an empty commit by mistake. Add a test for this. Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 12

[PATCH v2 10/12] t4150: tests for am --[no-]scissors

2015-07-07 Thread Paul Tan
of mailinfo.scissors. Signed-off-by: Paul Tan pyoka...@gmail.com --- t/t4150-am.sh | 48 1 file changed, 48 insertions(+) diff --git a/t/t4150-am.sh b/t/t4150-am.sh index 7494240..67fbf0e 100755 --- a/t/t4150-am.sh +++ b/t/t4150-am.sh @@ -67,6

[PATCH v5 01/44] wrapper: implement xopen()

2015-07-07 Thread Paul Tan
that we can save a few lines of code, and make the die() messages consistent. Helped-by: Torsten Bögershausen tbo...@web.de Helped-by: Jeff King p...@peff.net Helped-by: Johannes Schindelin johannes.schinde...@gmx.de Helped-by: Junio C Hamano gits...@pobox.com Signed-off-by: Paul Tan pyoka

[PATCH v5 02/44] wrapper: implement xfopen()

2015-07-07 Thread Paul Tan
of code and make the die() messages consistent. Helped-by: Jeff King p...@peff.net Helped-by: Johannes Schindelin johannes.schinde...@gmx.de Helped-by: Junio C Hamano gits...@pobox.com Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes: v5 * Removed assert()s since we do not need

[PATCH v5 07/44] builtin-am: extract patch and commit info with git-mailinfo

2015-07-07 Thread Paul Tan
directly without spawning a new process. Helped-by: Junio C Hamano gits...@pobox.com Helped-by: Jeff King p...@peff.net Helped-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 335

[PATCH v5 09/44] builtin-am: implement committing applied patch

2015-07-07 Thread Paul Tan
that are created from making the commits. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 55 +++ 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index 9c7a6c8..bbb540c 100644 --- a/builtin

[PATCH v5 08/44] builtin-am: apply patch with git-apply

2015-07-07 Thread Paul Tan
will refresh the index before applying patches. Re-implement this behavior. Helped-by: Junio C Hamano gits...@pobox.com Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 73 +++- 1 file changed, 72 insertions(+), 1 deletion(-) diff

[PATCH v5 11/44] builtin-am: implement --resolved/--continue

2015-07-07 Thread Paul Tan
no sense for the user to run am --resolved when there is no session in progress, we error out in this case. Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 63 +++- 1 file changed, 62 insertions(+), 1 deletion(-) diff --git

[PATCH v5 00/44] Make git-am a builtin

2015-07-07 Thread Paul Tan
project to rewrite git-pull and git-am into C builtins[1]. [1] https://gist.github.com/pyokagan/1b7b0d1f4dab6ba3cef1 Paul Tan (44): wrapper: implement xopen() wrapper: implement xfopen() builtin-am: implement skeletal builtin am builtin-am: implement patch queue mechanism builtin-am

<    1   2   3   4   5   6   7   >