Re: [PATCH v2 00/94] libify apply and use lib in am

2016-06-10 Thread Johannes Schindelin
Hi Hannes, On Thu, 9 Jun 2016, Johannes Sixt wrote: > Meanwhile, I have retrained my muscle memory to stop before typing "-i" after > "rebase" for an opportunity to consider whether bare rebase can be used. > > What should I say? I am impressed. It's like 100 times faster than rebase -i > (on Wi

[BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Jeff King
I found a false positive with the new compaction heuristic in v2.9: -- >8 -- # start with a simple file cat >file.rb <<\EOF def foo do_foo_stuff() common_ending() end EOF git add file.rb git commit -m base # and then add another function with a similar ending cat >>file.rb <<\EOF def bar

Re: [PATCH 2/2] bisect--helper: `check_expected_revs` shell function in C

2016-06-10 Thread Pranit Bauva
Hey Eric, On Fri, Jun 10, 2016 at 3:24 AM, Eric Sunshine wrote: > On Wed, Jun 8, 2016 at 11:24 AM, Pranit Bauva wrote: >> Reimplement the `check_expected_revs` shell function in C and add a >> `--check-expected-revs` subcommand to `git bisect--helper` to call it >> from git-bisect.sh . >> [...]

Re: [PATCH 05/38] refs: create a base class "ref_store" for files_ref_store

2016-06-10 Thread Eric Sunshine
On Fri, Jun 3, 2016 at 5:03 PM, Michael Haggerty wrote: > We want ref_stores to be polymorphic, so invent a base class of which > files_ref_store is a derived class. For now there is a one-to-one > relationship between ref_stores and submodules. > > Signed-off-by: Michael Haggerty > --- > diff --

[PATCH v2 1/6] t1404: rename file to t1404-update-ref-errors.sh

2016-06-10 Thread Michael Haggerty
I want to broaden the scope of this test file, so rename it accordingly. Signed-off-by: Michael Haggerty --- t/{t1404-update-ref-df-conflicts.sh => t1404-update-ref-errors.sh} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename t/{t1404-update-ref-df-conflicts.sh => t1404-update-ref-er

[PATCH v2 2/6] t1404: remove "prefix" argument to test_update_rejected

2016-06-10 Thread Michael Haggerty
The tests already set a variable called prefix and passed its value as the first argument to this function. The old argument handling was overwriting the global variable with its same value rather than creating a local variable. So change test_update_rejected to refer to the global variable rather

[PATCH v2 4/6] t1404: add more tests of update-ref error handling

2016-06-10 Thread Michael Haggerty
Some of the error messages will be improved in subsequent commits. Signed-off-by: Michael Haggerty --- t/t1404-update-ref-errors.sh | 221 ++- 1 file changed, 219 insertions(+), 2 deletions(-) diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref

[PATCH v2 3/6] t1404: document function test_update_rejected

2016-06-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- t/t1404-update-ref-errors.sh | 10 ++ 1 file changed, 10 insertions(+) diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh index 541cad1..7cfeaa9 100755 --- a/t/t1404-update-ref-errors.sh +++ b/t/t1404-update-ref-errors.sh @@ -3,6

[PATCH v2 0/6] Improve test coverage of update-ref error messages

2016-06-10 Thread Michael Haggerty
This is v2 of the patch series. Thanks to Johannes Sixt and Junio for their comments about v1 [1]. Changes since v1: * In t1404, don't use non-portable `local`: change function test_update_rejected to refer to the global `$prefix` variable rather than taking it as a parameter. * Because that

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

2016-06-10 Thread Michael Haggerty
To aid the effort, extract a new function, check_old_oid(), and use it in the two places where the read value of the reference has to be checked against update->old_sha1. Update tests to reflect the improvements. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 77

[PATCH v2 6/6] lock_ref_for_update(): avoid a symref resolution

2016-06-10 Thread Michael Haggerty
If we're overwriting a symref with a SHA-1, we need to resolve the value of the symref (1) to check against update->old_sha1 and (2) to write to its reflog. However, we've already read the symref itself and know its referent. So there is no need to read the symref's value through the symref; we can

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Jeff King
On Fri, Jun 10, 2016 at 03:50:43AM -0400, Jeff King wrote: > I found a false positive with the new compaction heuristic in v2.9: > [...] And by the way, this is less "hey neat, I found a case" and more "wow, this is a lot worse than I thought". I diffed the old and new output for the top 10,000

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Michael Haggerty
On 06/10/2016 09:50 AM, Jeff King wrote: > I found a false positive with the new compaction heuristic in v2.9: > [...] > I get this rather unfortunate diff: > > $ git diff > diff --git a/file.rb b/file.rb > index bd9d1cb..67fbeba 100644 > --- a/file.rb > +++ b/file.rb > @@

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Jeff King
On Fri, Jun 10, 2016 at 10:31:13AM +0200, Michael Haggerty wrote: > I've often thought that indentation would be a good, fairly universal > signal for diff to use when deciding how to slide hunks around. Most > source code is indented in a way that shows its structure. > > I propose the following

Re: [PATCH v2 00/94] libify apply and use lib in am

2016-06-10 Thread Christian Couder
Hi Dscho, On Fri, Jun 10, 2016 at 9:01 AM, Johannes Schindelin wrote: > Hi Hannes, > > On Thu, 9 Jun 2016, Johannes Sixt wrote: > >> Meanwhile, I have retrained my muscle memory to stop before typing "-i" after >> "rebase" for an opportunity to consider whether bare rebase can be used. >> >> What

[PATCH v5 2/3] completion: add __git_get_option_value helper

2016-06-10 Thread Thomas Braun
This function allows to search the commmand line and config files for an option, long and short, with mandatory value. The function would return e.g. for the command line "git status -uno --untracked-files=all" the result "all" regardless of the config option. Signed-off-by: Thomas Braun --- co

[PATCH v5 0/3] completion: add git status

2016-06-10 Thread Thomas Braun
Changes since v4: - Add SP before backslash at EOL - Fix line continuation issue in __git_get_option_value, now t9902 passes again Thomas Braun (3): completion: factor out untracked file modes into a variable completion: add __git_get_option_value helper completion: add git status contri

[PATCH v5 3/3] completion: add git status

2016-06-10 Thread Thomas Braun
Signed-off-by: Thomas Braun --- contrib/completion/git-completion.bash | 50 ++ 1 file changed, 50 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 0bf67c9..ddda5e5 100644 --- a/contrib/completion/gi

Re: What's cooking in git.git (Jun 2016, #03; Thu, 9)

2016-06-10 Thread Thomas Braun
Am 09.06.2016 um 19:21 schrieb Junio C Hamano: > * tb/complete-status (2016-06-06) 3 commits > - completion: add git status > - completion: add __git_get_option_value helper > - completion: factor out untracked file modes into a variable > > The completion script (in contrib/) learned to compl

[PATCH v5 1/3] completion: factor out untracked file modes into a variable

2016-06-10 Thread Thomas Braun
Signed-off-by: Thomas Braun --- contrib/completion/git-completion.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 3402475..addea89 100644 --- a/contrib/completion/git-completion.bash

[PATCH v5 1/3] completion: factor out untracked file modes into a variable

2016-06-10 Thread Thomas Braun
Signed-off-by: Thomas Braun --- contrib/completion/git-completion.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 3402475..addea89 100644 --- a/contrib/completion/git-completion.bash

[PATCH v5 3/3] completion: add git status

2016-06-10 Thread Thomas Braun
Signed-off-by: Thomas Braun --- contrib/completion/git-completion.bash | 50 ++ 1 file changed, 50 insertions(+) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 0bf67c9..ddda5e5 100644 --- a/contrib/completion/gi

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Michael Haggerty
On 06/10/2016 10:41 AM, Jeff King wrote: > On Fri, Jun 10, 2016 at 10:31:13AM +0200, Michael Haggerty wrote: > >> I've often thought that indentation would be a good, fairly universal >> signal for diff to use when deciding how to slide hunks around. Most >> source code is indented in a way that s

Re: [PATCH v2 00/94] libify apply and use lib in am

2016-06-10 Thread Johannes Schindelin
Hi Christian, On Fri, 10 Jun 2016, Christian Couder wrote: > On Fri, Jun 10, 2016 at 9:01 AM, Johannes Schindelin > wrote: > > > > On Thu, 9 Jun 2016, Johannes Sixt wrote: > > > >> Meanwhile, I have retrained my muscle memory to stop before typing "-i" > >> after > >> "rebase" for an opportunit

[PATCH] parse-options-cb.c: use string_list_append_nodup in OPT_STRING_LIST()

2016-06-10 Thread Nguyễn Thái Ngọc Duy
If the given string list has strdup_strings set (*), the string will be duplicated again. Pointless and leak memory. Ignore that flag. (*) only interpret-trailers.c does it at the moment Signed-off-by: Nguyễn Thái Ngọc Duy --- parse-options-cb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

Re: [PATCH 05/38] refs: create a base class "ref_store" for files_ref_store

2016-06-10 Thread Michael Haggerty
On 06/10/2016 10:08 AM, Eric Sunshine wrote: > On Fri, Jun 3, 2016 at 5:03 PM, Michael Haggerty wrote: >> We want ref_stores to be polymorphic, so invent a base class of which >> files_ref_store is a derived class. For now there is a one-to-one >> relationship between ref_stores and submodules. >>

Re: [PATCH 24/26] upload-pack: split check_unreachable() in two, prep for get_reachable_list()

2016-06-10 Thread Duy Nguyen
On Mon, Jun 6, 2016 at 2:43 AM, Eric Sunshine wrote: >> /* >> * The commits out of the rev-list are not ancestors of >> * our ref. >> */ >> - i = read_in_full(cmd.out, namebuf, 1); >> + i = read_in_full(cmd.out, buf, 1); > > s/1/sizeof(buf)/ perhaps o

svn dcommit: where happens the writing of the timestamp?

2016-06-10 Thread Peter Münster
Hi, Could someone please show me, where the timestamp is rewritten in the code, so that I could change it and compile a local copy of git, that fits my needs? Perhaps I could even create a patch, that implements "--preserve-timestamps" and send it back. I've already searched in git-svn.perl but w

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

2016-06-10 Thread Nguyễn Thái Ngọc Duy
This contains cleanups after Eric's comments (all good points, thanks!). Changed patches have Junio's s-o-b line removed, so it's easy to see which is changed and which is not. 09/27 is a new one, split out of 10/27. Interdiff diff --git a/builtin/clone.c b/builtin/clone.c index 5ccf6b7..3849231

[PATCH 05/27] upload-pack: remove unused variable "backup"

2016-06-10 Thread Nguyễn Thái Ngọc Duy
After the last patch, "result" and "backup" are the same. "result" used to move, but the movement is now contained in send_shallow(). Delete this redundant variable. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- upload-pack.c | 9 - 1 file changed, 4 insertions(+

[PATCH 03/27] upload-pack: move shallow deepen code out of receive_needs()

2016-06-10 Thread Nguyễn Thái Ngọc Duy
This is a prep step for further refactoring. Besides reindentation and s/shallows\./shallows->/g, no other changes are expected. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- upload-pack.c | 99 +++ 1 file changed,

[PATCH 07/27] upload-pack: use skip_prefix() instead of starts_with()

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 32 ++-- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index bfb7985..615bfb2 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -276,7 +276,7 @@ static void create_p

[PATCH 04/27] upload-pack: move "shallow" sending code out of deepen()

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- upload-pack.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index 97ed620..0eb9a0b 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -538,6 +538,2

[PATCH 01/27] remote-curl.c: convert fetch_git() to use argv_array

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- remote-curl.c | 46 ++ 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/remote-curl.c b/remote-curl.c index c704857..fd030c1 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -725,38 +725,28 @@ stat

[PATCH 14/27] fetch-pack: use a separate flag for fetch in deepening mode

2016-06-10 Thread Nguyễn Thái Ngọc Duy
The shallow repo could be deepened or shortened when then user gives --depth. But in future that won't be the only way to deepen/shorten a repo. Stop relying on args->depth in this mode. Future deepening methods can simply set this flag on instead of updating all these if expressions. The new name

[PATCH 09/27] upload-pack: make check_non_tip() clean things up error

2016-06-10 Thread Nguyễn Thái Ngọc Duy
On error check_non_tip() will die and not closing file descriptors is no big deal. The next patch will split the majority of this function out for reuse in other cases, where die() may not be the only outcome. Same story for popping SIGPIPE out of the signal chain. So let's make sure we clean thing

[PATCH 12/27] fetch-pack: use a common function for verbose printing

2016-06-10 Thread Nguyễn Thái Ngọc Duy
This reduces the number of "if (verbose)" which makes it a bit easier to read imo. It also makes it easier to redirect all these printouts, to a file for example. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- fetch-pack.c | 88 +---

[PATCH 06/27] upload-pack: move "unshallow" sending code out of deepen()

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Also add some more comments in this code because it takes too long to understand what it does (to me, who should be familiar enough to understand this code well!) Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- upload-pack.c | 39 ++- 1

[PATCH 11/27] fetch-pack: use skip_prefix() instead of starts_with()

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/fetch-pack.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c index 9b2a514..8332d3d 100644 --- a/builtin/fetch-pack.c +++ b/builtin/fetch-pac

[PATCH 02/27] transport-helper.c: refactor set_helper_option()

2016-06-10 Thread Nguyễn Thái Ngọc Duy
For now we can handle two types, string and boolean, in set_helper_option(). Later on we'll add string_list support, which does not fit well. The new function strbuf_set_helper_option() can be reused for a separate function that handles string-list. Signed-off-by: Nguyễn Thái Ngọc Duy --- transp

[PATCH 08/27] upload-pack: tighten number parsing at "deepen" lines

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- upload-pack.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index 615bfb2..60f2e5e 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -641,9 +641,9 @@ static void receive_

[PATCH 10/27] upload-pack: move rev-list code out of check_non_tip()

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 36 +++- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index 1e8b025..b6f3756 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -451,7 +451,7 @@ static int is_ou

[PATCH 16/27] upload-pack: add deepen-since to cut shallow repos based on time

2016-06-10 Thread Nguyễn Thái Ngọc Duy
This should allow the user to say "create a shallow clone containing the work from last year" (once the client side is fixed up, of course). In theory deepen-since and deepen (aka --depth) can be used together to draw the shallow boundary (whether it's intersection or union is up to discussion, bu

[PATCH 17/27] fetch: define shallow boundary with --shallow-since

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- Documentation/fetch-options.txt | 4 Documentation/git-fetch-pack.txt| 4 Documentation/gitremote-helpers.txt | 3 +++ builtin/fetch-pack.c| 4 builtin/fetch.c | 2

[PATCH 13/27] fetch-pack.c: mark strings for translating

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- fetch-pack.c | 75 ++-- 1 file changed, 37 insertions(+), 38 deletions(-) diff --git a/fetch-pack.c b/fetch-pack.c index 4020744..08caf1d 100644 --- a/fetch-pack.c +++ b

[PATCH 15/27] shallow.c: implement a generic shallow boundary finder based on rev-list

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Instead of a custom commit walker like get_shallow_commits(), this new function uses rev-list to mark NOT_SHALLOW to all reachable commits, except borders. The definition of reachable is to be defined by the protocol later. This makes it more flexible to define shallow boundary. The way we find bo

[PATCH 21/27] upload-pack: support define shallow boundary by excluding revisions

2016-06-10 Thread Nguyễn Thái Ngọc Duy
This should allow the user to say "create a shallow clone of this branch after version ". Short refs are accepted and expanded at the server side with expand_ref() because we cannot expand (unknown) refs from the client side. Like deepen-since, deepen-not cannot be used with deepen. But deepen-no

[PATCH 22/27] fetch: define shallow boundary with --shallow-exclude

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/fetch-options.txt | 5 + Documentation/git-fetch-pack.txt| 5 + Documentation/gitremote-helpers.txt | 4 builtin/fetch-pack.c| 7 +++ builtin/fetch.c | 13 ++--- fetch-pa

[PATCH 19/27] t5500, t5539: tests for shallow depth since a specific date

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t5500-fetch-pack.sh | 24 t/t5539-fetch-http-shallow.sh | 25 + 2 files changed, 49 insertions(+) diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index e5f83bf..26f050d 100755 --- a/t/t5

[PATCH 18/27] clone: define shallow clone boundary based on time with --shallow-since

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- Documentation/git-clone.txt | 3 +++ builtin/clone.c | 16 +--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index b7c467a..

[PATCH 20/27] refs: add expand_ref()

2016-06-10 Thread Nguyễn Thái Ngọc Duy
This is basically dwim_ref() without @{} support. To be used on the server side where we want to expand abbreviated to full ref names and nothing else. The first user is "git clone/fetch --shallow-exclude". Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- refs.c | 8 +++

[PATCH 26/27] upload-pack: add get_reachable_list()

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- object.h | 2 +- upload-pack.c | 52 +--- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/object.h b/object.h index f8b6442..614a006 100644 --- a/object.h +

[PATCH 25/27] upload-pack: split check_unreachable() in two, prep for get_reachable_list()

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- upload-pack.c | 44 +++- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/upload-pack.c b/upload-pack.c index 3f40fcb..5942f99 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -452,23 +452,23 @@ static

[PATCH 23/27] clone: define shallow clone boundary with --shallow-exclude

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-clone.txt | 5 + builtin/clone.c | 10 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Documentation/git-clone.txt b/Documentation/git-clone.txt index a410409..5049663 100644 --- a/Documentation/g

[PATCH 24/27] t5500, t5539: tests for shallow depth excluding a ref

2016-06-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- t/t5500-fetch-pack.sh | 21 + t/t5539-fetch-http-shallow.sh | 22 ++ 2 files changed, 43 insertions(+) diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 26f050d..145b370 100755 --- a/t/t5500-fe

[PATCH 27/27] fetch, upload-pack: --deepen=N extends shallow boundary by N commits

2016-06-10 Thread Nguyễn Thái Ngọc Duy
In git-fetch, --depth argument is always relative with the latest remote refs. This makes it a bit difficult to cover this use case, where the user wants to make the shallow history, say 3 levels deeper. It would work if remote refs have not moved yet, but nobody can guarantee that, especially when

Re: [PATCH v2 00/33] Yet more preparation for reference backends

2016-06-10 Thread Michael Haggerty
On 05/06/2016 06:13 PM, Michael Haggerty wrote: > [...] > This patch series is also available from my GitHub repo [2] as branch > "split-under-lock". > > [1] http://thread.gmane.org/gmane.comp.version-control.git/292772 > [2] https://github.com/mhagger/git I was reading this area of the code agai

Re: [PATCH v4 2/3] completion: add __git_get_option_value helper

2016-06-10 Thread SZEDER Gábor
Hallo Thomas, I saw v5 hit my mailbox while writing this. I glanced it over and it seems my comments here apply to that version as well. Quoting Thomas Braun : This function allows to search the commmand line and config files for an option, long and short, with mandatory value. The function

Re: [PATCH 1/2] bisect--helper: `is_expected_rev` shell function in C

2016-06-10 Thread Pranit Bauva
Hey Eric, On Fri, Jun 10, 2016 at 3:03 AM, Eric Sunshine wrote: > On Wed, Jun 8, 2016 at 11:24 AM, Pranit Bauva wrote: >> Reimplement `is_expected_rev` shell function in C. This will further be >> called from `check_expected_revs` function. This is a quite small >> function thus subcommand facil

[PATCH] Fix spelling of "occurred"

2016-06-10 Thread Peter Colberg
Signed-off-by: Peter Colberg --- config.c| 2 +- po/bg.po| 2 +- po/ca.po| 2 +- po/de.po| 2 +- po/fr.po| 2 +- po/git.pot | 2 +- po/ko.po| 2 +- po/pt_PT.po | 2 +- po/ru.po| 2 +- po/sv.po| 2 +- po/vi.po| 2 +- po/zh_CN.po | 2 +- refs.h | 2 +- 13 f

Re: [PATCH v2 00/33] Yet more preparation for reference backends

2016-06-10 Thread Junio C Hamano
Michael Haggerty writes: > Junio, if you want to incorporate this revised version of the branch in > your big rewind of next, then we can pretend that the bug was never > there :-) Otherwise, tell me in what form you would like the fix and I > will be happy to provide it. We actually can do both

Re: [PATCH] Adds *~ to the .gitignore

2016-06-10 Thread Junio C Hamano
Jeff King writes: > On Thu, Jun 09, 2016 at 03:48:12PM -0700, Junio C Hamano wrote: > >> As I said, however, I could support a move to add some selected >> small number of common file extensions, as long as we have some >> (social) mechanism to avoid churning this file every time somebody >> new

Re: [PATCH 05/38] refs: create a base class "ref_store" for files_ref_store

2016-06-10 Thread Junio C Hamano
Michael Haggerty writes: > On 06/09/2016 06:14 PM, Junio C Hamano wrote: >> Michael Haggerty writes: >> > +static struct ref_store *main_ref_store = NULL; > + > +static struct ref_store *submodule_ref_stores = NULL; Let's let BSS take care of these initialization. >> [...]

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Junio C Hamano
Jeff King writes: > On Fri, Jun 10, 2016 at 03:50:43AM -0400, Jeff King wrote: > >> I found a false positive with the new compaction heuristic in v2.9: >> [...] > > And by the way, this is less "hey neat, I found a case" and more "wow, > this is a lot worse than I thought". > > I diffed the old a

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Stefan Beller
On Fri, Jun 10, 2016 at 8:56 AM, Junio C Hamano wrote: > Jeff King writes: > >> On Fri, Jun 10, 2016 at 03:50:43AM -0400, Jeff King wrote: >> >>> I found a false positive with the new compaction heuristic in v2.9: >>> [...] >> >> And by the way, this is less "hey neat, I found a case" and more "w

Re: [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Jacob Keller
On Fri, Jun 10, 2016 at 9:25 AM, Stefan Beller wrote: > On Fri, Jun 10, 2016 at 8:56 AM, Junio C Hamano wrote: >> Jeff King writes: >> >>> On Fri, Jun 10, 2016 at 03:50:43AM -0400, Jeff King wrote: >>> I found a false positive with the new compaction heuristic in v2.9: [...] >>> >>> An

Re: [PATCHv4] Documentation: triangular workflow

2016-06-10 Thread Junio C Hamano
"Philip Oakley" writes: >> +Preparation >> +~~~ >> + >> +Cloning from **PUBLISH**, which is a fork of **UPSTREAM** or an empty >> +repository. > > I agree here. To clone the upstream, to which you have no push access (by > definition), would leave the config badly mis-set for the basic u

Re: [PATCH v2 00/94] libify apply and use lib in am

2016-06-10 Thread Johannes Sixt
Am 10.06.2016 um 13:11 schrieb Johannes Schindelin: On Fri, 10 Jun 2016, Christian Couder wrote: On Fri, Jun 10, 2016 at 9:01 AM, Johannes Schindelin wrote: I lost track in the meantime: were those issues with unclosed file handles and unreleased memory in the error code paths addressed system

Re* [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Junio C Hamano
Jacob Keller writes: > I think we could use the indentation trick and it might help in this > case. I agree, let's disable this for this cycle and experiment in the > next one. Good catch, Peff. > > As others have said you will always be able to produce counter > examples, that's the nature of he

Re: Re* [BUG-ish] diff compaction heuristic false positive

2016-06-10 Thread Stefan Beller
On Fri, Jun 10, 2016 at 11:13 AM, Junio C Hamano wrote: > Subject: [PATCH] diff: disable compaction heuristic for now > > http://lkml.kernel.org/g/20160610075043.ga13...@sigill.intra.peff.net > reports that a change to add a new "function" with common ending > with the existing one at the end of t

Re: [PATCH] Fix spelling of "occurred"

2016-06-10 Thread Pranit Bauva
Hey Peter, On Fri, Jun 10, 2016 at 7:52 PM, Peter Colberg wrote: > Signed-off-by: Peter Colberg > --- > config.c| 2 +- > po/bg.po| 2 +- > po/ca.po| 2 +- > po/de.po| 2 +- > po/fr.po| 2 +- > po/git.pot | 2 +- > po/ko.po| 2 +- > po/pt_PT.po | 2 +- > po/ru.po| 2

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

2016-06-10 Thread David Turner
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 reference. error is > + * true iff there was an error reading the reference; otherwise, oid "error" is not a

[PATCH v2] Fix spelling of "occurred"

2016-06-10 Thread Peter Colberg
Signed-off-by: Peter Colberg --- config.c | 2 +- refs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config.c b/config.c index f51c56b..d7ce34b 100644 --- a/config.c +++ b/config.c @@ -1281,7 +1281,7 @@ static void git_config_raw(config_fn_t fn, void *data)

Re: [PATCH 1/2] bisect--helper: `is_expected_rev` shell function in C

2016-06-10 Thread Eric Sunshine
On Fri, Jun 10, 2016 at 9:39 AM, Pranit Bauva wrote: > On Fri, Jun 10, 2016 at 3:03 AM, Eric Sunshine > wrote: >> On Wed, Jun 8, 2016 at 11:24 AM, Pranit Bauva wrote: >>> Reimplement `is_expected_rev` shell function in C. This will further be >>> called from `check_expected_revs` function. This

Re: [PATCH 04/27] upload-pack: move "shallow" sending code out of deepen()

2016-06-10 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > @@ -551,16 +565,7 @@ static void deepen(int depth, const struct object_array > *shallows) > backup = result = > get_shallow_commits(&want_obj, depth, > SHALLOW, NOT_SHALLOW); > - whi

Re: [PATCH 05/27] upload-pack: remove unused variable "backup"

2016-06-10 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > After the last patch, "result" and "backup" are the same. "result" used > to move, but the movement is now contained in send_shallow(). Delete > this redundant variable. > > Signed-off-by: Nguyễn Thái Ngọc Duy > Signed-off-by: Junio C Hamano > --- Ah, OK ;-) Ha

Re: [PATCH 06/27] upload-pack: move "unshallow" sending code out of deepen()

2016-06-10 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > +static void deepen(int depth, const struct object_array *shallows) > +{ > + struct commit_list *result = NULL; > + int i; > + if (depth == INFINITE_DEPTH && !is_repository_shallow()) > + for (i = 0; i < shallows->nr; i++) { > +

[PATCH v6 02/44] builtin/apply: make apply_patch() return -1 instead of die()ing

2016-06-10 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 v6 00/44] libify apply and use lib in am, part 2

2016-06-10 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

[PATCH v6 01/44] apply: move 'struct apply_state' to apply.h

2016-06-10 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. Helped-by: Eric Sunshine Signed-off-by: Christian Couder --- apply.h | 100 ++

[PATCH v6 10/44] apply: make init_apply_state() return -1 instead of exit()ing

2016-06-10 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(). Helped-by: Eric Sunshine Signed-off-by: Chri

[PATCH v6 17/44] builtin/apply: change die_on_unsafe_path() to check_unsafe_path()

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

2016-06-10 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 v6 16/44] builtin/apply: make gitdiff_*() return -1 on error

2016-06-10 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 v6 21/44] builtin/apply: make add_index_file() return -1 on error

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

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

2016-06-10 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 v6 06/44] builtin/apply: make parse_single_patch() return -1 on error

2016-06-10 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 v6 25/44] builtin/apply: make try_create_file() return -1 on error

2016-06-10 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 v6 30/44] apply: make some parsing functions static again

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

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

2016-06-10 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 v6 22/44] builtin/apply: make create_file() return -1 on error

2016-06-10 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 v6 28/44] apply: rename and move opt constants to apply.h

2016-06-10 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 v6 27/44] builtin/apply: rename option parsing functions

2016-06-10 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 v6 35/44] apply: add 'be_silent' variable to 'struct apply_state'

2016-06-10 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 v6 40/44] apply: change error_routine when be_silent is set

2016-06-10 Thread Christian Couder
Signed-off-by: Christian Couder --- apply.c | 23 +-- apply.h | 4 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/apply.c b/apply.c index 2529534..ef49709 100644 --- a/apply.c +++ b/apply.c @@ -109,6 +109,11 @@ void clear_apply_state(struct apply_state *

[PATCH v6 42/44] run-command: make dup_devnull() static again

2016-06-10 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 d8ed

[PATCH v6 39/44] usage: add get_error_routine() and get_warn_routine()

2016-06-10 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 v6 31/44] run-command: make dup_devnull() non static

2016-06-10 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

  1   2   >