[PATCH] Documentation: clarify signature verification v2

2016-05-11 Thread Fox in the shell
Hi, Here is a second attempt at this patch. Sorry for the delay, life somewhat got in the way. -- Clarify which commits need to be signed. Uniformise the vocabulary used wrt. key/signature validity with OpenPGP: - a signature is valid if made by a key with a valid uid; - in the default trust-mod

Re: t5551 hangs ?

2016-05-11 Thread Jeff King
On Thu, May 12, 2016 at 08:21:10AM +0200, Torsten Bögershausen wrote: > This is the last log that I see: > [...] > ++ git -C too-many-refs fetch -q --tags Not surprising. > And this may be the processes : > (Not sure, probaly need to reboot & clean ?) If you're killing the hung test with "^C",

Re: t5551 hangs ?

2016-05-11 Thread Torsten Bögershausen
On 12.05.16 05:16, Jeff King wrote: > On Wed, May 11, 2016 at 10:03:45PM +0200, Torsten Bögershausen wrote: > >>> If you are, can you confirm that it's actually hanging, and not just >>> slow? On my system, test 26 takes about a minute to run (which is why we >>> don't do it by default). >> Nearly

Re: [PATCH 24/25] worktree move: accept destination as directory

2016-05-11 Thread Johannes Sixt
Am 11.05.2016 um 23:34 schrieb Junio C Hamano: Johannes Sixt writes: As this path is read from a file git itself creates, and if we know that it will always contain forward slashes, then I agree that it could be potentially confusing to later readers to see git_find_last_dir_sep(). So, keeping

Re: [PATCH 0/7] submodule groups

2016-05-11 Thread Junio C Hamano
Stefan Beller writes: > If you have lots of submodules, you probably don't need all of them at once, > but you have functional units. Some submodules are absolutely required, > some are optional and only for very specific purposes. > > This patch series adds labels to submodules in the .gitmodule

[PATCH v6 3/3] bisect--helper: `write_terms` shell function in C

2016-05-11 Thread Pranit Bauva
Reimplement the `write_terms` shell function in C and add a `write-terms` subcommand to `git bisect--helper` to call it from git-bisect.sh . Also remove the subcommand `--check-term-format` as it can now be called from inside the function write_terms() C implementation. Using `--write-terms` subco

[PATCH v6 1/3] bisect--helper: use OPT_CMDMODE instead of OPT_BOOL

2016-05-11 Thread Pranit Bauva
`--next-all` is meant to be used as a subcommand to support multiple "operation mode" though the current implementation does not contain any other subcommand along side with `--next-all` but further commits will include some more subcommands. Helped-by: Johannes Schindelin Mentored-by: Lars Schne

[PATCH v6 2/3] bisect: rewrite `check_term_format` shell function in C

2016-05-11 Thread Pranit Bauva
Reimplement the `check_term_format` shell function in C and add a `--check-term-format` subcommand to `git bisect--helper` to call it from git-bisect.sh Using `--check-term-format` subcommand is a temporary measure to port shell function to C so as to use the existing test suite. As more functions

[PATCH v6 0/3] bisect--helper: check_term_format() & write_terms()

2016-05-11 Thread Pranit Bauva
To show how I am going to approach conversion of shell function to its C implementation by using the subcommand/cmdmode approach, I have first converted check_terms_format() to a subcommand then I have converted write_terms() to a subcommand and then remove the subcommand for check_terms_format() a

Re: [PATCH 2/2] am: plug FILE * leak in split_mail_conv()

2016-05-11 Thread Jeff King
On Thu, May 12, 2016 at 07:23:02AM +0200, Mikael Magnusson wrote: > >> - if (!out) > >> + if (!out) { > >> + fclose(in); > >> return error(_("could not open '%s' for writing: > >> %s"), > >> ma

Re: [PATCH 2/2] am: plug FILE * leak in split_mail_conv()

2016-05-11 Thread Mikael Magnusson
On Thu, May 12, 2016 at 6:47 AM, Jeff King wrote: > On Wed, May 11, 2016 at 04:35:46PM -0700, Junio C Hamano wrote: > >> Signed-off-by: Junio C Hamano >> --- >> builtin/am.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/builtin/am.c b/builtin/am.c >> index f1a84c

Re: [PATCH 2/2] am: plug FILE * leak in split_mail_conv()

2016-05-11 Thread Jeff King
On Wed, May 11, 2016 at 04:35:46PM -0700, Junio C Hamano wrote: > Signed-off-by: Junio C Hamano > --- > builtin/am.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/builtin/am.c b/builtin/am.c > index f1a84c6..a373928 100644 > --- a/builtin/am.c > +++ b/builtin/am.c

Re: [PATCH 0/7] submodule groups

2016-05-11 Thread Junio C Hamano
Junio C Hamano writes: > I'd suggest not to over-engineer this. Go back and imagine how > "/bin/ls" would work is a good sanity check to gauge what complexity > levels ordinary users would feel comfortable to handle. > > "ls a b" would give union of what "ls a" and "ls b" would output, > there i

Re: t5551 hangs ?

2016-05-11 Thread Jeff King
On Wed, May 11, 2016 at 10:03:45PM +0200, Torsten Bögershausen wrote: > > If you are, can you confirm that it's actually hanging, and not just > > slow? On my system, test 26 takes about a minute to run (which is why we > > don't do it by default). > Nearly sure. After 10 minutes, the test was sti

Re: [PATCH 0/7] submodule groups

2016-05-11 Thread Junio C Hamano
Stefan Beller writes: > git submodule--helper matches-submodulespec sub0 ./. > ./:(exclude)*0 *label-sub0 > > which should test if the first argument (sub0) matches the submodulespec > which follows. This, according to that "OR'ed together" definition, asks to find a submodule - whose p

Re: [PATCH 0/7] submodule groups

2016-05-11 Thread Stefan Beller
On Wed, May 11, 2016 at 4:48 PM, Junio C Hamano wrote: > Junio C Hamano writes: > >>> git ls-files . :(file-size:>1024k) >> >> I somehow do not think this is a way normal people (read: end users) >> would want to interact with Git. Pathspec is about "paths" and >> various ways to match them.

Re: [PATCH 0/7] submodule groups

2016-05-11 Thread Junio C Hamano
Junio C Hamano writes: >> git ls-files . :(file-size:>1024k) > > I somehow do not think this is a way normal people (read: end users) > would want to interact with Git. Pathspec is about "paths" and > various ways to match them. It is not about contents that happens > to be currently named by

Re: [PATCH 0/7] submodule groups

2016-05-11 Thread Junio C Hamano
Stefan Beller writes: > So I wonder if we rather want to extend the pathspec magic to > include properties of blobs (i.e. submodules): > > git . :(sub-label:label-sub0) :(exclude)*0 > > would look much more powerful too me. Properties of blobs > may also be interesting for otherwise. Imagine

[PATCH 2/2] am: plug FILE * leak in split_mail_conv()

2016-05-11 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- builtin/am.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin/am.c index f1a84c6..a373928 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -761,9 +761,11 @@ static int split_mail_conv(mail_conv_fn fn, struct am_state *

[PATCH 1/2] am: plug small memory leak when split_mail_stgit_series() fails

2016-05-11 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- builtin/am.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/am.c b/builtin/am.c index ec75906..f1a84c6 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -842,9 +842,11 @@ static int split_mail_stgit_series(struct am_state *state, co

[PATCH] rerere: plug memory leaks upon "rerere forget" failure

2016-05-11 Thread Junio C Hamano
Signed-off-by: Junio C Hamano --- rerere.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/rerere.c b/rerere.c index 1693866..a804171 100644 --- a/rerere.c +++ b/rerere.c @@ -1052,8 +1052,8 @@ static int rerere_forget_one_path(const char *path, str

Re: [PATCH 0/7] submodule groups

2016-05-11 Thread Stefan Beller
On Tue, May 10, 2016 at 7:08 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> I started from scratch as I think there were some sharp edges in the design. >> My thinking shifted from "submodule groups" towards "actually it's just an >> enhanced pathspec, called submodulespec". > > Except fo

What's cooking in git.git (May 2016, #04; Wed, 11)

2016-05-11 Thread Junio C Hamano
Here are the topics that have been cooking. Commits prefixed with '-' are only in 'pu' (proposed updates) while commits prefixed with '+' are in 'next'. The ones marked with '.' do not appear in any of the integration branches, but I am still holding onto them. The 'master' branch now has the el

Re: [PATCH] diff: run arguments through precompose_argv

2016-05-11 Thread Junio C Hamano
Alexander Rinass writes: >> On 05 Apr 2016, at 21:15, Johannes Sixt wrote: >> >> Am 05.04.2016 um 19:09 schrieb Junio C Hamano: Thanks-to: Torsten Bögershausen >> >> I sense NFD disease: The combining diaresis should combine with the o, not >> the g. Here is a correct line to copy-and-

Re: [PATCH 3/7] submodule-config: keep labels around

2016-05-11 Thread Stefan Beller
+Heiko On Wed, May 11, 2016 at 2:28 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> On Tue, May 10, 2016 at 6:15 PM, Junio C Hamano wrote: >>> Stefan Beller writes: >>> @@ -199,6 +203,7 @@ static struct submodule *lookup_or_create_by_name(struct submodule_cache *cache,

Re: Pre-Process Files for Commits and Pulls

2016-05-11 Thread Junio C Hamano
Brandon Teska writes: > 1. Person A works on (binary) file locally > 2. Person A commits and pushes to the repo > 3. Before the push, a script deconstructs the binary file into several > text files > 4. Those text files are pushed A smudge/clean filter pair is how this is done, but you need to d

Re: [PATCH] Documentation/git-mailinfo: fix typo

2016-05-11 Thread Junio C Hamano
Thanks. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH 24/25] worktree move: accept destination as directory

2016-05-11 Thread Junio C Hamano
Johannes Sixt writes: >> As this path is read from a file git itself creates, and if we know >> that it will always contain forward slashes, then I agree that it >> could be potentially confusing to later readers to see >> git_find_last_dir_sep(). So, keeping it as-is seems correct. > > Please al

Re: [PATCH 3/7] submodule-config: keep labels around

2016-05-11 Thread Junio C Hamano
Stefan Beller writes: > On Tue, May 10, 2016 at 6:15 PM, Junio C Hamano wrote: >> Stefan Beller writes: >> >>> @@ -199,6 +203,7 @@ static struct submodule >>> *lookup_or_create_by_name(struct submodule_cache *cache, >>> submodule->update_strategy.command = NULL; >>> submodule->fetc

Re: wishlist; unify behavior while cloning non-bare repos over http to be in line with ssh/local

2016-05-11 Thread Junio C Hamano
Yaroslav Halchenko writes: > On Tue, 10 May 2016, Junio C Hamano wrote: >> >> The necessary update to the client might be as simple as using >> >> $GIVEN_URL/.git/ and attempting the request again after seeing the >> >> probe for $GIVEN_URL/info/refs fails. > >> > Sure -- workarounds are possible

Re: [PATCH v2 3/3] Add a perf test for rebase -i

2016-05-11 Thread Junio C Hamano
Johannes Schindelin writes: > diff --git a/t/perf/p3404-rebase-interactive.sh > b/t/perf/p3404-rebase-interactive.sh > new file mode 100755 > index 000..382163c > --- /dev/null > +++ b/t/perf/p3404-rebase-interactive.sh > @@ -0,0 +1,31 @@ > +#!/bin/sh > + > +test_description='Tests rebase -i

Re: [PATCH] Windows: only add a no-op pthread_sigmask() when needed

2016-05-11 Thread Junio C Hamano
Johannes Schindelin writes: > So I guess that you're preferring my 2. above. Going on that assumption, I > will send out another iteration. OK. >> Also is >> https://lists.gnu.org/archive/html/bug-gnulib/2015-04/msg00068.html >> relevant? Does /mingw64/x86_64-w64-mingw32/include/ implement "ma

Pre-Process Files for Commits and Pulls

2016-05-11 Thread Brandon Teska
Hi everyone, I have an unusual question. I'm curious if git can pre-process files before pushing them to a remote repo and then reprocess them on pulls. Basically, I'm trying to work collaboratively with a few colleagues on a project using another software program. I've decoded the file we've been

[PATCH] Documentation/git-mailinfo: fix typo

2016-05-11 Thread Vasco Almeida
Signed-off-by: Vasco Almeida --- Documentation/git-mailinfo.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/git-mailinfo.txt b/Documentation/git-mailinfo.txt index 0947084..3bbc731 100644 --- a/Documentation/git-mailinfo.txt +++ b/Documentation/git-mailinfo.t

Re: t5551 hangs ?

2016-05-11 Thread Torsten Bögershausen
On 11.05.16 19:31, Jeff King wrote: > On Wed, May 11, 2016 at 07:13:56PM +0200, Torsten Bögershausen wrote: > >> On 10.05.16 09:08, Johannes Schindelin wrote: >> - I'm not sure, if this is the right thread to report on - >> >> It seems as if t5551 is hanging ? >> This is the last line from the log

[PATCH v4] gitk: Add Portuguese translation

2016-05-11 Thread Vasco Almeida
Signed-off-by: Vasco Almeida --- Oops, fix typo. #: gitk:3081 #, tcl-format msgid "<%s-Down>\tScroll commit list down one line" msgstr [-"<%s-Baixo>\tDescolar-]{+"<%s-Baixo>\tDeslocar+} a lista de commits uma linha para baixo" po/pt_pt.po | 1376 +++

Re: [PATCH 24/25] worktree move: accept destination as directory

2016-05-11 Thread Johannes Sixt
Am 11.05.2016 um 19:32 schrieb Eric Sunshine: On Wed, May 11, 2016 at 9:34 AM, Duy Nguyen wrote: On Wed, May 11, 2016 at 11:43 AM, Eric Sunshine wrote: On Wed, Apr 13, 2016 at 9:15 AM, Nguyễn Thái Ngọc Duy wrote: + if (is_directory(dst.buf)) { + const char *sep = strrchr

Re: [PATCH v2 2/3] perf: make the tests work in worktrees

2016-05-11 Thread Eric Sunshine
On Wed, May 11, 2016 at 4:42 AM, Johannes Schindelin wrote: > This patch makes perf-lib.sh more robust so that it can run correctly > even inside a worktree. For example, it assumed that $GIT_DIR/objects is > the objects directory (which is not the case for worktrees) and it used > the commondir f

Re: [PATCH 3/7] submodule-config: keep labels around

2016-05-11 Thread Stefan Beller
On Tue, May 10, 2016 at 6:15 PM, Junio C Hamano wrote: > Stefan Beller writes: > >> @@ -199,6 +203,7 @@ static struct submodule *lookup_or_create_by_name(struct >> submodule_cache *cache, >> submodule->update_strategy.command = NULL; >> submodule->fetch_recurse = RECURSE_SUBMODULES_N

Re: [PATCH 24/25] worktree move: accept destination as directory

2016-05-11 Thread Eric Sunshine
On Wed, May 11, 2016 at 9:34 AM, Duy Nguyen wrote: > On Wed, May 11, 2016 at 11:43 AM, Eric Sunshine > wrote: >> On Wed, Apr 13, 2016 at 9:15 AM, Nguyễn Thái Ngọc Duy >> wrote: >>> + if (is_directory(dst.buf)) { >>> + const char *sep = strrchr(wt->path, '/'); >> >> Does thi

Re: t5551 hangs ?

2016-05-11 Thread Jeff King
On Wed, May 11, 2016 at 07:13:56PM +0200, Torsten Bögershausen wrote: > On 10.05.16 09:08, Johannes Schindelin wrote: > - I'm not sure, if this is the right thread to report on - > > It seems as if t5551 is hanging ? > This is the last line from the log: > ok 25 - large fetch-pack requests can be

Re: [PATCH 2/7] submodule add: label submodules if asked to

2016-05-11 Thread Stefan Beller
>> +cat >expect <<-EOF >> +labelA >> +labelB >> +EOF >> + >> +test_expect_success 'submodule add records multiple labels' ' > > The existing tests in this file may be littered with this bad > construct, but please do not add more example of running things > outside of test_expect_{success,failure}

t5551 hangs ?

2016-05-11 Thread Torsten Bögershausen
On 10.05.16 09:08, Johannes Schindelin wrote: - I'm not sure, if this is the right thread to report on - It seems as if t5551 is hanging ? This is the last line from the log: ok 25 - large fetch-pack requests can be split across POSTs I have 7 such processes running: /trash directory.t5551-http-f

Re: Re: [RFD/PATCH] submodule doc: describe where we can configure them

2016-05-11 Thread Heiko Voigt
On Mon, May 09, 2016 at 10:32:50AM -0700, Stefan Beller wrote: > >> Here is what I imagine > >> When B mirrors from A, B sets up this special ref for its repository, > >> e.g. refs/meta/submodule-B and have a symbolic ref pointing at that. > >> (e.g. SUBMODULE_CONFIG pointing at refs/meta/submodule

Re: [RFD/PATCH] submodule doc: describe where we can configure them

2016-05-11 Thread Heiko Voigt
On Mon, May 09, 2016 at 09:19:44AM -0700, Junio C Hamano wrote: > Heiko Voigt writes: > > >> > - When upstream adds a new submodule, I have to do the same manual > >> > work to change the options for that new submodule. > >> > >> Because a new module is not automatically "init"ed by default? >

[ANNOUNCE] Git Rev News edition 15

2016-05-11 Thread Christian Couder
Hi everyone, I'm happy announce that the 15th edition of Git Rev News is now published: http://git.github.io/rev_news/2016/05/11/edition-15/ Thanks a lot to all the contributors and helpers, especially David Turner! Enjoy, Christian, Thomas and Nicola. -- To unsubscribe from this list: send the

[PATCH v2] Windows: only add a no-op pthread_sigmask() when needed

2016-05-11 Thread Johannes Schindelin
In f924b52 (Windows: add pthread_sigmask() that does nothing, 2016-05-01), we introduced a no-op for Windows. However, this breaks building Git in Git for Windows' SDK because pthread_sigmask() is already a no-op there, #define'd in the pthread_signal.h header in /mingw64/x86_64-w64-mingw32/include

Re: [PATCH] Windows: only add a no-op pthread_sigmask() when needed

2016-05-11 Thread Johannes Schindelin
Hi Junio, On Tue, 10 May 2016, Junio C Hamano wrote: > Johannes Schindelin writes: > > > In f924b52 (Windows: add pthread_sigmask() that does nothing, > > 2016-05-01), we introduced a no-op for Windows. However, this breaks > > building Git in Git for Windows' SDK because pthread_sigmask() is >

Re: Bug: `git-filter-branch −−subdirectory−filter` fails on Darwin, others?

2016-05-11 Thread Geoff Nixon
On Wed, 11 May 2016 07:08:02 -0700 Jeff King wrote > On Wed, May 11, 2016 at 06:47:20AM -0700, Geoff Nixon wrote: > > >the last line before it fails appears to be > > `git rev-parse --no-flags --revs-only --symbolic-full-name > > --default HEAD \210\222 \210\

Re: Bug: `git-filter-branch −−subdirectory−filter` fails on Darwin, others?

2016-05-11 Thread Jeff King
On Wed, May 11, 2016 at 06:47:20AM -0700, Geoff Nixon wrote: > I believe I have found a bug in git. On Mac OS X (at least 10.9 > through 10.11), and versions of git from the current HEAD down through > at least 1.8.x, `git filter-branch −−subdirectory−filter ...` fails. > Using, e.g., the followin

Bug: `git-filter-branch −−subdirectory−filter` fails on Darwin, others?

2016-05-11 Thread Geoff Nixon
May 11, 2016 Geoff Nixon geoff@geoff.codes To Whom It May Concern: I believe I have found a bug in git. On Mac OS X (at least 10.9 through 10.11), and versions of git from the current HEAD down through at least 1.8.x, `git filter-branch −−subdirectory−filter ...` fails. Using, e.g., the fol

[PATCH v2] test-lib: set BASH_XTRACEFD automatically

2016-05-11 Thread Jeff King
On Tue, May 10, 2016 at 03:06:59PM -0700, Junio C Hamano wrote: > Jeff King writes: > > > The patch itself is a trivial-looking one-liner, but there > > are a few subtleties worth mentioning: > > > > - the variable is _not_ exported; the "set -x" is local to > > our process, and so the tra

Re: [PATCH 24/25] worktree move: accept destination as directory

2016-05-11 Thread Duy Nguyen
On Wed, May 11, 2016 at 11:43 AM, Eric Sunshine wrote: > On Wed, Apr 13, 2016 at 9:15 AM, Nguyễn Thái Ngọc Duy > wrote: >> Similar to "mv a b/", which is actually "mv a b/a", we extract basename >> of source worktree and create a directory of the same name at >> destination if dst path is a dire

Re: syntax error in git-rebase while running t34* tests

2016-05-11 Thread Jeff King
On Wed, May 11, 2016 at 03:28:35PM +0200, Johannes Schindelin wrote: > Looks obviously correct to me. Thanks. > I had a look at our other shell scripts and it looks as if there is only > one more candidate for this issue: git-bisect.sh has a couple of 'for arg > in "$@"' constructs. But from a c

[PATCH v2 22/94] builtin/apply: move 'threeway' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'threeway' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) di

Re: syntax error in git-rebase while running t34* tests

2016-05-11 Thread Johannes Schindelin
Hi, On Tue, 10 May 2016, Jeff King wrote: > On Tue, May 10, 2016 at 01:53:56PM -0700, Junio C Hamano wrote: > > > Jeff King writes: > > > > > I think it is clear why it works. If $strategy_opts is empty, then the > > > code we generate looks like: > > > > > > for strategy_opt in > > > do >

[PATCH v2 19/94] builtin/apply: move 'diffstat' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'diffstat' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff

[PATCH v2 20/94] builtin/apply: move 'numstat' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'numstat' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff -

[PATCH v2 16/94] builtin/apply: move 'update_index' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'update_index' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 45 ++--- 1 file changed,

[PATCH v2 28/94] builtin/apply: move 'apply' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'apply' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 31 +-- 1 file changed, 17 insertions(+), 14

[PATCH v2 14/94] builtin/apply: move 'apply_with_reject' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'apply_with_reject' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletio

[PATCH v2 27/94] builtin/apply: move 'p_context' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'p_context' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --g

[PATCH v2 11/94] builtin/apply: move 'check' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'check' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) dif

[PATCH v2 21/94] builtin/apply: move 'summary' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'summary' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --gi

[PATCH v2 51/94] builtin/apply: make apply_patch() return -1 instead of die()ing

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. As a first step in this direction, let's make apply_patch() return -1 in case of errors instead of dying. For now its only caller apply_all_patches() will exit(1) when apply_patch() return -1. In a lat

[PATCH v2 40/94] builtin/apply: move 'ws_error_action' into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'ws_error_action' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Signed-off-by: Christian Couder --- builtin/apply.c | 62 +++-- 1 file changed, 34 insertions

[PATCH v2 52/94] builtin/apply: read_patch_file() return -1 instead of die()ing

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. Let's do that by using error() instead of die()ing in read_patch_file(). Signed-off-by: Christian Couder --- builtin/apply.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a

[PATCH v2 43/94] builtin/apply: move 'state_linenr' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'state_linenr' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 75 ++--- 1 fi

[PATCH v2 29/94] builtin/apply: move 'patch_input_file' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'patch_input_file' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 27 +-- 1 file changed, 17 insertions(

[PATCH v2 86/94] apply: add 'be_silent' variable to 'struct apply_state'

2016-05-11 Thread Christian Couder
This variable should prevent anything to be printed on both stderr and stdout. Let's not take care of stdout and apply_verbosely for now though, as that will be taken care of in following patches. Signed-off-by: Christian Couder --- apply.c | 43 +-- appl

[PATCH v2 85/94] write_or_die: use warning() instead of fprintf(stderr, ...)

2016-05-11 Thread Christian Couder
Signed-off-by: Christian Couder --- write_or_die.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/write_or_die.c b/write_or_die.c index 49e80aa..c29f677 100644 --- a/write_or_die.c +++ b/write_or_die.c @@ -87,8 +87,7 @@ int write_or_whine_pipe(int fd, const void *buf, s

[PATCH v2 92/94] am: use be_silent in 'struct apply_state' to shut up applying patches

2016-05-11 Thread Christian Couder
Signed-off-by: Christian Couder --- builtin/am.c | 29 - 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/builtin/am.c b/builtin/am.c index cc66a48..c158c4d 100644 --- a/builtin/am.c +++ b/builtin/am.c @@ -1526,7 +1526,6 @@ static int run_apply(const stru

[PATCH v2 67/94] builtin/apply: change die_on_unsafe_path() to check_unsafe_path()

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", die_on_unsafe_path() should return -1 using error() instead of calling die(), so while doing that let's change

[PATCH v2 70/94] builtin/apply: make add_conflicted_stages_file() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", add_conflicted_stages_file() should return -1 using error() instead of calling die(). Helped-by: Eric Sunshin

[PATCH v2 93/94] run-command: make dup_devnull() static again

2016-05-11 Thread Christian Couder
As there is no caller of dup_devnull() outside run-command.c any more, let's make dup_devnull() static again. Signed-off-by: Christian Couder --- run-command.c | 2 +- run-command.h | 6 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/run-command.c b/run-command.c index 5d1c

[PATCH v2 91/94] apply: change error_routine when be_silent is set

2016-05-11 Thread Christian Couder
Signed-off-by: Christian Couder --- apply.c | 29 + apply.h | 3 +++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/apply.c b/apply.c index e0fdd1d..1dafc82 100644 --- a/apply.c +++ b/apply.c @@ -100,6 +100,11 @@ int init_apply_state(struct apply_stat

[PATCH v2 89/94] usage: add set_warn_routine()

2016-05-11 Thread Christian Couder
There are already set_die_routine() and set_error_routine(), so let's add set_warn_routine() as this will be needed in a following commit. Signed-off-by: Christian Couder --- git-compat-util.h | 1 + usage.c | 5 + 2 files changed, 6 insertions(+) diff --git a/git-compat-util.h b/

[PATCH v2 77/94] builtin/apply: rename option parsing functions

2016-05-11 Thread Christian Couder
As these functions are going to be part of the libified apply api, let's give them a name that is more specific to the apply api. Signed-off-by: Christian Couder --- builtin/apply.c | 40 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/bui

[PATCH v2 73/94] builtin/apply: make write_out_one_result() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of exit()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", write_out_one_result() should just return what remove_file() and create_file() are returning instead of calli

[PATCH v2 53/94] builtin/apply: make find_header() return -1 instead of die()ing

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in builtin/apply.c, find_header() should return -1 using error() instead of calling die(). Unfortunately find_header() already retu

[PATCH v2 87/94] apply: make 'be_silent' incomatible with 'apply_verbosely'

2016-05-11 Thread Christian Couder
It should be an error to have both be_silent and apply_verbosely set, so let's check that in check_apply_state(). And by the way let's not automatically set apply_verbosely when be_silent is set. Signed-off-by: Christian Couder --- apply.c | 10 -- 1 file changed, 8 insertions(+), 2 del

[PATCH v2 94/94] builtin/apply: add a cli option for be_silent

2016-05-11 Thread Christian Couder
Let's make it possible to request a silent operation on the command line. Signed-off-by: Christian Couder --- builtin/apply.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builtin/apply.c b/builtin/apply.c index ce12769..397ef26 100644 --- a/builtin/apply.c +++ b/builtin/apply.c @@ -70,6

[PATCH v2 88/94] apply: don't print on stdout when be_silent is set

2016-05-11 Thread Christian Couder
Signed-off-by: Christian Couder --- apply.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apply.c b/apply.c index 5459ee1..e0fdd1d 100644 --- a/apply.c +++ b/apply.c @@ -4669,13 +4669,13 @@ static int apply_patch(struct apply_state *state, goto end;

[PATCH v2 68/94] builtin/apply: make build_fake_ancestor() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", build_fake_ancestor() should return -1 using error() instead of calling die(). Helped-by: Eric Sunshine Sign

[PATCH v2 90/94] usage: add get_error_routine() and get_warn_routine()

2016-05-11 Thread Christian Couder
Let's make it possible to get the current error_routine and warn_routine, so that we can store them before using set_error_routine() or set_warn_routine() to use new ones. This way we will be able put back the original routines, when we are done with using new ones. Signed-off-by: Christian Coude

[PATCH v2 50/94] builtin/apply: move 'newfd' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'newfd' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Signed-off-by: Christian Couder --- builtin/apply.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/builtin/apply.c b/builtin/

[PATCH v2 84/94] builtin/am: use apply api in run_apply()

2016-05-11 Thread Christian Couder
This replaces run_apply() implementation with a new one that uses the apply api that has been previously prepared in apply.c and apply.h. This shoud improve performance a lot in certain cases. As the previous implementation was creating a new `git apply` process to apply each patch, it could be s

[PATCH v2 55/94] builtin/apply: make parse_single_patch() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in builtin/apply.c, parse_single_patch() should return -1 instead of calling die(). Let's do that by using error() and let's adjust

[PATCH v2 45/94] builtin/apply: move 'symlink_changes' global into 'struct apply_state'

2016-05-11 Thread Christian Couder
To libify the apply functionality the 'symlink_changes' variable should not be static and global to the file. Let's move it into 'struct apply_state'. Reviewed-by: Stefan Beller Signed-off-by: Christian Couder --- builtin/apply.c | 49 +++-- 1 file ch

[PATCH v2 81/94] run-command: make dup_devnull() non static

2016-05-11 Thread Christian Couder
We will need this function in a later commit to redirect stdout and stderr to /dev/null. Helped-by: Johannes Sixt Helped-by: Johannes Schindelin Signed-off-by: Christian Couder --- run-command.c | 2 +- run-command.h | 6 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/run

[PATCH v2 76/94] builtin/apply: make create_one_file() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of exit()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", create_one_file() should return -1 instead of calling exit(). Signed-off-by: Christian Couder --- builtin/

[PATCH v2 65/94] builtin/apply: make gitdiff_*() return 1 at end of header

2016-05-11 Thread Christian Couder
The gitdiff_*() functions that are called as p->fn() in parse_git_header() should return 1 instead of -1 in case of end of header or unrecognized input, as these are not real errors. It just instructs the parser to break out. This makes it possible for gitdiff_*() functions to return -1 in case of

[PATCH v2 66/94] builtin/apply: make gitdiff_*() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", gitdiff_*() functions should return -1 using error() instead of calling die(). A previous patch made it possi

[PATCH v2 83/94] environment: add set_index_file()

2016-05-11 Thread Christian Couder
Introduce set_index_file() to be able to temporarily change the index file. It should be used like this: /* Save current index file */ old_index_file = get_index_file(); set_index_file((char *)tmp_index_file); /* Do stuff that will use tmp_index_file as the index file */ ...

[PATCH v2 74/94] builtin/apply: make write_out_results() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of exit()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", write_out_results() should return -1 instead of calling exit(). Helped-by: Eric Sunshine Signed-off-by: Chr

[PATCH v2 82/94] apply: roll back index lock file in case of error

2016-05-11 Thread Christian Couder
According to the lockfile API, when finished with a lockfile, one should either commit it or roll it back. This is even more important now that the same lockfile can be passed to init_apply_state() many times to be reused by series of calls to the apply lib functions. Helped-by: Johannes Schindel

[PATCH v2 71/94] builtin/apply: make add_index_file() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", add_index_file() should return -1 using error() instead of calling die(). Signed-off-by: Christian Couder --

[PATCH v2 75/94] builtin/apply: make try_create_file() return -1 on error

2016-05-11 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing. To do that in a compatible manner with the rest of the error handling in "builtin/apply.c", try_create_file() should return -1 in case of error. Unfortunately try_create_file() currently returns -1 to

[PATCH v2 78/94] apply: rename and move opt constants to apply.h

2016-05-11 Thread Christian Couder
The constants for the "inaccurate-eof" and the "recount" options will be used in both "apply.c" and "builtin/apply.c", so they need to go into "apply.h", and therefore they need a name that is more specific to the API they belong to. Signed-off-by: Christian Couder --- apply.h | 3 +++

[PATCH v2 80/94] apply: make some parsing functions static again

2016-05-11 Thread Christian Couder
Some parsing functions that were used in both "apply.c" and "builtin/apply.c" are now only used in the former, so they can be made static to "apply.c". Signed-off-by: Christian Couder --- apply.c | 6 +++--- apply.h | 5 - 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/apply.

  1   2   >