Re: [PATCH] fetch: document that pruning happens before fetching

2016-06-13 Thread Jacob Keller
On Mon, Jun 13, 2016 at 11:17 PM, Jeff King wrote: > On Mon, Jun 13, 2016 at 11:14:36PM -0700, Jacob Keller wrote: > >> On Mon, Jun 13, 2016 at 4:58 PM, Jeff King wrote: >> > This was changed in 10a6cc8 (fetch --prune: Run prune before >> > fetching, 2014-01-02), but it seems that nobody in that

Re: [PATCH] fetch: document that pruning happens before fetching

2016-06-13 Thread Jeff King
On Mon, Jun 13, 2016 at 11:14:36PM -0700, Jacob Keller wrote: > On Mon, Jun 13, 2016 at 4:58 PM, Jeff King wrote: > > This was changed in 10a6cc8 (fetch --prune: Run prune before > > fetching, 2014-01-02), but it seems that nobody in that > > discussion realized we were advertising the "after" >

[PATCH v2] strbuf: describe the return value of strbuf_read_file

2016-06-13 Thread Pranit Bauva
Mentored-by: Lars Schneider Mentored-by: Christian Couder Signed-off-by: Pranit Bauva --- strbuf.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/strbuf.h b/strbuf.h index 7987405..83c5c98 100644 --- a/strbuf.h +++ b/strbuf.h @@ -377,6 +377,8 @@ extern ssize_t strbuf_read_once(struct str

Re: [PATCH] fetch: document that pruning happens before fetching

2016-06-13 Thread Jacob Keller
On Mon, Jun 13, 2016 at 4:58 PM, Jeff King wrote: > This was changed in 10a6cc8 (fetch --prune: Run prune before > fetching, 2014-01-02), but it seems that nobody in that > discussion realized we were advertising the "after" > explicitly. > > Signed-off-by: Jeff King > --- > I include myself in t

Re: [PATCH] strbuf: describe the return value of strbuf_read_file()

2016-06-13 Thread Pranit Bauva
Hey Junio, On Tue, Jun 14, 2016 at 3:40 AM, Junio C Hamano wrote: >> It is easy to be misguided on the return value of the function >> strbuf_read_file(). It does follow the pattern of other standard functions >> for reading files but its better to explicitly specify it. > > Good thing to do; I w

Re: [PATCH 3/3] blame,shortlog: don't make local option variables static

2016-06-13 Thread Jeff King
On Tue, Jun 14, 2016 at 12:32:15AM -0400, Eric Sunshine wrote: > > + struct string_list range_list = STRING_LIST_INIT_NODUP; > > Related to this series, there's an additional "fix" which ought to be > made, probably as a separate patch. In particular, in cmd_blame(): > > if (lno && !ra

Re: [PATCH 16/38] resolve_gitlink_ref(): implement using resolve_ref_recursively()

2016-06-13 Thread Eric Sunshine
On Fri, Jun 3, 2016 at 5:03 PM, Michael Haggerty wrote: > resolve_ref_recursively() can handle references in arbitrary files > reference stores, so use it to resolve "gitlink" (i.e., submodule) > references. Aside from removing redundant code, this allows submodule > lookups to benefit from the mu

Re: [PATCH 3/3] blame,shortlog: don't make local option variables static

2016-06-13 Thread Eric Sunshine
On Mon, Jun 13, 2016 at 1:39 AM, Jeff King wrote: > There's no need for these option variables to be static, > except that they are referenced by the options array itself, > which is static. But having all of this static is simply > unnecessary and confusing (and inconsistent with most other > com

Re: [PATCH 1/1] Don't free remote->name after fetch

2016-06-13 Thread Keith McGuigan
Right. The string_list ends up getting (potentially) populated with a mix of dup'd and borrowed values. I figured it was safer to leak here (especially as we're on the way out anyway), than free memory that shouldn't be freed. Actually, what motivates this (and I apologize that I didn't say this

[PATCH] fetch: document that pruning happens before fetching

2016-06-13 Thread Jeff King
This was changed in 10a6cc8 (fetch --prune: Run prune before fetching, 2014-01-02), but it seems that nobody in that discussion realized we were advertising the "after" explicitly. Signed-off-by: Jeff King --- I include myself in that "nobody" of course. :) Documentation/fetch-options.txt | 2 +

Re: [PATCH v7 02/40] builtin/apply: make apply_patch() return -1 instead of die()ing

2016-06-13 Thread Junio C Hamano
Christian Couder writes: > +/* > + * Try to apply a patch. > + * > + * Returns: > + * -1 if an error happened > + * 0 if the patch applied > + * 1 if the patch did not apply > + */ > static int apply_patch(struct apply_state *state, > int fd, > cons

Re: [PATCH v7 01/40] apply: move 'struct apply_state' to apply.h

2016-06-13 Thread Junio C Hamano
Christian Couder writes: > To libify `git apply` functionality we must make 'struct apply_state' > usable outside "builtin/apply.c". > > Let's do that by creating a new "apply.h" and moving > 'struct apply_state' there. > > Signed-off-by: Christian Couder > --- > apply.h | 100 > ++

Re: [PATCH v4 4/6] send-email: create email parser subroutine

2016-06-13 Thread Eric Wong
Samuel GROOT wrote: > On 06/09/2016 02:21 AM, Eric Wong wrote: > >Samuel GROOT wrote: > >>Email::Simple library uses qr/\x0a\x0d|\x0d\x0a|\x0a|\x0d/ [1]. > >>Should we handle \n\r at end of line as well? > > > >"\n\r" can never happen with local $/ = "\n" > > If the email file contains "\n\r", s

Re: [PATCH 1/1] Don't free remote->name after fetch

2016-06-13 Thread Junio C Hamano
kmcgui...@twopensource.com writes: > From: Keith McGuigan > > The string_list gets populated with the names from the remotes[] array, > which are not dup'd and the list does not own. > > Signed-of-by: Keith McGuigan > --- For names that come from remote_get()->name, e.g. static int get_one

Re: [PATCH v3 2/6] t9001: check email address is in Cc: field

2016-06-13 Thread Samuel GROOT
On 06/09/2016 07:55 AM, Matthieu Moy wrote: Tom Russello writes: Check if the given utf-8 email address is in the Cc: field. I wouldn't harm to explain what was the problem with existing code here. If I understand correctly, that would be: Existing code just checked that the address appea

Re: [PATCH v3 1/6] t9001: non order-sensitive file comparison

2016-06-13 Thread Samuel GROOT
On 06/09/2016 08:01 AM, Matthieu Moy wrote: Samuel GROOT writes: On 06/08/2016 06:09 PM, Junio C Hamano wrote: Samuel GROOT writes: Actually we had issues when trying to refactor send-email's email parsing loop [1]. Email addresses in output file `commandeline1` in tests weren't sorted the

Re: [PATCH v4 3/6] send-email: shorten send-email's output

2016-06-13 Thread Samuel GROOT
On 06/09/2016 08:17 AM, Matthieu Moy wrote: Samuel GROOT writes: @@ -647,10 +647,10 @@ test_expect_success $PREREQ '--suppress-cc=all' ' test_expect_success $PREREQ 'setup expect' " cat >expected-suppress-body <<\EOF 0001-Second.patch -(mbox) Adding cc: A from line 'From: A ' -(mbox) Addi

Re: [PATCH v4 4/6] send-email: create email parser subroutine

2016-06-13 Thread Samuel GROOT
On 06/09/2016 02:21 AM, Eric Wong wrote: Samuel GROOT wrote: Email::Simple library uses qr/\x0a\x0d|\x0d\x0a|\x0a|\x0d/ [1]. Should we handle \n\r at end of line as well? "\n\r" can never happen with local $/ = "\n" If the email file contains "\n\r", setting $/ = "\n" will leave "\r" at the

Re: [PATCH v4 4/6] send-email: create email parser subroutine

2016-06-13 Thread Samuel GROOT
On 06/09/2016 08:51 AM, Eric Sunshine wrote: On Wed, Jun 8, 2016 at 7:54 PM, Samuel GROOT wrote: On 06/08/2016 10:17 PM, Junio C Hamano wrote: Eric Sunshine writes: An embedded CR probably shouldn't happen, but I'm not convinced that folding it out is a good idea. I would think that you'd

Re: [PATCH] strbuf: describe the return value of strbuf_read_file()

2016-06-13 Thread Junio C Hamano
Pranit Bauva writes: > Mentored-by: Lars Schneider > Mentored-by: Christian Couder > Signed-off-by: Pranit Bauva > --- > It is easy to be misguided on the return value of the function > strbuf_read_file(). It does follow the pattern of other standard functions > for reading files but its bette

Re: [PATCH] Document the 'svn propset' command.

2016-06-13 Thread Alfred Perlstein
On 6/13/16 7:42 AM, Pranit Bauva wrote: Hey Alfred, On Mon, Jun 13, 2016 at 7:54 PM, Pranit Bauva wrote: Hey Alfred, On Mon, Jun 13, 2016 at 6:22 PM, Alfred Perlstein wrote: Thank you Pranit. I thought that "signed off by" is used once someone approved my patch as opposed to when it's in

Re: Re attr API further revamp

2016-06-13 Thread Junio C Hamano
Stefan Beller writes: > On Mon, Jun 13, 2016 at 1:55 PM, Junio C Hamano wrote: >> I hate to be doing this, but we need yet another revamp to the attr >> API that affects all the callers. > > So you don't mean origin/jc/attr-more by this? Not really; the tip of attr-more needs to be discarded af

Re: Re attr API further revamp

2016-06-13 Thread Stefan Beller
On Mon, Jun 13, 2016 at 1:55 PM, Junio C Hamano wrote: > I hate to be doing this, but we need yet another revamp to the attr > API that affects all the callers. So you don't mean origin/jc/attr-more by this? (Given that we have jc/attr and jc/attr-more, the third thing could go with jc/even-more-

Re: [PATCH] Refactor recv_sideband()

2016-06-13 Thread Nicolas Pitre
On Mon, 13 Jun 2016, Lukas Fleischer wrote: > Improve the readability of recv_sideband() significantly by replacing > fragile buffer manipulations with more sophisticated format strings. > Also, reorganize the overall control flow, remove some superfluous > variables and replace a custom implement

Re attr API further revamp

2016-06-13 Thread Junio C Hamano
I hate to be doing this, but we need yet another revamp to the attr API that affects all the callers. In the original design, a codepath that wants to check attributes repeatedly for many paths (e.g. "convert" that wants to see what crlf, ident, filter, eol and text attributes are set to for paths

[PATCH] strbuf: describe the return value of strbuf_read_file()

2016-06-13 Thread Pranit Bauva
Mentored-by: Lars Schneider Mentored-by: Christian Couder Signed-off-by: Pranit Bauva --- It is easy to be misguided on the return value of the function strbuf_read_file(). It does follow the pattern of other standard functions for reading files but its better to explicitly specify it. strbuf.

[PATCH] Refactor recv_sideband()

2016-06-13 Thread Lukas Fleischer
Improve the readability of recv_sideband() significantly by replacing fragile buffer manipulations with more sophisticated format strings. Also, reorganize the overall control flow, remove some superfluous variables and replace a custom implementation of strpbrk() with a call to the standard C libr

[ANNOUNCE] Git v2.9.0

2016-06-13 Thread Junio C Hamano
The latest feature release Git v2.9.0 is now available at the usual places. It is comprised of 497 non-merge commits since v2.8.0, contributed by 75 people, 28 of which are new faces. The tarballs are found at: https://www.kernel.org/pub/software/scm/git/ The following public repositories a

A note from the maintainer

2016-06-13 Thread Junio C Hamano
Welcome to the Git development community. This message is written by the maintainer and talks about how Git project is managed, and how you can work with it. * Mailing list and the community The development is primarily done on the Git mailing list. Help requests, feature proposals, bug reports

Re: [PATCHv4] Documentation: triangular workflow

2016-06-13 Thread Junio C Hamano
"Philip Oakley" writes: > From: "Junio C Hamano" >> I do not think I agree. >> >> If you apriori know that you do want to hack on a project's code, then >> forking at GitHub first and then cloning the copy would be OK. > > You've clipped my other point: > > -One issue may be the differen

[PATCH 1/1] Don't free remote->name after fetch

2016-06-13 Thread kmcguigan
From: Keith McGuigan The string_list gets populated with the names from the remotes[] array, which are not dup'd and the list does not own. Signed-of-by: Keith McGuigan --- builtin/fetch.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index 630ae6a1bb78

merge committing staged deletions?

2016-06-13 Thread Joey Hess
I have a case where git merge seems to include staged deletions into the merge commit. This seems pretty surprising, dunno if it's a bug. joey@darkstar:~/tmp/x/1>git rm 1 foo joey@darkstar:~/tmp/x/1>git status On branch master Changes to be committed: (use "git reset HEAD ..." to unstage)

Re: [PATCH 4/3] use string_list initializer consistently

2016-06-13 Thread Jeff King
On Mon, Jun 13, 2016 at 06:31:29PM +0700, Duy Nguyen wrote: > > This is a fairly mechanical conversion; I assumed each site > > was correct as-is, and just switched them all to NODUP. > > Looking good. If we still want to reduce noise level down (by a tiny > bit), we could remove _INIT because I

Re: [PATCH 00/27] nd/shallow-deepen updates

2016-06-13 Thread Junio C Hamano
Eric Sunshine writes: > I agree with Junio that moving the sigchain_pop() into the error > handling code-path, if possible, would be a nice improvement. Yeah, "if possible" is really what I was not sure about---is it safe to do the _push() thing before start_command(), which presumably would aff

Re: [PATCH v3] lib-httpd.sh: print error.log on error

2016-06-13 Thread Jeff King
On Mon, Jun 13, 2016 at 07:35:09PM +0700, Nguyễn Thái Ngọc Duy wrote: > Failure to bring up httpd for testing is not considered an error, so the > trash directory, which contains this error.log file, is removed and we > don't know what made httpd fail to start. Improve the situation a bit, > print

Re: [PATCH v7 00/40] libify apply and use lib in am, part 2

2016-06-13 Thread Christian Couder
On Mon, Jun 13, 2016 at 6:09 PM, Christian Couder wrote: > > I will send a diff between this version and the previous one, as a > reply to this email. Here is the diff: diff --git a/apply.c b/apply.c index cd4cd01..98a 100644 --- a/apply.c +++ b/apply.c @@ -4386,7 +4386,7 @@ static int creat

[PATCH v7 22/40] builtin/apply: make create_file() return -1 on error

2016-06-13 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_file() should just return what add_conflicted_stages_file() and add_index_file() are returning instead

[PATCH v7 15/40] builtin/apply: make gitdiff_*() return 1 at end of header

2016-06-13 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 v7 38/40] apply: change error_routine when be_silent is set

2016-06-13 Thread Christian Couder
To avoid printing anything when applying with be_silent set, let's save the existing warn and error routines before applying and replace them with a routine that does nothing. Then after applying, let's restore the saved routines. Signed-off-by: Christian Couder --- apply.c | 23 +++

[PATCH v7 28/40] apply: rename and move opt constants to apply.h

2016-06-13 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 v7 18/40] builtin/apply: make build_fake_ancestor() return -1 on error

2016-06-13 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 instead of calling die(). Helped-by: Eric Sunshine Signed-off-by: Chr

[PATCH v7 31/40] environment: add set_index_file()

2016-06-13 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 v7 30/40] apply: make some parsing functions static again

2016-06-13 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.

[PATCH v7 35/40] apply: don't print on stdout when be_silent is set

2016-06-13 Thread Christian Couder
This variable should prevent anything to be printed on both stderr and stdout. Signed-off-by: Christian Couder --- apply.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apply.c b/apply.c index dd9b301..2529534 100644 --- a/apply.c +++ b/apply.c @@ -4679,13 +4679,13 @@

[PATCH v7 25/40] builtin/apply: make try_create_file() return -1 on error

2016-06-13 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 v7 14/40] builtin/apply: make parse_traditional_patch() return -1 on error

2016-06-13 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_traditional_patch() should return -1 instead of calling die(). Signed-off-by: Christian Couder --- bu

[PATCH v7 21/40] builtin/apply: make add_index_file() return -1 on error

2016-06-13 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 instead of calling die(). Signed-off-by: Christian Couder --- builtin/app

[PATCH v7 09/40] builtin/apply: move init_apply_state() to apply.c

2016-06-13 Thread Christian Couder
To libify `git apply` functionality we must make init_apply_state() usable outside "builtin/apply.c". Let's do that by moving it into a new "apply.c". Helped-by: Eric Sunshine Signed-off-by: Christian Couder --- Makefile| 1 + apply.c | 91 +

[PATCH v7 36/40] usage: add set_warn_routine()

2016-06-13 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 v7 24/40] builtin/apply: make write_out_results() return -1 on error

2016-06-13 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 v7 33/40] apply: add 'be_silent' variable to 'struct apply_state'

2016-06-13 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 v7 19/40] builtin/apply: make remove_file() return -1 on error

2016-06-13 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", remove_file() should return -1 instead of calling die(). Signed-off-by: Christian Couder --- builtin/apply.

[PATCH v7 06/40] builtin/apply: make parse_single_patch() return -1 on error

2016-06-13 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 v7 03/40] builtin/apply: read_patch_file() return -1 instead of die()ing

2016-06-13 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 returning -1 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 v7 02/40] builtin/apply: make apply_patch() return -1 instead of die()ing

2016-06-13 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 v7 10/40] apply: make init_apply_state() return -1 instead of exit()ing

2016-06-13 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", init_apply_state() should return -1 instead of calling exit(). Signed-off-by: Christian Couder --- apply.c

[PATCH v7 16/40] builtin/apply: make gitdiff_*() return -1 on error

2016-06-13 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 instead of calling die(). A previous patch made it possible for gitdif

[PATCH v7 27/40] builtin/apply: rename option parsing functions

2016-06-13 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 v7 34/40] apply: make 'be_silent' incompatible with 'apply_verbosely'

2016-06-13 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 | 9 +++-- 1 file changed, 7 insertions(+), 2 delet

[PATCH v7 08/40] builtin/apply: make parse_ignorewhitespace_option() return -1 instead of die()ing

2016-06-13 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_ignorewhitespace_option() should return -1 instead of calling die(). Signed-off-by: Christian Couder -

[PATCH v7 12/40] builtin/apply: move check_apply_state() to apply.c

2016-06-13 Thread Christian Couder
To libify `git apply` functionality we must make check_apply_state() usable outside "builtin/apply.c". Let's do that by moving it into "apply.c". Signed-off-by: Christian Couder --- apply.c | 32 apply.h | 1 + builtin/apply.c | 32 -

[PATCH v7 37/40] usage: add get_error_routine() and get_warn_routine()

2016-06-13 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 v7 04/40] builtin/apply: make find_header() return -1 instead of die()ing

2016-06-13 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 instead of calling die(). Unfortunately find_header() already returns -1 when no

[PATCH v7 40/40] apply: use error_errno() where possible

2016-06-13 Thread Christian Couder
To avoid possible mistakes and to uniformly show the errno related messages, let's use error_errno() where possible. Signed-off-by: Christian Couder --- apply.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/apply.c b/apply.c index ef49709..98a 1

[PATCH v7 32/40] write_or_die: use warning() instead of fprintf(stderr, ...)

2016-06-13 Thread Christian Couder
In write_or_whine_pipe() and write_or_whine() when write_in_full() returns an error, let's print the errno related error message using warning() instead of fprintf(stderr, ...). This makes it possible to change the way it is handled by changing the current warn routine in usage.c. Signed-off-by:

[PATCH v7 39/40] builtin/am: use apply api in run_apply()

2016-06-13 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 v7 26/40] builtin/apply: make create_one_file() return -1 on error

2016-06-13 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 v7 23/40] builtin/apply: make write_out_one_result() return -1 on error

2016-06-13 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 v7 07/40] builtin/apply: make parse_whitespace_option() return -1 instead of die()ing

2016-06-13 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_whitespace_option() should return -1 instead of calling die(). Signed-off-by: Christian Couder --- buil

[PATCH v7 11/40] builtin/apply: make check_apply_state() return -1 instead of die()ing

2016-06-13 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", check_apply_state() should return -1 instead of calling die(). Signed-off-by: Christian Couder --- builtin/

[PATCH v7 13/40] builtin/apply: make apply_all_patches() return -1 on error

2016-06-13 Thread Christian Couder
To finish libifying the apply functionality, apply_all_patches() should not die() or exit() in case of error, but return -1. While doing that we must take care that file descriptors are properly closed and, if needed, reset a sensible value. Also, according to the lockfile API, when finished with

[PATCH v7 05/40] builtin/apply: make parse_chunk() return a negative integer on error

2016-06-13 Thread Christian Couder
To libify `git apply` functionality we have to signal errors to the caller instead of die()ing or exit()ing. To do that in a compatible manner with the rest of the error handling in builtin/apply.c, parse_chunk() should return -1 instead of calling die() or exit(). As parse_chunk() is called only

[PATCH v7 17/40] builtin/apply: change die_on_unsafe_path() to check_unsafe_path()

2016-06-13 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 v7 01/40] apply: move 'struct apply_state' to apply.h

2016-06-13 Thread Christian Couder
To libify `git apply` functionality we must make 'struct apply_state' usable outside "builtin/apply.c". Let's do that by creating a new "apply.h" and moving 'struct apply_state' there. Signed-off-by: Christian Couder --- apply.h | 100

[PATCH v7 20/40] builtin/apply: make add_conflicted_stages_file() return -1 on error

2016-06-13 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 instead of calling die(). Helped-by: Eric Sunshine Signed-off-

[PATCH v7 00/40] libify apply and use lib in am, part 2

2016-06-13 Thread Christian Couder
Goal This is a patch series about libifying `git apply` functionality, and using this libified functionality in `git am`, so that no 'git apply' process is spawn anymore. This makes `git am` significantly faster, so `git rebase`, when it uses the am backend, is also significantly faster. Pre

Re: [PATCH] Document the 'svn propset' command.

2016-06-13 Thread Pranit Bauva
Hey Alfred, On Mon, Jun 13, 2016 at 7:54 PM, Pranit Bauva wrote: > Hey Alfred, > > On Mon, Jun 13, 2016 at 6:22 PM, Alfred Perlstein wrote: >> Thank you Pranit. I thought that "signed off by" is used once someone >> approved my patch as opposed to when it's in "proposal" stage. This was my >>

Re: [PATCH] Document the 'svn propset' command.

2016-06-13 Thread Pranit Bauva
Hey Alfred, On Mon, Jun 13, 2016 at 6:22 PM, Alfred Perlstein wrote: > Thank you Pranit. I thought that "signed off by" is used once someone > approved my patch as opposed to when it's in "proposal" stage. This was my > first email with a patch for this issue, who should/could I have used for >

Re: [PATCH] Document the 'svn propset' command.

2016-06-13 Thread Alfred Perlstein
Thank you Pranit. I thought that "signed off by" is used once someone approved my patch as opposed to when it's in "proposal" stage. This was my first email with a patch for this issue, who should/could I have used for "signoff"? -Alfred On 6/12/16 11:59 PM, Pranit Bauva wrote: Hey Alfre

[PATCH v3] lib-httpd.sh: print error.log on error

2016-06-13 Thread Nguyễn Thái Ngọc Duy
Failure to bring up httpd for testing is not considered an error, so the trash directory, which contains this error.log file, is removed and we don't know what made httpd fail to start. Improve the situation a bit, print error.log but only in verbose mode. Signed-off-by: Nguyễn Thái Ngọc Duy ---

Re: [PATCH v4 1/6] worktree.c: add find_worktree()

2016-06-13 Thread Duy Nguyen
On Fri, Jun 3, 2016 at 10:00 PM, Ramsay Jones wrote: > > > On 03/06/16 13:19, Nguyễn Thái Ngọc Duy wrote: >> So far we haven't needed to identify an existing worktree from command >> line. Future commands such as lock or move will need it. The current >> implementation identifies worktrees by path

[PATCH v5 4/6] worktree: add "lock" command

2016-06-13 Thread Nguyễn Thái Ngọc Duy
Helped-by: Eric Sunshine Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 26 +- builtin/worktree.c | 38 +++ contrib/completion/git-completion.bash | 5 +++- t/t2028-worktree-move.sh (new +x) | 48

[PATCH v5 2/6] worktree.c: add is_main_worktree()

2016-06-13 Thread Nguyễn Thái Ngọc Duy
Main worktree _is_ different. You can lock (*) a linked worktree but not the main one, for example. Provide an API for checking that. (*) Add the file $GIT_DIR/worktrees/xxx/locked to avoid worktree xxx from being removed or moved. Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 5 + w

[PATCH v5 6/6] worktree.c: find_worktree() search by path suffix

2016-06-13 Thread Nguyễn Thái Ngọc Duy
This allows the user to do something like "worktree lock foo" or "worktree lock to/foo" instead of "worktree lock /long/path/to/foo" if it's unambiguous. With completion support it could be quite convenient. While this base name search can be done in the same worktree iteration loop, the code is s

[PATCH v5 0/6] worktree lock/unlock

2016-06-13 Thread Nguyễn Thái Ngọc Duy
v5 fixes some error messages mentioning "working directory" instead of "working tree" and split the double use of "lock_reason" field in "struct worktree". This series depends on nd/worktree-cleanup-post-head-protection. Diff from v4 -- 8< -- diff --git a/builtin/worktree.c b/builtin/worktree.c i

[PATCH v5 1/6] worktree.c: add find_worktree()

2016-06-13 Thread Nguyễn Thái Ngọc Duy
So far we haven't needed to identify an existing worktree from command line. Future commands such as lock or move will need it. The current implementation identifies worktrees by path (*). In future, the function could learn to identify by $(basename $path) or tags... (*) We could probably go chea

[PATCH v5 3/6] worktree.c: add is_worktree_locked()

2016-06-13 Thread Nguyễn Thái Ngọc Duy
We need this later to avoid double locking a worktree, or unlocking one when it's not even locked. Signed-off-by: Nguyễn Thái Ngọc Duy --- worktree.c | 28 worktree.h | 8 2 files changed, 36 insertions(+) diff --git a/worktree.c b/worktree.c index 12a766a

[PATCH v5 5/6] worktree: add "unlock" command

2016-06-13 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-worktree.txt | 5 + builtin/worktree.c | 28 contrib/completion/git-completion.bash | 2 +- t/t2028-worktree-move.sh | 14 ++ 4 files changed, 48 inse

Re: [PATCH] lib-httpd.sh: print error.log on error

2016-06-13 Thread Jeff King
On Mon, Jun 13, 2016 at 06:40:14PM +0700, Duy Nguyen wrote: > I like the verbose route, so here's v2 I think this is OK, though... > diff --git a/t/lib-httpd.sh b/t/lib-httpd.sh > index f9f3e5f..67bc7ad 100644 > --- a/t/lib-httpd.sh > +++ b/t/lib-httpd.sh > @@ -180,6 +180,8 @@ start_httpd() { >

Re: [PATCH] lib-httpd.sh: print error.log on error

2016-06-13 Thread Duy Nguyen
On Sun, Jun 12, 2016 at 08:59:21AM -0400, Jeff King wrote: > On Sun, Jun 12, 2016 at 05:41:54PM +0700, Nguyễn Thái Ngọc Duy wrote: > > > Failure to bring up httpd for testing is not considered an error, so the > > trash directory, which contains this error.log file, is removed and we > > don't kno

Re: [PATCH 4/3] use string_list initializer consistently

2016-06-13 Thread Duy Nguyen
On Mon, Jun 13, 2016 at 5:04 PM, Jeff King wrote: > -- >8 -- > Subject: use string_list initializer consistently > > There are two types of string_lists: those that own the > string memory, and those that don't. You can tell the > difference by the strdup_strings flag, and one should use > either

Re: [RFC/PATCH 0/8] Add initial experimental external ODB support

2016-06-13 Thread Duy Nguyen
On Mon, Jun 13, 2016 at 3:55 PM, Christian Couder wrote: > Future work > ~~~ > > From the discussions it appear that using the bundle v3 mechanism to > tranfer external ODB data could work, but only if the server has access > to its own external ODB. > > Another possible mechanism to trans

Re: [PATCH v2 5/6] lock_ref_for_update(): make error handling more uniform

2016-06-13 Thread Michael Haggerty
On 06/13/2016 09:16 AM, Michael Haggerty wrote: > On 06/10/2016 09:01 PM, David Turner wrote: >> On Fri, 2016-06-10 at 10:14 +0200, Michael Haggerty wrote: >> >>> /* >>> + * Check whether the REF_HAVE_OLD and old_oid values stored in update >>> + * are consistent with the result read for the refer

[PATCH 4/3] use string_list initializer consistently

2016-06-13 Thread Jeff King
On Mon, Jun 13, 2016 at 04:36:14PM +0700, Duy Nguyen wrote: > > So I'd suggest these patches: > > > > [1/3]: parse_opt_string_list: stop allocating new strings > > [2/3]: interpret-trailers: don't duplicate option strings > > [3/3]: blame,shortlog: don't make local option variables static >

[ADDENDUM v4] Yet more preparation for reference backends

2016-06-13 Thread Michael Haggerty
Below is the delta needed to fixed the bug in the mh/split-under-lock patch series that I mentioned in an earlier email [1], plus a little tweak to make the docstring for lock_ref_for_update() clearer. I actually fixed the bug in preparatory commit ref_transaction_commit(): remove local varia

Re: [PATCH 0/3] fix parse-opt string_list leaks

2016-06-13 Thread Duy Nguyen
On Mon, Jun 13, 2016 at 12:32 PM, Jeff King wrote: > On Mon, Jun 13, 2016 at 07:08:55AM +0700, Duy Nguyen wrote: > >> > So if we are doing the conservative thing, then I think the resulting >> > code should either look like: >> > >> > if (!v->strdup_strings) >> > die("BUG: OPT_STRING_LIS

[RFC/PATCH 2/8] external odb foreach

2016-06-13 Thread Christian Couder
From: Jeff King --- external-odb.c | 14 ++ external-odb.h | 6 ++ odb-helper.c | 15 +++ odb-helper.h | 4 4 files changed, 39 insertions(+) diff --git a/external-odb.c b/external-odb.c index 1ccfa99..42978a3 100644 --- a/external-odb.c +++ b/external-odb

[RFC/PATCH 0/8] Add initial experimental external ODB support

2016-06-13 Thread Christian Couder
Goal Git can store its objects only in the form of loose objects in separate files or packed objects in a pack file. To be able to better handle some kind of objects, for example big blobs, it would be nice if Git could store its objects in other object databases (ODB). To do that, this patch

[RFC/PATCH 5/8] t0400: add test for 'put' command

2016-06-13 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t0400-external-odb.sh | 9 + 1 file changed, 9 insertions(+) diff --git a/t/t0400-external-odb.sh b/t/t0400-external-odb.sh index 0f1bb97..6c6da5c 100755 --- a/t/t0400-external-odb.sh +++ b/t/t0400-external-odb.sh @@ -57,4 +57,13 @@ test_expect_succe

[RFC/PATCH 3/8] t0400: use --batch-all-objects to get all objects

2016-06-13 Thread Christian Couder
Signed-off-by: Christian Couder --- t/t0400-external-odb.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/t/t0400-external-odb.sh b/t/t0400-external-odb.sh index 2b01617..fe85413 100755 --- a/t/t0400-external-odb.sh +++ b/t/t0400-external-odb.sh @@ -10,9 +10,7 @@ write_sc

  1   2   >