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

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

Re: git-rebase --undo-skip proposal

2018-02-15 Thread Paul Tan
in C [2]? I couldn't find >> any information 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 situ

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

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

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

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

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 <johannes.schinde...@gmx.de> wrote: > Hi Paul, > > On Tue, 21 Jun 2016, Paul Tan wrote: > >> On Tue, Jun 21, 2016 at 6:34 PM, Johannes Schindelin >> <johannes.schinde...@gmx.de> wrote: >>

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

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

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 <johannes.schinde...@gmx.de> wrote: > On Wed, 16 Mar 2016, Paul Tan wrote: >> On Wed, Mar 16, 2016

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 <sbel...@google.com> wrote: > On Sat, Mar 12, 2016 at 2:46 AM, Paul Tan <pyoka...@gmail.com> wrote: >> These functions can be used for loading and saving common rebase options >> into a state directory. >>

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 <gits...@pobox.com> wrote: > Duy Nguyen <pclo...@gmail.com> writes: > >> On Sat, Mar 12, 2016 at 5:46 PM, Paul Tan <pyoka...@gmail.com> wrote: >>> So, we have around a 1.4x-1.8x speedup for Linux users, and

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 <gits...@pobox.com> wrote: > Paul Tan <pyoka...@gmail.com> writes: > >> In the upcoming git-rebase to C rewrite, it is a common operation to >> refresh the index and write the resulting index. >>

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 <johannes.schinde...@gmx.de> 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 m

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 <christian.cou...@gmail.com> wrote: > On Sat, Mar 12, 2016 at 11:46 AM, Paul Tan <pyoka...@gmail.com> wrote: >> In an interactive rebase, commands are read and executed from a todo >> list (.git/r

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 <johannes.schinde...@gmx.de> 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 m

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

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 <johannes.schinde...@gmx.de> 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 swit

[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 <pyoka...@gmail.com> --- 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 @@

[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 <pyoka...@gmail.com> --- rebase-todo.c | 107 ++ rebase-todo.h | 27 +++ 2 files changed, 134 insertions(+) diff

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

2016-03-12 Thread Paul Tan
to refresh_cache(). Signed-off-by: Paul Tan <pyoka...@gmail.com> --- 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/builti

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

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

[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 <pyoka...@gmail.com> --- builtin/pull.c | 22 +- rebase-common.c | 17 + rebase-common.h | 5 + 3 files changed, 23 insertions(+), 21 deletions(-) diff

[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 <pyoka...@gmail.com> --- This patch is just an illustration, and is not quite right as it does not strip comments and blank line

[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 <pyoka...@gmail.com> --- Makefile | 1 + builtin/rebase.c | 25 ++

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

2016-03-12 Thread Paul Tan
and git-pull. Signed-off-by: Paul Tan <pyoka...@gmail.com> --- 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

[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 <pyoka...@gmail.com> --- Makefile | 1 + builtin/rebase.c | 17 +++-

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

2016-03-12 Thread Paul Tan
-am. Signed-off-by: Paul Tan <pyoka...@gmail.com> --- 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/builti

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

2016-03-12 Thread Paul Tan
. 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 <pyoka...@gmail.com> --- Makefile | 1 + builtin/re

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

2016-03-12 Thread Paul Tan
Signed-off-by: Paul Tan <pyoka...@gmail.com> --- 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_fu

[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 <pyoka...@gmail.com> --- rebase-common.c | 69 + rebase-common.h | 4 2 files changed, 73 insertions(+)

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

2016-03-12 Thread Paul Tan
Signed-off-by: Paul Tan <pyoka...@gmail.com> --- 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/Make

[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 <pyoka...@gmail.com> --- 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/c

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

2016-03-12 Thread Paul Tan
, 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 tests

[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 <pyoka...@gmail.com> --- t/perf/p3400-rebase.sh | 25 ++

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

2016-03-10 Thread Paul Tan
Helped-by: Matthieu Moy <matthieu....@grenoble-inp.fr> > Helped-by: Junio C Hamano <gits...@pobox.com> > Helped-by: Paul Tan <pyoka...@gmail.com> > Helped-by: Eric Sunshine <sunsh...@sunshineco.com> > Signed-off-by: Mehul Jain <mehul.jain2...@gmail.com> &g

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

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

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

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

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

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

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

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

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 >

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.

[PATCH] am: terminate state files with a newline

2015-08-22 Thread Paul Tan
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 sze...@ira.uka.de Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 30 +++--- 1 file changed, 15 insertions(+), 15

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

2015-08-19 Thread Paul Tan
Torvalds torva...@linux-foundation.org Helped-by: Junio C Hamano gits...@pobox.com Signed-off-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c| 49 - t/t4151-am-abort.sh | 24

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 matthieu@grenoble-inp.fr 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.

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

2015-08-17 Thread Paul Tan
that the stat info from the index is kept. Reported-by: Linus Torvalds torva...@linux-foundation.org Signed-off-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c| 49 - t/t4151-am

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 sunsh...@sunshineco.com 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

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 johannes.schinde...@gmx.de 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)

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 pyoka...@gmail.com 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

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

2015-08-04 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 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 gits...@pobox.com Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 107 +-- 1

[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 pyoka...@gmail.com --- builtin/am.c | 45 + 1 file changed

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

2015-08-04 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 v7 02/45] wrapper: implement xfopen()

2015-08-04 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 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 gits...@pobox.com Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 72 +++- 1 file changed, 71 insertions(+), 1 deletion(-) diff

[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 sbel...@google.com Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes: v7 * Add a free

[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 sbel...@google.com Signed-off-by: Paul Tan pyoka...@gmail.com

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

2015-08-04 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 --- Notes: v7 * Since a5481a6 (convert enum date_mode

[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
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 a02c84e..47dd4c7

[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 pyoka...@gmail.com --- builtin/am.c

[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 pyoka...@gmail.com

[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 pyoka...@gmail.com

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

2015-08-04 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 a5d5e8c..440a653 100644 --- a/builtin/am.c +++ b

[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 sbel...@google.com Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 11 ++- 1 file changed, 10 insertions(+), 1 deletion

[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 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 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 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 v7 28/45] builtin-am: implement --[no-]scissors

2015-08-04 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 v7 38/45] builtin-am: rerere support

2015-08-04 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 v7 12/45] builtin-am: don't parse mail when resuming

2015-08-04 Thread Paul Tan
. Re-implement this in builtin/am.c. Signed-off-by: Paul Tan pyoka...@gmail.com --- 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
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 v7 26/45] builtin-am: implement --[no-]message-id, am.messageid

2015-08-04 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 68dca2e..8e97839 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -98,6 +98,7 @@ struct am_state { int

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

2015-08-04 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 84d3e05..1561580 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -108,6 +108,7 @@ struct am_state { int scissors; /* enum scissors_type

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

[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 pyoka...@gmail.com --- builtin/am.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/builtin/am.c b/builtin/am.c index 6c24d07..d4b4b86

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

2015-08-04 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 7d7f91d..f0e3aab 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -456,6 +456,27 @@ static void am_destroy(const struct

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

2015-08-04 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 v7 45/45] builtin-am: remove redirection to git-am.sh

2015-08-04 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 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 pyoka...@gmail.com --- Notes: v7 * As support for am.threeWay was removed in master, this patch now

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

2015-08-04 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 d82d07e..3c2ec15 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -80,7 +80,8

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

2015-08-04 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 v7 11/45] builtin-am: implement --resolved/--continue

2015-08-04 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 | 72 +++- 1 file changed, 71 insertions(+), 1 deletion(-) diff --git

[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 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 v7 44/45] builtin-am: check for valid committer ident

2015-08-04 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 v7 29/45] builtin-am: pass git-apply's options to git-apply

2015-08-04 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 727cfb8..f842f69 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -106,6 +106,7 @@ struct

[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 pyoka...@gmail.com

[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 sbel...@google.com Signed-off-by: Paul Tan pyoka...@gmail.com --- Notes: v7

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

2015-08-04 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 v7 04/45] builtin-am: implement patch queue mechanism

2015-08-04 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 v7 00/45] Make git-am a builtin

2015-08-04 Thread Paul Tan
. 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: implement xfopen() builtin-am: implement

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

2015-08-04 Thread Paul Tan
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 builtin/am.c | 42 --- t

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

2015-08-04 Thread Paul Tan
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 /dev/zero Cc: Jonathan Nieder jrnie...@gmail.com Cc: Jeff King p...@peff.net Signed-off-by: Paul Tan pyoka...@gmail.com --- t/test-terminal.perl | 25

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

2015-08-04 Thread Paul Tan
Helped-by: Junio C Hamano gits...@pobox.com Helped-by: Jeff King p...@peff.net Signed-off-by: Paul Tan pyoka...@gmail.com --- builtin/am.c | 16 ++-- t/t4153-am-resume-override-opts.sh | 82 ++ 2 files changed, 94 insertions(+), 4

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

2015-08-04 Thread Paul Tan
to the commit message when resuming if so. Signed-off-by: Paul Tan pyoka...@gmail.com --- 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

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

2015-08-04 Thread Paul Tan
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 builtin/am.c | 42 --- t

  1   2   3   4   5   6   7   >