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

2015-07-28 Thread Paul Tan
. Reported-by: Junio C Hamano Helped-by: Jeff King Signed-off-by: Paul Tan --- builtin/am.c | 9 ++- t/t4153-am-resume-override-opts.sh | 144 + 2 files changed, 150 insertions(+), 3 deletions(-) create mode 100755 t/t4153-am-resume-

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 wrote: > Paul Tan 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

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 wrote: > The previous code broke for example > > git pull --upload-pack 'echo --foo' > > Reported-by: Joey Hess > Fix-suggested-by: Junio C Hamano > Signed-off-by: Matthieu Moy Thanks for cleaning up my mess! >< Regards, Paul -- To unsubscribe f

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 wrote: > Paul Tan 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 the f

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 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 'master' for the n

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

2015-08-04 Thread Paul Tan
n() that does the above so that we can save a few lines of code, and make the die() messages consistent. Helped-by: Torsten Bögershausen Helped-by: Jeff King Helped-by: Johannes Schindelin Helped-by: Junio C Hamano Signed-off-by: Paul Tan --- git-compat-util.h | 1 +

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

2015-08-04 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 Signed-off-by: Paul Tan --- builtin/am.c | 107 +-- 1 file changed, 104 insertions(+), 3

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

2015-08-04 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 --- builtin/am.c | 45 + 1 file changed, 45 insertions

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

2015-08-04 Thread Paul Tan
"\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 Helped-by: Eric Sunshine Helped-by: Johannes Schindelin Signed-off-by: Pau

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

2015-08-04 Thread Paul Tan
o that we can save a few lines of code and make the die() messages consistent. Helped-by: Jeff King Helped-by: Johannes Schindelin Helped-by: Junio C Hamano Signed-off-by: Paul Tan --- git-compat-util.h | 1 + wrapper.c | 21 + 2 files changed, 22 insertions(+) di

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

2015-08-04 Thread Paul Tan
will refresh the index before applying patches. Re-implement this behavior. Helped-by: Junio C Hamano Signed-off-by: Paul Tan --- builtin/am.c | 72 +++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin/am.c

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

2015-08-04 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(). Helped-by: Stefan Beller Signed-off-by: Paul Tan --- Notes: v7 * Add a free(curr_branch) so we don't leak m

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

2015-08-04 Thread Paul Tan
lse. Signed-off-by: Paul Tan --- builtin/am.c | 31 --- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index d4b4b86..0875e69 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -80,6 +80,9 @@ struct am_state { /* num

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

2015-08-04 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 Signed-off-by: Paul Tan --- builtin/am.c | 123

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

2015-08-04 Thread Paul Tan
. Signed-off-by: Paul Tan --- builtin/am.c | 59 ++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin/am.c index d82d07e..3c2ec15 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -80,7 +80,8 @@ static int

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

2015-08-04 Thread Paul Tan
ring cleanup to git-rebase.sh. Re-implement the above in builtin/am.c. Signed-off-by: Paul Tan --- builtin/am.c | 30 ++ 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index a5d5e8c..440a653 100644 --- a/builtin/am.c +++

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

2015-08-04 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 Signed-off-by: Paul Tan --- builtin/am.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin

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

2015-08-04 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 --- builtin/am.c | 29 +++-- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index 8e97839

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

2015-08-04 Thread Paul Tan
directly without spawning a new process. Helped-by: Junio C Hamano Helped-by: Jeff King Helped-by: Johannes Schindelin Signed-off-by: Paul Tan --- builtin/am.c | 317 +++ 1 file changed, 317 insertions(+) diff --git a/builtin/am.c b

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

2015-08-04 Thread Paul Tan
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 --- builtin/am.c | 48 1 file changed, 48 insertions(+) diff

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

2015-08-04 Thread Paul Tan
ebase/am, 2006-12-08) * "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 i

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

2015-08-04 Thread Paul Tan
d as-is instead. Re-implement this in builtin/am.c. Signed-off-by: Paul Tan --- builtin/am.c | 34 +- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index fd26721..ec579a6 100644 --- a/builtin/am.c +++ b/builtin/am.c @@

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

2015-08-04 Thread Paul Tan
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

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

2015-08-04 Thread Paul Tan
-implement this option in builtin/am.c. Signed-off-by: Paul Tan --- builtin/am.c | 13 + 1 file changed, 13 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 68dca2e..8e97839 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -98,6 +98,7 @@ struct am_state { i

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

2015-08-04 Thread Paul Tan
-off-by: Paul Tan --- builtin/am.c | 8 1 file changed, 8 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 84d3e05..1561580 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -108,6 +108,7 @@ struct am_state { int scissors; /* enum scissors_type */ struct

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

2015-08-04 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 --- Notes

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

2015-08-04 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 --- builtin/am.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 6c24d07..d4b4b86 100644 --- a/builtin

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

2015-08-04 Thread Paul Tan
builtin/am.c. Signed-off-by: Paul Tan --- builtin/am.c | 24 1 file changed, 24 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 7d7f91d..f0e3aab 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -456,6 +456,27 @@ static void am_destroy(const struct am_state *state

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

2015-08-04 Thread Paul Tan
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 --- builtin/am.c | 11 +++ 1 file changed, 11 insertion

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

2015-08-04 Thread Paul Tan
x27;s 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 --- Makefile| 1 - builtin/am.c| 15 --- git-am.sh => contrib/examples/g

[PATCH v7 20/45] builtin-am: implement --3way

2015-08-04 Thread Paul Tan
would list the paths that needed 3-way fallback, so that the user can review them more carefully to spot mismerges. Re-implement the above in builtin/am.c. Signed-off-by: Paul Tan --- Notes: v7 * As support for am.threeWay was removed in master, this patch now does not implement

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

2015-08-04 Thread Paul Tan
e commit itself. 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 --- Notes: v7 * Since a5481a6 (convert "enum

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

2015-08-04 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 v7 23/45] builtin-am: handle stray state directory

2015-08-04 Thread Paul Tan
xplicitly recognizes 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 --- builtin/am.c | 17 + 1 file changed, 17 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index a02c84e..

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

2015-08-04 Thread Paul Tan
contents of the $state_dir/rewritten file. Re-implement this in builtin/am.c. Signed-off-by: Paul Tan --- builtin/am.c | 55 +++ 1 file changed, 55 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 18611fa..dbec9fc 100644 --- a/builtin

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

2015-08-04 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 --- builtin/am.c | 2 ++ 1 file

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

2015-08-04 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 --- bu

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

2015-08-04 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 --- builtin/am.c | 6

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

2015-08-04 Thread Paul Tan
file path. Signed-off-by: Paul Tan --- 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 @@ -592,7 +592,7 @@ static

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

2015-08-04 Thread Paul Tan
StGit patches. Re-implement this in builtin/am.c. Helped-by: Eric Sunshine Signed-off-by: Paul Tan --- builtin/am.c | 132 ++- 1 file changed, 131 insertions(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin/am.c index 33d1f24..d82d07e

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

2015-08-04 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 --- builtin/am.c | 105

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

2015-08-04 Thread Paul Tan
check to see 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 --- builtin/am.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/builtin/am.c b/builtin/am.

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

2015-08-04 Thread Paul Tan
ns in builtin/am.c. Signed-off-by: Paul Tan --- builtin/am.c | 45 + 1 file changed, 45 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 727cfb8..f842f69 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -106,6 +106,7 @@ struct am_state {

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

2015-08-04 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 Signed-off-by: Paul Tan --- Notes: v7 * Since a5481a6 (convert

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

2015-08-04 Thread Paul Tan
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 --- builtin/am.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/builtin/am.c b

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

2015-08-04 Thread Paul Tan
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 --- builtin/am.c | 72 +++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin

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

2015-08-04 Thread Paul Tan
that are created from making the commits. Signed-off-by: Paul Tan --- 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/am.c +++ b/builtin

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

2015-08-04 Thread Paul Tan
. Re-implement these two options in builtin/am.c. Signed-off-by: Paul Tan --- builtin/am.c | 50 ++ 1 file changed, 50 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 528b2c9..68dca2e 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -68,6

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

2015-08-04 Thread Paul Tan
: Johannes Schindelin Signed-off-by: Paul Tan --- builtin/am.c | 177 +++ 1 file changed, 177 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index fd32caf..ac172c4 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -6,9 +6,171 @@

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

2015-08-04 Thread Paul Tan
prefix = 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 Signed-off-by: Paul Tan --- Makefile | 1 + builtin.h| 1

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

2015-08-04 Thread Paul Tan
advantage of git's internal caches. This patch series rewrites git-am.sh into 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/pyokagan/1b7b0d1f4dab6ba3cef1 Paul Tan (45): wrapper: implement xopen() wrapper: im

[PATCH v2 0/3] am: let command-line options override saved options

2015-08-04 Thread Paul Tan
h a solid use case, instead of implementing potentially undesirable behavior and having to support it. Paul Tan (3): test_terminal: redirect child process' stdin to a pty am: let command-line options override saved options am: let --signoff override --no-signoff built

[PATCH v2 1/3] test_terminal: redirect child process' stdin to a pty

2015-08-04 Thread Paul Tan
t_terminal's stdin should be redirected to a source with large amount of data to ensure that the child's stdin is not closed, e.g. test_terminal git am --3way Cc: Jeff King Signed-off-by: Paul Tan --- t/test-terminal.perl | 25 - 1 file changed, 20

[PATCH v2 2/3] am: let command-line options override saved options

2015-08-04 Thread Paul Tan
. Noticed-by: Junio C Hamano Helped-by: Junio C Hamano Helped-by: Jeff King Signed-off-by: Paul Tan --- builtin/am.c | 16 ++-- t/t4153-am-resume-override-opts.sh | 82 ++ 2 files changed, 94 insertions(+), 4 deletions(-) creat

[PATCH v2 3/3] am: let --signoff override --no-signoff

2015-08-04 Thread Paul Tan
signoff to the commit message when resuming if so. Signed-off-by: Paul Tan --- builtin/am.c | 28 +--- t/t4153-am-resume-override-opts.sh | 20 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/builtin/am.c b/bu

[PATCH v2 0/3] am: let command-line options override saved options

2015-08-04 Thread Paul Tan
h a solid use case, instead of implementing potentially undesirable behavior and having to support it. Paul Tan (3): test_terminal: redirect child process' stdin to a pty am: let command-line options override saved options am: let --signoff override --no-signoff built

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

2015-08-04 Thread Paul Tan
From: Remi Lespinet Add the am.threeWay configuration variable to use the -3 or --3way option of git am by default. When am.threeway is set and not desired for a specific git am command, the --no-3way option can be used to override it. Signed-off-by: Remi Lespinet Signed-off-by: Paul Tan

Re: [PATCH v2 0/3] am: let command-line options override saved options

2015-08-05 Thread Paul Tan
he command we are wrapping terminate before copy_stdin() finishes writing all of its data to un-stall it. Signed-off-by: Paul Tan --- t/test-terminal.perl | 27 ++- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/t/test-terminal.perl b/t/test-terminal.perl i

Re: [PATCH v2 3/3] am: let --signoff override --no-signoff

2015-08-11 Thread Paul Tan
On Fri, Aug 7, 2015 at 5:29 PM, Johannes Schindelin wrote: >> diff --git a/builtin/am.c b/builtin/am.c >> index 0961304..8c95aec 100644 >> --- a/builtin/am.c >> +++ b/builtin/am.c >> @@ -2265,6 +2284,9 @@ int cmd_am(int argc, const char **argv, const >> char *prefix) >> >> if (resume

Re: [PATCH v2 3/3] am: let --signoff override --no-signoff

2015-08-11 Thread Paul Tan
On Wed, Aug 12, 2015 at 11:06 AM, Paul Tan wrote: > It's not present in this diff context, but this hunk modifies the code > path where in_progress is true. In other words, we only check for > SIGNOFF_EXPLICIT if ..we are resuming. (Ugh, butter fingers) Thanks, Paul -- To unsubsc

Re: [PATCH v2 1/3] test_terminal: redirect child process' stdin to a pty

2015-08-11 Thread Paul Tan
On Fri, Aug 7, 2015 at 6:15 AM, Eric Sunshine wrote: > An alternative would be to have git-am detect that it is being tested > and pretend that isatty() returns true. I would vastly prefer a solution that would work for everything, for all the C code and scripts, instead of implementing a workaro

[PATCH] am --abort: merge ORIG_HEAD tree into index

2015-08-17 Thread Paul Tan
d the read_tree() function, which overwrites all entries in the index, including the stat info. Fix this by using unpack_trees() instead to merge the tree into the index, so that the stat info from the index is kept. Reported-by: Linus Torvalds Signed-off-by: Johannes Schindelin Signed-off-by: Pau

[PATCH v2] am --skip/--abort: merge HEAD/ORIG_HEAD tree into index

2015-08-19 Thread Paul Tan
instead to merge the tree into the index, so that the stat info from the index is kept. Reported-by: Linus Torvalds Helped-by: Junio C Hamano Signed-off-by: Johannes Schindelin Signed-off-by: Paul Tan --- builtin/am.c| 49 - t/t4151-am-

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

2015-08-19 Thread Paul Tan
On Tue, Aug 18, 2015 at 5:36 PM, Matthieu Moy wrote: > I don't remember the details of the regression we had with the shell > version, but that would probably deserve an additional test to enforce > the "Hopefully there will be no regressions" part of your message. Actually, technically, I think

[PATCH] am: terminate state files with a newline

2015-08-22 Thread Paul Tan
haves. While we are fixing the write_file() calls, fix the writing of the "dirtyindex" file as well -- we should be creating an empty file to match the behavior of git-am.sh. Reported-by: SZEDER Gábor Signed-off-by: Paul Tan --- builtin/am.c | 30 +++--- 1

Re: GSoC 2015 is over

2015-09-02 Thread Paul Tan
On Wed, Sep 2, 2015 at 1:43 AM, Karthik Nayak wrote: > On Tue, Sep 1, 2015 at 10:25 PM, Matthieu Moy > wrote: >> Hi, >> >> The Google Summer of Code 2015 is officially over. We had two students >> (Paul and Karthik), and both of them passed. 100 % success :-). >> > > Congrats Paul :) Thanks, you

Re: GSoC 2015 is over

2015-09-02 Thread Paul Tan
On Wed, Sep 2, 2015 at 12:55 AM, Matthieu Moy wrote: > I consider this GSoC as a great success and a pleasant experience. > Congratulation to Paul and Karthik, and a warm "thank you" to everybody > who contributed: administrators, mentors, reviewers, and obviously > Junio! (not to mention Google,

Re: [PATCH] am: match --signoff to the original scripted version

2015-09-06 Thread Paul Tan
Hi, Thanks for handling this. On Sun, Sep 6, 2015 at 12:56 PM, Junio C Hamano wrote: > Linus noticed that the recently reimplementated "git am -s" defines s/reimplementated/reimplemented/ ? > the trailer block too rigidly, resulting an unnecessary blank line s/resulting an/resulting in an/ ?

Re: [PATCH] am: match --signoff to the original scripted version

2015-09-06 Thread Paul Tan
On Sun, Sep 6, 2015 at 12:56 PM, Junio C Hamano wrote: > diff --git a/builtin/am.c b/builtin/am.c > index 634f7a7..e7828e5 100644 > --- a/builtin/am.c > +++ b/builtin/am.c > @@ -1191,6 +1191,33 @@ static void NORETURN die_user_resolve(const struct > am_state *state) > exit(128); > } > >

Re: What's cooking in git.git (May 2015, #07; Tue, 26)

2015-05-29 Thread Paul Tan
Hi, On Fri, May 29, 2015 at 5:52 AM, Junio C Hamano wrote: > Junio C Hamano writes: > >> * pt/pull-tests (2015-05-18) 8 commits >> - t5520: check reflog action in fast-forward merge >> - t5521: test --dry-run does not make any changes >> - t5520: test --rebase failure on unborn branch with in

[PATCH v5 0/8] Improve git-pull test coverage

2015-05-29 Thread Paul Tan
round. [1] http://thread.gmane.org/gmane.comp.version-control.git/269236 Paul Tan (8): t5520: prevent field splitting in content comparisons t5520: test no merge candidates cases t5520: test for failure if index has unresolved entries t5520: test work tree fast-forward when fetch updates

[PATCH v5 1/8] t5520: prevent field splitting in content comparisons

2015-05-29 Thread Paul Tan
fail in mysterious ways. Replace the above 2 forms with: test "$(cat file)" = expected as quoting the command substitution will prevent field splitting. Signed-off-by: Paul Tan --- t/t5520-pull.sh | 70 - 1 file c

[PATCH v5 3/8] t5520: test for failure if index has unresolved entries

2015-05-29 Thread Paul Tan
run, and will print these advices, if the user is in the middle of a merge or has unmerged files in the index. Signed-off-by: Paul Tan --- Notes: v5: * use "test_commit" t/t5520-pull.sh | 19 +++ 1 file changed, 19 insertions(+) diff --git a/t/t5520-p

[PATCH v5 2/8] t5520: test no merge candidates cases

2015-05-29 Thread Paul Tan
gered for each of these cases. Signed-off-by: Paul Tan --- t/t5520-pull.sh | 55 +++ 1 file changed, 55 insertions(+) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 5e4db67..4a2c0a1 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh

[PATCH v5 8/8] t5520: check reflog action in fast-forward merge

2015-05-29 Thread Paul Tan
When testing a fast-forward merge with git-pull, check to see if the reflog action is "pull" with the arguments passed to git-pull. While we are in the vicinity, remove the empty line as well. Signed-off-by: Paul Tan --- Notes: v5: * Loosen up the pattern used for

[PATCH v5 5/8] t5520: test --rebase with multiple branches

2015-05-29 Thread Paul Tan
fails and prints out the user-friendly error message in such a case. Signed-off-by: Paul Tan --- t/t5520-pull.sh | 9 + 1 file changed, 9 insertions(+) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 872d765..90728e0 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -217,6 +217,15

[PATCH v5 7/8] t5521: test --dry-run does not make any changes

2015-05-29 Thread Paul Tan
Test that when --dry-run is provided to git-pull, it does not make any changes, namely: * --dry-run gets passed to git-fetch, so no FETCH_HEAD will be created and no refs will be fetched. * The index and work tree will not be modified. Signed-off-by: Paul Tan --- t/t5521-pull-options.sh

[PATCH v5 6/8] t5520: test --rebase failure on unborn branch with index

2015-05-29 Thread Paul Tan
staged changes. Implement a test to ensure that this check is triggered. Signed-off-by: Paul Tan --- Notes: v5: * Move test_i18ngrep into subshell t/t5520-pull.sh | 15 +++ 1 file changed, 15 insertions(+) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index

[PATCH v5 4/8] t5520: test work tree fast-forward when fetch updates head

2015-05-29 Thread Paul Tan
-friendly advice is printed upon failure. Signed-off-by: Paul Tan --- t/t5520-pull.sh | 21 + 1 file changed, 21 insertions(+) diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh index 265c693..872d765 100755 --- a/t/t5520-pull.sh +++ b/t/t5520-pull.sh @@ -183,6 +183,27

Re: [PATCH 00/14] Make git-pull a builtin

2015-05-30 Thread Paul Tan
Hi, On Tue, May 19, 2015 at 3:21 AM, Junio C Hamano wrote: > Paul Tan writes: > >> This series rewrites git-pull.sh into a C builtin, thus improving its >> performance and portability. It is part of my GSoC project to rewrite >> git-pull >> and git-am into bui

Re: [PATCH 00/14] Make git-pull a builtin

2015-05-30 Thread Paul Tan
On Sat, May 30, 2015 at 3:29 PM, Paul Tan wrote: > Hi, > Okay, I'm trying this out in the next re-roll. I do agree that this > patch series should not touch anything in t/ at all. > > One problem(?) is that putting builtins/pull.o in the BUILTIN_OBJS and > leaving git-pull

Re: [PATCH 11/14] pull: teach git pull about --rebase

2015-05-31 Thread Paul Tan
Hi Johannes, On Tue, May 19, 2015 at 9:04 PM, Johannes Schindelin wrote: > On 2015-05-18 17:06, Paul Tan wrote: >> +/** >> + * Given a refspec, returns the merge branch. Returns NULL if the refspec >> src >> + * does not refer to a branch. >> + * >> +

Re: [PATCH 11/14] pull: teach git pull about --rebase

2015-06-02 Thread Paul Tan
On Sun, May 31, 2015 at 4:18 PM, Paul Tan wrote: > On Tue, May 19, 2015 at 9:04 PM, Johannes Schindelin > wrote: >> Also, I wonder if something like this would do the job: >> spec = parse_fetch_refspec(1, &refspec); >> if (spec->dst) >>

[PATCH v2 2/2] pull: use git-rev-parse --parseopt for option parsing

2015-06-02 Thread Paul Tan
To enable unambiguous parsing of abbreviated options, bundled short options, separate form options and to provide consistent usage help, use git-rev-parse --parseopt for option parsing. With this, simplify the option parsing code. Signed-off-by: Paul Tan --- Notes: v2 * Don'

[PATCH v2 0/2] Improve git-pull's option parsing

2015-06-02 Thread Paul Tan
is the last required behavior change for my rewrite of git-pull.sh to C. Paul Tan (2): pull: handle git-fetch's options as well pull: use git-rev-parse --parseopt for option parsing Documentation/git-pull.txt | 3 -- git-pull.sh| 128 +++--

[PATCH v2 1/2] pull: handle git-fetch's options as well

2015-06-02 Thread Paul Tan
e to come after git-merge's and git-rebase's options on the command line. Update the documentation to reflect this. Signed-off-by: Paul Tan --- Notes: Improve git-pull's option parsing Previous versions: [v1] http://thread.gmane.org/gmane.comp.version-control.gi

Re: [PATCH/WIP 4/8] am: split out mbox/maildir patches with git-mailsplit

2015-06-02 Thread Paul Tan
On Fri, May 29, 2015 at 7:05 AM, Eric Sunshine wrote: > On Wed, May 27, 2015 at 9:33 AM, Paul Tan wrote: >> @@ -128,13 +190,32 @@ static void am_next(struct am_state *state) >> */ >> +/** >> + * parse_options() callback that validates and sets opt->value to the &g

Re: [PATCH/RFC v2 2/2] git-am: add am.threeWay config variable

2015-06-02 Thread Paul Tan
Hi, On Tue, Jun 2, 2015 at 9:37 PM, Matthieu Moy wrote: > Remi Lespinet writes: > >> +if test "$(git config --bool --get am.threeWay)" = true >> +then >> +threeway=t >> +fi > > I think you missed Paul's remark on this: > > http://article.gmane.org/gmane.comp.version-control.git/270150 > > No

Re: [PATCH] pull: allow dirty tree when rebase.autostash enabled

2015-06-02 Thread Paul Tan
Hi, Some comments which may not necessarily be correct. On Wed, Jun 3, 2015 at 5:55 AM, Kevin Daudt wrote: > rebase learned to stash changes when it encounters a dirty work tree, but > git pull --rebase does not. > > Only verify if the working tree is dirty when rebase.autostash is not > enabled

[PATCH v2 00/19] Make git-pull a builtin

2015-06-02 Thread Paul Tan
This series rewrites git-pull.sh into a C builtin, thus improving its performance and portability. It is part of my GSoC project to rewrite git-pull and git-am into builtins[1]. [1] https://gist.github.com/pyokagan/1b7b0d1f4dab6ba3cef1 Paul Tan (19): parse-options-cb: implement parse_opt_pass_s

[PATCH v2 02/19] parse-options-cb: implement parse_opt_pass_argv_array()

2015-06-02 Thread Paul Tan
ay() parse-options callback, which will reconstruct all the provided command-line options into an argv_array, such that it can be passed to another git command. This is useful for passing command-line options that can be specified multiple times. Signed-off-by: Paul Tan --- Notes: v2

[PATCH v2 01/19] parse-options-cb: implement parse_opt_pass_strbuf()

2015-06-02 Thread Paul Tan
se-options callback, which will reconstruct the command-line option into an strbuf, such that it can be passed to another git command. Helped-by: Johannes Schindelin Signed-off-by: Paul Tan --- Notes: v2 * Previously implemented as a static function in builtin/pull.c. It now

[PATCH v2 07/19] pull: pass git-merge's options to git-merge

2015-06-02 Thread Paul Tan
, --strategy-option: since ee2c795 (Teach git-pull to pass -X to git-merge, 2009-11-25) * -S, --gpg-sign: since ea230d8 (pull: add the --gpg-sign option., 2014-02-10) Signed-off-by: Paul Tan --- Notes: v2 * Use opt_parse_pass_strbuf(), opt_parse_pass_argv_array()

[PATCH v2 09/19] pull: error on no merge candidates

2015-06-02 Thread Paul Tan
arse the heads in FETCH_HEAD for merging, and implementing die_no_merge_candidates(), which will be called when FETCH_HEAD has no heads for merging. Helped-by: Johannes Schindelin Signed-off-by: Paul Tan --- Notes: v2 * Switched to using fprintf_ln() which will append the trailing ne

[PATCH v2 12/19] pull: fast-forward working tree if head is updated

2015-06-02 Thread Paul Tan
Since b10ac50 (Fix pulling into the same branch., 2005-08-25), git-pull, upon detecting that git-fetch updated the current head, will fast-forward the working tree to the updated head commit. Re-implement this behavior. Signed-off-by: Paul Tan --- builtin/pull.c | 30

[PATCH v2 11/19] pull: check if in unresolved merge state

2015-06-02 Thread Paul Tan
handled by die_resolve_conflict(), we introduce a new function die_conclude_merge() for printing a different error message for when there are no unmerged files but the merge has not been finished. Signed-off-by: Paul Tan --- advice.c | 8 advice.h | 1 + builtin/pull.c | 9 ++

[PATCH v2 19/19] pull: remove redirection to git-pull.sh

2015-06-02 Thread Paul Tan
en re-implemented in builtin/pull.c, remove this redirection, and retire the old git-pull.sh into contrib/examples/. Signed-off-by: Paul Tan --- Makefile| 1 - builtin/pull.c | 7 --- git-pull.sh => contrib/examples/git-pull.sh | 0

[PATCH v2 03/19] argv-array: implement argv_array_pushv()

2015-06-02 Thread Paul Tan
When we have a null-terminated array, it would be useful to convert it or append it to an argv_array for further manipulation. Implement argv_array_pushv() which will push a null-terminated array of strings on to an argv_array. Signed-off-by: Paul Tan --- Documentation/technical/api-argv

[PATCH v2 06/19] pull: pass verbosity, --progress flags to fetch and merge

2015-06-02 Thread Paul Tan
introducing the option callback handler parse_opt_passthru(). This callback is used to pass the "--progress" or "--no-progress" command-line switch to git-fetch and git-merge. Signed-off-by: Paul Tan --- Notes: v2 * Use parse_opt_pass_strbuf().

[PATCH v2 14/19] pull: set reflog message

2015-06-02 Thread Paul Tan
t this behavior. Helped-by: Junio C Hamano Signed-off-by: Paul Tan --- Notes: v2 * Don't use strbuf_rtrim(). builtin/pull.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/builtin/pull.c b/builtin/pull.c index f0d4710..c44cc90 100644 --- a/builtin/pull.c

  1   2   3   4   5   6   7   >