Re: [PATCH v2] t4150: fix broken test for am --scissors

2018-08-07 Thread Paul Tan
On Tue, Aug 7, 2018 at 1:42 AM, Andrei Rybak wrote: > On 2018-08-06 10:58, Paul Tan wrote: >>> + git commit -F msg-without-scissors-line && >>> + git tag scissors-used && >> >> Nit: I'm not quite sure about naming the tag "

Re: [PATCH v2] t4150: fix broken test for am --scissors

2018-08-06 Thread Paul Tan
Hi, I've taken a look at the original test, and it is pretty broken. My deepest apologies for this mess. On Sun, Aug 5, 2018 at 2:10 AM, Andrei Rybak wrote: > Tests for "git am --[no-]scissors" [1] work in the following way: > > 1. Create files with commit messages > 2. Use these files to crea

Re: git-rebase --undo-skip proposal

2018-02-15 Thread Paul Tan
tion after 2016. >> >> [1] https://public-inbox.org/git/201311011522.44631.tho...@koch.ro/ >> [2] >> https://public-inbox.org/git/1457779597-6918-1-git-send-email-pyoka...@gmail.com/ > > cc'd Paul Tan, maybe he recalls the situation. It was discarded in favor of Johan

Re: [PATCH 1/5] am: Fix filename in safe_to_abort() error message

2016-12-08 Thread Paul Tan
Hi Stephan, On Thu, Dec 8, 2016 at 5:51 AM, Stephan Beyer wrote: > diff --git a/builtin/am.c b/builtin/am.c > index 6981f42ce..7cf40e6f2 100644 > --- a/builtin/am.c > +++ b/builtin/am.c > @@ -2124,7 +2124,7 @@ static int safe_to_abort(const struct am_state *state) > > if (read_state_file(

Re: [PATCH 1/3] wt-status: implement opportunisitc index update correctly

2016-12-08 Thread Paul Tan
Hi Junio, On Thu, Dec 8, 2016 at 4:48 AM, Stefan Beller wrote: > On Wed, Dec 7, 2016 at 11:41 AM, Junio C Hamano wrote: >> The require_clean_work_tree() function calls hold_locked_index() >> with die_on_error=0 to signal that it is OK if it fails to obtain >> the lock, but unconditionally calls

Re: [PATCH 18/20] builtin/am: convert to struct object_id

2016-08-29 Thread Paul Tan
Hi Brian, On Mon, Aug 29, 2016 at 7:27 AM, brian m. carlson wrote: > Signed-off-by: brian m. carlson > --- > builtin/am.c | 138 > +-- > 1 file changed, 69 insertions(+), 69 deletions(-) I looked through this patch, and the conversion lo

Re: [PATCH] reset cached ident date before creating objects

2016-07-29 Thread Paul Tan
Hi Jeff, On Sat, Jul 30, 2016 at 2:05 AM, Jeff King wrote: > When we compute the date to put in author/committer lines of > commits, or tagger lines of tags, we get the current date > once and then cache it for the rest of the program. This is > a good thing in some cases, like "git commit", bec

Re: [PATCH v3 0/9] Let log-tree and friends respect diffopt's `file` field

2016-06-22 Thread Paul Tan
Hi Johannes, On Tue, Jun 21, 2016 at 10:12 PM, Johannes Schindelin wrote: > Hi Paul, > > On Tue, 21 Jun 2016, Paul Tan wrote: > >> On Tue, Jun 21, 2016 at 6:34 PM, Johannes Schindelin >> wrote: >> > - this uncovered a problem with builtin am, where it asked t

Re: [PATCH v3 0/9] Let log-tree and friends respect diffopt's `file` field

2016-06-21 Thread Paul Tan
Hi Johannes, On Tue, Jun 21, 2016 at 6:34 PM, Johannes Schindelin wrote: > - this uncovered a problem with builtin am, where it asked the diff > machinery to close the file stream, but actually called the log_tree > machinery (which might mean that this patch series inadvertently fixes > a

Re: [BUG?] retrying with "am -3" doesn't work anymore

2016-03-29 Thread Paul Tan
Hi Jeff, On Wed, Mar 30, 2016 at 10:15 AM, Jeff King wrote: > I noticed that I could not get a patch from Junio to apply earlier > today, and I think it is a regression in the builtin git-am > implementation. I had trouble reproducing with a basic test case, > though. > > Basically, I picked up

Re: [PATCH/RFC/GSoC 05/17] rebase-options: implement rebase_options_load() and rebase_options_save()

2016-03-21 Thread Paul Tan
Hi Dscho, (Sorry for the very late reply, I got caught up with some unexpected work and am still clearing my inbox ><) On Thu, Mar 17, 2016 at 1:11 AM, Johannes Schindelin wrote: > On Wed, 16 Mar 2016, Paul Tan wrote: >> On Wed, Mar 16, 2016 at 4:04 PM, Johannes Schindelin >

Re: [PATCH/RFC/GSoC 05/17] rebase-options: implement rebase_options_load() and rebase_options_save()

2016-03-19 Thread Paul Tan
Hi Stefan, On Tue, Mar 15, 2016 at 4:30 AM, Stefan Beller wrote: > On Sat, Mar 12, 2016 at 2:46 AM, Paul Tan wrote: >> These functions can be used for loading and saving common rebase options >> into a state directory. >> >> Signed-off-by: Paul Tan >

Re: [PATCH/RFC/GSoC 00/17] A barebones git-rebase in C

2016-03-19 Thread Paul Tan
On Tue, Mar 15, 2016 at 2:43 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> On Sat, Mar 12, 2016 at 5:46 PM, Paul Tan wrote: >>> So, we have around a 1.4x-1.8x speedup for Linux users, and a 1.7x-13x >>> speedup >>> for Windows users. The annoying l

Re: [PATCH/RFC/GSoC 07/17] rebase-common: implement refresh_and_write_cache()

2016-03-19 Thread Paul Tan
On Tue, Mar 15, 2016 at 5:10 AM, Junio C Hamano wrote: > Paul Tan writes: > >> In the upcoming git-rebase to C rewrite, it is a common operation to >> refresh the index and write the resulting index. >> >> builtin/am.c already implements refresh_and_write_cache(),

Re: [PATCH/RFC/GSoC 16/17] editor: implement git_sequence_editor() and launch_sequence_editor()

2016-03-19 Thread Paul Tan
Hi Dscho, On Tue, Mar 15, 2016 at 3:00 PM, Johannes Schindelin wrote: > On Sat, 12 Mar 2016, Paul Tan wrote: >> --- >> cache.h | 1 + > > No need to clutter cache.h with a function that is only to be used by the > sequencer. IOW let's make this static in sequencer

Re: [PATCH/RFC/GSoC 12/17] rebase-todo: introduce rebase_todo_item

2016-03-19 Thread Paul Tan
Hi Christian, On Mon, Mar 14, 2016 at 9:43 PM, Christian Couder wrote: > On Sat, Mar 12, 2016 at 11:46 AM, Paul Tan wrote: >> In an interactive rebase, commands are read and executed from a todo >> list (.git/rebase-merge/git-rebase-todo) to perform the rebase. >>

Re: [PATCH/RFC/GSoC 01/17] perf: introduce performance tests for git-rebase

2016-03-19 Thread Paul Tan
Hi Dscho, On Wed, Mar 16, 2016 at 3:58 PM, Johannes Schindelin wrote: > Hi Paul, > > On Sat, 12 Mar 2016, Paul Tan wrote: > >> diff --git a/t/perf/p3404-rebase-interactive.sh >> b/t/perf/p3404-rebase-interactive.sh >> new file mode 100755 >> index 000.

Re: [PATCH/RFC/GSoC 05/17] rebase-options: implement rebase_options_load() and rebase_options_save()

2016-03-19 Thread Paul Tan
Hi Dscho, On Wed, Mar 16, 2016 at 4:04 PM, Johannes Schindelin wrote: > In addition I want to point out that sequencer's replay_opts seem to be at > least related, but the patch shares none of its code with the sequencer. > Let's avoid that. > > In other words, let's try to add as little code as

Re: [PATCH/RFC/GSoC 17/17] rebase-interactive: introduce interactive backend for builtin rebase

2016-03-15 Thread Paul Tan
Hi Dscho, On Tue, Mar 15, 2016 at 3:57 PM, Johannes Schindelin wrote: > On Sat, 12 Mar 2016, Paul Tan wrote: > >> Since 1b1dce4 (Teach rebase an interactive mode, 2007-06-25), git-rebase >> supports an interactive mode when passed the -i switch. >> >> In interactive

[PATCH/RFC/GSoC 16/17] editor: implement git_sequence_editor() and launch_sequence_editor()

2016-03-12 Thread Paul Tan
Signed-off-by: Paul Tan --- cache.h | 1 + editor.c | 27 +-- strbuf.h | 1 + 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/cache.h b/cache.h index aa5e97c..d7a6fc6 100644 --- a/cache.h +++ b/cache.h @@ -1222,6 +1222,7 @@ extern const char *fmt_name

[PATCH/RFC/GSoC 13/17] rebase-todo: introduce rebase_todo_list

2016-03-12 Thread Paul Tan
Implement rebase_todo_list, which is a resizable array of rebase_todo_items. Signed-off-by: Paul Tan --- rebase-todo.c | 107 ++ rebase-todo.h | 27 +++ 2 files changed, 134 insertions(+) diff --git a/rebase-todo.c b/rebase

[PATCH/RFC/GSoC 08/17] rebase-common: let refresh_and_write_cache() take a flags argument

2016-03-12 Thread Paul Tan
refresh_cache(). Signed-off-by: Paul Tan --- builtin/am.c| 2 +- rebase-common.c | 4 ++-- rebase-common.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index 504b604..5185719 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -1815,7 +1815,7

[PATCH/RFC/GSoC 12/17] rebase-todo: introduce rebase_todo_item

2016-03-12 Thread Paul Tan
. Implement rebase_todo_item for this. Signed-off-by: Paul Tan --- Makefile | 1 + rebase-todo.c | 144 ++ rebase-todo.h | 28 3 files changed, 173 insertions(+) create mode 100644 rebase-todo.c create mode 100644 rebase-todo.h

[PATCH/RFC/GSoC 10/17] rebase-common: implement cache_has_uncommitted_changes()

2016-03-12 Thread Paul Tan
so that it can be shared between all rebase backends and git-pull. Signed-off-by: Paul Tan --- builtin/pull.c | 22 +- rebase-common.c | 17 + rebase-common.h | 5 + 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/builtin/pull.c b

[PATCH/RFC/GSoC 14/17] status: use rebase_todo_list

2016-03-12 Thread Paul Tan
rebase's todo lists with rebase_todo_list_parse(), use it in wt-status.c to reduce the amount of code needed to implement this feature. Signed-off-by: Paul Tan --- This patch is just an illustration, and is not quite right as it does not strip comments and blank lines like the original did.

[PATCH/RFC/GSoC 06/17] rebase-am: introduce am backend for builtin rebase

2016-03-12 Thread Paul Tan
d teardown sequence in the shared functions rebase_common_setup() and rebase_common_finish(), so we can share code with the merge backend when it is implemented in a later patch. Signed-off-by: Paul Tan --- Makefile | 1 + builtin/rebase.c | 25 + rebase-am.c

[PATCH/RFC/GSoC 09/17] rebase-common: implement cache_has_unstaged_changes()

2016-03-12 Thread Paul Tan
git-pull. Signed-off-by: Paul Tan --- builtin/pull.c | 19 ++- rebase-common.c | 14 ++ rebase-common.h | 5 + 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/builtin/pull.c b/builtin/pull.c index 10eff03..9e65dc9 100644 --- a/builtin/pull.c

[PATCH/RFC/GSoC 11/17] rebase-merge: introduce merge backend for builtin rebase

2016-03-12 Thread Paul Tan
version is only able to re-apply commits using the merge-recursive strategy, and is unable to resume from a conflict. Subsequent patches will re-implement all the missing features. Signed-off-by: Paul Tan --- Makefile | 1 + builtin/rebase.c | 17 +++- rebase-merge.c | 256

[PATCH/RFC/GSoC 07/17] rebase-common: implement refresh_and_write_cache()

2016-03-12 Thread Paul Tan
-am. Signed-off-by: Paul Tan --- builtin/am.c| 14 +- rebase-common.c | 11 +++ rebase-common.h | 5 + 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index d003939..504b604 100644 --- a/builtin/am.c +++ b/builtin/am.c

[PATCH/RFC/GSoC 17/17] rebase-interactive: introduce interactive backend for builtin rebase

2016-03-12 Thread Paul Tan
tches. Re-implement a skeletal version of the above feature by introducing a rebase-interactive backend for our builtin-rebase. This skeletal implementation is only able to pick and re-order commits. Signed-off-by: Paul Tan --- Makefile | 1 + builtin/rebase.c | 17 ++- r

[PATCH/RFC/GSoC 15/17] wrapper: implement append_file()

2016-03-12 Thread Paul Tan
Signed-off-by: Paul Tan --- cache.h | 1 + wrapper.c | 23 +++ 2 files changed, 24 insertions(+) diff --git a/cache.h b/cache.h index 55d443e..aa5e97c 100644 --- a/cache.h +++ b/cache.h @@ -1700,6 +1700,7 @@ static inline ssize_t write_str_in_full(int fd, const char *str

[PATCH/RFC/GSoC 04/17] builtin-rebase: parse rebase arguments into a common rebase_options struct

2016-03-12 Thread Paul Tan
arguments and store them in a rebase_options struct. In later patches we will pass the rebase_options struct to the appropriate backend to perform the rebase. Signed-off-by: Paul Tan --- Makefile | 1 + builtin/rebase.c | 184

[PATCH/RFC/GSoC 05/17] rebase-options: implement rebase_options_load() and rebase_options_save()

2016-03-12 Thread Paul Tan
These functions can be used for loading and saving common rebase options into a state directory. Signed-off-by: Paul Tan --- rebase-common.c | 69 + rebase-common.h | 4 2 files changed, 73 insertions(+) diff --git a/rebase-common.c

[PATCH/RFC/GSoC 03/17] builtin-rebase: implement skeletal builtin rebase

2016-03-12 Thread Paul Tan
Signed-off-by: Paul Tan --- Makefile | 5 + builtin.h| 1 + builtin/rebase.c | 31 +++ git.c| 1 + 4 files changed, 34 insertions(+), 4 deletions(-) create mode 100644 builtin/rebase.c diff --git a/Makefile b/Makefile index 24bef8d

[PATCH/RFC/GSoC 02/17] sha1_name: implement get_oid() and friends

2016-03-12 Thread Paul Tan
*() functions which wrap the corresponding get_sha1_*() functions. Signed-off-by: Paul Tan --- cache.h | 6 ++ sha1_name.c | 30 ++ 2 files changed, 36 insertions(+) diff --git a/cache.h b/cache.h index b829410..55d443e 100644 --- a/cache.h +++ b/cache.h

[PATCH/RFC/GSoC 00/17] A barebones git-rebase in C

2016-03-12 Thread Paul Tan
files, which means that wt-status.c and rebase-interactive.c can share the same parsing code. Although not in this patch series, rebase-interactive.c can also now share the same author-script parsing and writing code from builtin/am.c as well. Regards, Paul Paul Tan (17): perf: introduce performance

[PATCH/RFC/GSoC 01/17] perf: introduce performance tests for git-rebase

2016-03-12 Thread Paul Tan
To determine the speedup (or slowdown) of the upcoming git-rebase rewrite to C, add a simple performance test for each of the 3 git-rebase backends (am, merge and interactive). Signed-off-by: Paul Tan --- t/perf/p3400-rebase.sh | 25 + t/perf/p3402-rebase

Re: [PATCH v7 2/2] pull --rebase: add --[no-]autostash flag

2016-03-10 Thread Paul Tan
> overrides the current value of rebase.autoStash, if set. As "git rebase" > understands the --[no-]autostash option, it's just a matter of passing > the option to underlying "git rebase" when "git pull --rebase" is called. > > Helped-by: Matthieu M

Re: [PATCH v3 3/3] Documentation/git-pull: document --[no-]autostash option

2016-03-04 Thread Paul Tan
On Fri, Mar 4, 2016 at 12:13 AM, Mehul Jain wrote: > Signed-off-by: Mehul Jain > --- > Documentation/git-pull.txt | 15 +++ > 1 file changed, 15 insertions(+) > > diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt > index a62a2a6..a593972 100644 > --- a/Documentatio

Re: [PATCH v3 1/3] pull --rebase: add --[no-]autostash flag

2016-03-04 Thread Paul Tan
On Fri, Mar 4, 2016 at 12:13 AM, Mehul Jain wrote: > diff --git a/builtin/pull.c b/builtin/pull.c > index 10eff03..b338b83 100644 > --- a/builtin/pull.c > +++ b/builtin/pull.c > @@ -85,6 +85,7 @@ static char *opt_squash; > static char *opt_commit; > static char *opt_edit; > static char *opt_ff;

Re: [PATCH v2 1/2] pull --rebase: add --[no-]autostash flag

2016-02-28 Thread Paul Tan
Hi Junio, On Sun, Feb 28, 2016 at 3:26 AM, Junio C Hamano wrote: > Mehul Jain writes: >> @@ -835,13 +841,10 @@ int cmd_pull(int argc, const char **argv, const char >> *prefix) >> hashclr(orig_head); >> >> if (opt_rebase) { >> - int autostash = 0; >> - >>

Re: [PATCH] Add --no-autostash flag to git pull --rebase

2016-02-26 Thread Paul Tan
On Fri, Feb 26, 2016 at 7:23 PM, Mehul Jain wrote: > Subject: [PATCH] Add --no-autostash flag to git pull --rebase We usually don't capitalize the first word of the commit title. We also usually prefix the commit title with the relevant subsystem, file or command. So something like: pull --rebas

Re: [GSoC] Microproject :- Teaching git pull --rebase the --no-autostash flag

2016-02-26 Thread Paul Tan
On Fri, Feb 26, 2016 at 7:23 PM, Mehul Jain wrote: > With this patch, git pull --rebase will understand --no-autostash command > line flag. > This flag will override "rebase.autostash" configuration(if set) and leads to > a > failure if current working directory is dirty. If "rebase.autostash" i

Re: [PATCH 0/2] Reinstate the helpful message when `git pull --rebase` fails

2015-10-08 Thread Paul Tan
On Fri, Oct 9, 2015 at 8:52 AM, Junio C Hamano wrote: > Johannes Schindelin writes: > >> Brendan Forster noticed that we no longer see the helpful message after >> a failed `git pull --rebase`. It turns out that the builtin `am` calls >> the recursive merge function directly, not via a separate p

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: [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: 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: 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

[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: [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 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-

[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

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

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 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 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

[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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

  1   2   3   4   5   6   7   >