[PATCH 29/38] split_symref_update(): add a files_ref_store argument

2016-06-03 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs/files-backend.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 24b7c60..8d3cf96 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -3405,7 +3405,8 @@ static int

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

2016-06-03 Thread Michael Haggerty
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 --- refs.c | 91 ++ refs/files-backend.c

[PATCH 30/38] files_ref_iterator_begin(): take a ref_store argument

2016-06-03 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs.c | 2 +- refs/files-backend.c | 4 ++-- refs/refs-internal.h | 8 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/refs.c b/refs.c index 2d84c5c..bda8fc1 100644 --- a/refs.c +++ b/refs.c @@ -1157,7 +1157,7 @@ static

[PATCH 35/38] refs: add methods to init refs db

2016-06-03 Thread Michael Haggerty
From: David Turner Alternate refs backends might not need the refs/heads directory and so on, so we make ref db initialization part of the backend. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty --- builtin/init-db.c| 21

Re: [PATCH v2 00/13] Reference iterators

2016-06-03 Thread Michael Haggerty
On 06/03/2016 11:33 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> This patch series applies on top of mh/split-under-lock. It can also >> be obtained from my GitHub repo [2] as branch "ref-iterators". > > Ah, that reminds me. What's the donene

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

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

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

2016-06-07 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-upda

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

2016-06-07 Thread Michael Haggerty
ugh the symref; we can read the referent directly. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 98c8b95..b8d7a9a 100644 --- a/refs/files-backend.c +++ b/refs/files-ba

[PATCH 3/5] t1404: add more tests of update-ref error handling

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

[PATCH 2/5] t1404: document function test_update_rejected

2016-06-07 Thread Michael Haggerty
And declare its variables to be local. Signed-off-by: Michael Haggerty --- t/t1404-update-ref-errors.sh | 4 1 file changed, 4 insertions(+) diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh index 2818460..a62d62a 100755 --- a/t/t1404-update-ref-errors.sh +++ b/t

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

2016-06-07 Thread Michael Haggerty
ps://github.com/mhagger/git Michael Haggerty (5): t1404: rename file to t1404-update-ref-errors.sh t1404: document function test_update_rejected t1404: add more tests of update-ref error handling lock_ref_for_update(): make error handling more uniform lock_ref_for_update(): avoid a sy

Re: [PATCH v2 00/13] Reference iterators

2016-06-07 Thread Michael Haggerty
On 06/04/2016 01:40 AM, Junio C Hamano wrote: > Michael Haggerty writes: > >> On 06/03/2016 11:33 PM, Junio C Hamano wrote: >>> [...] >>> Ah, that reminds me. What's the doneness of the dependent topic? >> [...] > > What I meant was the doneness

Re: [PATCH V2 3/3] strbuf: allow to use preallocated memory

2016-06-08 Thread Michael Haggerty
On 06/07/2016 11:06 AM, William Duclot wrote: > [...] > The "fixed" feature was aimed to allow the users to use strbuf with > strings that they doesn't own themselves (a function parameter for > example). From Michael example in the original mail: > > void f(char *path_buf, size_t path_buf_len) >

Re: [PATCH v2 12/13] dir_iterator: new API for iterating over a directory tree

2016-06-09 Thread Michael Haggerty
On 06/07/2016 07:13 AM, Eric Sunshine wrote: > On Fri, Jun 3, 2016 at 8:33 AM, Michael Haggerty wrote: >> The iterator interface is modeled on that for references, though no >> vtable is necessary because there is (so far?) only one type of >> dir_iterator. >> [...] >

Re: [PATCH v2 12/13] dir_iterator: new API for iterating over a directory tree

2016-06-09 Thread Michael Haggerty
On 06/09/2016 01:46 PM, Michael Haggerty wrote: > On 06/07/2016 07:13 AM, Eric Sunshine wrote: >> [...] > Thanks for all your great comments! Junio, Given that ref-iterators is in next but also that you will soon be rewinding next, would you like these tweaks as a re-roll of the bran

Re: [PATCH] refs: mark the file-local vtable symbols as static

2016-06-09 Thread Michael Haggerty
On 06/08/2016 08:55 PM, Junio C Hamano wrote: > Ramsay Jones writes: > >> Signed-off-by: Ramsay Jones >> --- >> >> Hi Michael, Junio, >> >> I would normally ask you to squash this into the relevant patch when >> you next re-roll your 'mh/ref-iterators' branch, but this has already >> been merged

Re: [PATCH 02/38] rename_ref_available(): add docstring

2016-06-09 Thread Michael Haggerty
On 06/07/2016 08:10 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> From: David Turner >> >> Signed-off-by: David Turner >> Signed-off-by: Junio C Hamano >> Signed-off-by: Michael Haggerty >> --- >> refs/refs-internal.h | 5

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

2016-06-09 Thread Michael Haggerty
On 06/07/2016 07:03 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> 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 submodu

Re: [PATCH 17/38] resolve_gitlink_ref(): avoid memory allocation in many cases

2016-06-09 Thread Michael Haggerty
On 06/07/2016 07:29 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> If we don't have to strip trailing '/' from the submodule path, then >> don't allocate and copy the submodule name. > > Makes sense. > >> int resolve_gitlin

Re: [PATCH 21/38] refs: make pack_refs() virtual

2016-06-09 Thread Michael Haggerty
On 06/07/2016 07:35 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> Signed-off-by: Michael Haggerty >> --- >> refs.c | 7 +++ >> refs/files-backend.c | 6 -- >> refs/refs-internal.h | 4 >> 3 files changed, 15 inse

Re: [PATCH 23/38] refs: make peel_ref() virtual

2016-06-09 Thread Michael Haggerty
On 06/07/2016 07:36 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> For now it only supports the main reference store. > > Isn't this comment applicable to a handful of recent changes that > made other things virtual, too? Just wondering if I am missing >

Re: [PATCH 34/38] refs: add method for delete_refs

2016-06-09 Thread Michael Haggerty
On 06/07/2016 07:43 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> From: David Turner >> >> In the file-based backend, delete_refs has some special optimization >> to deal with packed refs. In other backends, we might be able to make >> ref dele

Re: [PATCH 37/38] refs: make lock generic

2016-06-09 Thread Michael Haggerty
On 06/07/2016 07:50 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> From: David Turner >> >> Instead of including a files-backend-specific struct ref_lock, change >> the generic ref_update struct to include a void pointer that backends >>

Re: [PATCH 2/5] t1404: document function test_update_rejected

2016-06-09 Thread Michael Haggerty
On 06/07/2016 06:57 PM, Johannes Sixt wrote: > Am 07.06.2016 um 13:50 schrieb Michael Haggerty: >> test_update_rejected () { >> +local prefix before pack create error && > > Do we want to add more of unportable 'local' declarations? Sorry, I forgot th

Re: [PATCH 37/38] refs: make lock generic

2016-06-09 Thread Michael Haggerty
On 06/07/2016 07:50 PM, Junio C Hamano wrote: > [...] Thanks for all your comments, Junio. I've pushed a revised version of the patch series to my GitHub fork [1] as branch "ref-store", but I'll wait for a little longer to see if there are more comments on the list before sending a re-roll. Micha

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

2016-06-09 Thread Michael Haggerty
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

Re: [PATCH 2/5] t1404: document function test_update_rejected

2016-06-09 Thread Michael Haggerty
On 06/09/2016 06:05 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> On 06/07/2016 06:57 PM, Johannes Sixt wrote: >>> Am 07.06.2016 um 13:50 schrieb Michael Haggerty: >>>> test_update_rejected () { >>>> +local prefix before pack crea

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

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

2016-06-10 Thread Michael Haggerty
rather than taking the prefix as an argument. Signed-off-by: Michael Haggerty --- t/t1404-update-ref-errors.sh | 27 +-- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/t/t1404-update-ref-errors.sh b/t/t1404-update-ref-errors.sh index 2818460..541cad1 100755

[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

[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
https://github.com/mhagger/git Michael Haggerty (6): t1404: rename file to t1404-update-ref-errors.sh t1404: remove "prefix" argument to test_update_rejected t1404: document function test_update_rejected t1404: add more tests of update-ref error handling lock_ref_for_update(): make

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

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

2016-06-10 Thread Michael Haggerty
ugh the symref; we can read the referent directly. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 98c8b95..b8d7a9a 100644 --- a/refs/files-backend.c +++ b/refs/files-ba

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

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_

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 r

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

2016-06-13 Thread Michael Haggerty
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 reference. error is >> +

[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 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 >>> + * a

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

2016-06-15 Thread Michael Haggerty
On 06/14/2016 07:03 AM, Eric Sunshine wrote: > 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. Asi

Re: [PATCH] diff compaction heuristic: favor shortest neighboring blank lines

2016-06-16 Thread Michael Haggerty
On 06/16/2016 07:46 PM, Stefan Beller wrote: > The compaction heuristic for diffs was deemed quite good, but in 5580b27 > we have an example demonstrates a common case, that fails with the existing > heuristic. That is why we disabled the heuristic in the v2.9.0 release. > > With this patch a diff

[PATCH v3 00/13] Reference iterators

2016-06-17 Thread Michael Haggerty
mp.version-control.git/296801 [3] https://github.com/mhagger/git Michael Haggerty (13): refs: remove unnecessary "extern" keywords do_for_each_ref(): move docstring to the header file refs: use name "prefix" consistently delete_refs(): add a flags argument remote rm: ha

[PATCH v3 02/13] do_for_each_ref(): move docstring to the header file

2016-06-17 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs/files-backend.c | 9 - refs/refs-internal.h | 10 +- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index bbf96ad..8fa897b 100644 --- a/refs/files-backend.c +++ b/refs/files

[PATCH v3 09/13] refs: introduce an iterator interface

2016-06-17 Thread Michael Haggerty
trees and possibly other types of iterators in the future. Signed-off-by: Ramsay Jones Signed-off-by: Michael Haggerty --- Makefile | 1 + iterator.h | 81 refs.h | 4 +- refs/files-backend.c | 281 +

[PATCH v3 07/13] entry_resolves_to_object(): rename function from ref_resolves_to_object()

2016-06-17 Thread Michael Haggerty
Free up the old name for a more general purpose. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index b563a7e..c24a78e 100644 --- a/refs/files-backend.c +++ b/refs

[PATCH v3 13/13] for_each_reflog(): reimplement using iterators

2016-06-17 Thread Michael Haggerty
fter this patch). Signed-off-by: Ramsay Jones Signed-off-by: Michael Haggerty --- refs/files-backend.c | 113 --- refs/refs-internal.h | 7 2 files changed, 78 insertions(+), 42 deletions(-) diff --git a/refs/files-backend.c b/refs/files-

[PATCH v3 10/13] do_for_each_ref(): reimplement using reference iteration

2016-06-17 Thread Michael Haggerty
ation in a more straightforward manner. If we rewrite all callers to use the reference iteration API, then we can remove the current_ref_iter hack permanently. Signed-off-by: Michael Haggerty --- refs.c | 20 + refs/files-backend.c | 206 ++

[PATCH v3 08/13] ref_resolves_to_object(): new function

2016-06-17 Thread Michael Haggerty
Extract new function ref_resolves_to_object() from entry_resolves_to_object(). It can be used even if there is no ref_entry at hand. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 33 +++-- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a

[PATCH v3 12/13] dir_iterator: new API for iterating over a directory tree

2016-06-17 Thread Michael Haggerty
. Signed-off-by: Michael Haggerty --- Makefile | 1 + dir-iterator.c | 202 + dir-iterator.h | 87 + 3 files changed, 290 insertions(+) create mode 100644 dir-iterator.c create mode 100644 dir-iterator.h

[PATCH v3 01/13] refs: remove unnecessary "extern" keywords

2016-06-17 Thread Michael Haggerty
There's continuing work in this area, so clean up unneeded "extern" keywords rather than schlepping them around. Also split up some overlong lines and add parameter names in a couple of places. Signed-off-by: Michael Haggerty --

[PATCH v3 11/13] for_each_reflog(): don't abort for bad references

2016-06-17 Thread Michael Haggerty
es for the purpose of determining object reachability!) and wouldn't benefit from a truncated iteration anyway. So instead, emit an error message and skip the "broken" reflog, but continue with the iteration. Signed-off-by: Michael Haggerty --- refs/files-backend.c | 2 +- 1

[PATCH v3 04/13] delete_refs(): add a flags argument

2016-06-17 Thread Michael Haggerty
This will be useful for passing REF_NODEREF through. Signed-off-by: Michael Haggerty --- builtin/fetch.c | 2 +- builtin/remote.c | 4 ++-- refs.h | 5 +++-- refs/files-backend.c | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/builtin/fetch.c b

[PATCH v3 06/13] get_ref_cache(): only create an instance if there is a submodule

2016-06-17 Thread Michael Haggerty
If there is not a nonbare repository where a submodule is supposedly located, then don't instantiate a ref_cache for it. The analogous check can be removed from resolve_gitlink_ref(). Signed-off-by: Michael Haggerty --- refs/files-backend.c | 33 ++--- 1

[PATCH v3 05/13] remote rm: handle symbolic refs correctly

2016-06-17 Thread Michael Haggerty
option set to REF_NODEREF. Signed-off-by: Michael Haggerty --- builtin/remote.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index 1bbf9b4..c4b4d67 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -539,10 +539,6 @@ static int

[PATCH v3 03/13] refs: use name "prefix" consistently

2016-06-17 Thread Michael Haggerty
In the context of the for_each_ref() functions, call the prefix that references must start with "prefix". (In some places it was called "base".) This is clearer, and also prevents confusion with another planned use of the word "base". Signed-off-by: Michael Hagge

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

2016-06-17 Thread Michael Haggerty
On 06/17/2016 05:20 AM, Junio C Hamano wrote: > [...] > * mh/ref-iterators (2016-06-03) 13 commits > (merged to 'next' on 2016-06-06 at c8e79dc) > + for_each_reflog(): reimplement using iterators > + dir_iterator: new API for iterating over a directory tree > + for_each_reflog(): don't abort f

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

2016-06-18 Thread Michael Haggerty
On 06/18/2016 12:05 AM, Lars Schneider wrote: > >> On 17 Jun 2016, at 05:20, Junio C Hamano wrote: >> >> ... >> >> * mh/split-under-lock (2016-05-13) 33 commits >> (merged to 'next' on 2016-06-03 at 2e71330) >> [...] > > This topic seems break two git-p4 tests (t9801 and t9803) on next: > https

Re: [PATCH] xdiffi.c: mark some file-local symbols as static

2016-08-11 Thread Michael Haggerty
On 08/05/2016 10:57 PM, Ramsay Jones wrote: > If you need to re-roll your 'mh/diff-indent-heuristic' branch, could > you please squash this into the relevant patch (e199b6e2, "diff: improve > positioning of add/delete blocks in diffs", 04-08-2016). Will do. Thanks, Ramsay! Michael -- To unsubsc

Re: [PATCH 8/8] diff: improve positioning of add/delete blocks in diffs

2016-08-12 Thread Michael Haggerty
On 08/04/2016 09:56 AM, Jeff King wrote: > On Thu, Aug 04, 2016 at 12:00:36AM +0200, Michael Haggerty wrote: > >> This table shows the number of diff slider groups that were positioned >> differently than the human-generated values, for various repositories. >> "defa

Re: [PATCH 8/8] diff: improve positioning of add/delete blocks in diffs

2016-08-12 Thread Michael Haggerty
On 08/04/2016 09:52 PM, Junio C Hamano wrote: > Michael Haggerty writes: >> +#define START_OF_FILE_BONUS 9 >> +#define END_OF_FILE_BONUS 46 >> +#define TOTAL_BLANK_WEIGHT 4 >> +#define PRE_BLANK_WEIGHT 16 >> +#define RELATIVE_INDENT_BONUS -1 >> +#de

Re: [PATCH 8/8] diff: improve positioning of add/delete blocks in diffs

2016-08-12 Thread Michael Haggerty
On 08/04/2016 06:55 PM, Stefan Beller wrote: > [...] > I have just reread the scoring function and I think you could pull out the > `score=indent` assignment (it is always assigned except for indent <0) > > if (indent == -1) >score = 0; > else >score

Re: [PATCH 1/8] xdl_change_compact(): rename some local variables for clarity

2016-08-14 Thread Michael Haggerty
On 08/04/2016 09:06 AM, Jeff King wrote: > On Thu, Aug 04, 2016 at 12:00:29AM +0200, Michael Haggerty wrote: > >> * ix -> i >> * ixo -> io >> * ixs -> start >> * grpsiz -> groupsize > > After your change, I immediately understand three of them. Bu

[PATCH v2 0/7] Better heuristics make prettier diffs

2016-08-22 Thread Michael Haggerty
.com/mhagger/git [3] https://github.com/mhagger/diff-slider-tools Michael Haggerty (7): xdl_change_compact(): fix compaction heuristic to adjust ixo xdl_change_compact(): only use heuristic if group can't be matched is_blank_line(): take a single xrecord_t as argument recs_match(): take

[PATCH v2 1/7] xdl_change_compact(): fix compaction heuristic to adjust ixo

2016-08-22 Thread Michael Haggerty
ce ixo was too large at the end of that iteration, it will be incremented past the end of the xdfo->rchg array, and will try to read that memory illegally. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c

[PATCH v2 2/7] xdl_change_compact(): only use heuristic if group can't be matched

2016-08-22 Thread Michael Haggerty
group higher than the blank line. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 38 +++--- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index 95b037e..61deed8 100644 --- a/xdiff/xdiffi.c +++ b/xdiff/xdiffi.c

[PATCH v2 6/7] diff: improve positioning of add/delete blocks in diffs

2016-08-22 Thread Michael Haggerty
ation and analysis, along with the human-generated data values, are recorded in a separate project [1]. This patch adds a new command-line option `--indent-heuristic`, and a new configuration setting `diff.indentHeuristic`, that activate this heuristic. This interface is only meant for te

[PATCH v2 3/7] is_blank_line(): take a single xrecord_t as argument

2016-08-22 Thread Michael Haggerty
There is no reason for it to take an array and index as argument, as it only accesses a single element of the array. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index 61deed8

[PATCH v2 4/7] recs_match(): take two xrecord_t pointers as arguments

2016-08-22 Thread Michael Haggerty
There is no reason for it to take an array and two indexes as argument, as it only accesses two elements of the array. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index

[PATCH v2 5/7] xdl_change_compact(): introduce the concept of a change group

2016-08-22 Thread Michael Haggerty
o-index --compaction-heuristic a.txt b.txt diff --git a/a.txt b/b.txt index e53969f..0d60c5fe 100644 --- a/a.txt +++ b/b.txt @@ -1,3 +1,7 @@ 1 +A + +B + A 2 The new code gives the bottom answer. Signed-off-by: Michael Haggerty ---

[PATCH v2 7/7] blame: actually use the diff opts parsed from the command line

2016-08-22 Thread Michael Haggerty
d, rely on diff_opt_parse() to parse all of the diff options, including "-w" and "--minimal", and pass the resulting xdl_opts to xdi_diff(). Signed-off-by: Michael Haggerty --- Somebody who knows more about how diff operations are configured should please review this. I'

Re: on Amazon EFS (NFS): "Reference directory conflict: refs/heads/" with status code 128

2016-08-24 Thread Michael Haggerty
On 08/24/2016 11:39 PM, Jeff King wrote: > On Wed, Aug 24, 2016 at 04:52:33PM -0400, Alex Nauda wrote: > >> Elastic File System (EFS) is Amazon's scalable filesystem product that >> is exposed to the OS as an NFS mount. We're using EFS to host the >> filesystem used by a Jenkins CI server. Sometim

Re: on Amazon EFS (NFS): "Reference directory conflict: refs/heads/" with status code 128

2016-08-25 Thread Michael Haggerty
On 08/25/2016 06:01 PM, Alex Nauda wrote: > On Thu, Aug 25, 2016 at 2:28 AM, Michael Haggerty > wrote: >> On 08/24/2016 11:39 PM, Jeff King wrote: >>> On Wed, Aug 24, 2016 at 04:52:33PM -0400, Alex Nauda wrote: >>> >>>> Elastic File System (EFS) is

[PATCH v2 06/38] add_packed_ref(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 439c500..c544de8 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c

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

2016-09-04 Thread Michael Haggerty
-submodule references. And, since the code is now agnostic about reference backends, it will work for any future references backend (so move its definition to refs.c). Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 24 +++ refs/files-back

[PATCH v2 04/38] refs: add a backend method structure

2016-09-04 Thread Michael Haggerty
, the backends cannot do anything. Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Jeff King Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 19 +++ refs.h | 2

[PATCH v2 03/38] refs: rename struct ref_cache to files_ref_store

2016-09-04 Thread Michael Haggerty
to hold the reference caches. So let's treat ref_caches as embryo ref_stores, and build them out from there. As the first step, simply rename `ref_cache` to `files_ref_store`, and rename some functions and attributes correspondingly. Signed-off-by: Michael Haggerty Signed-off-by: Junio C H

[PATCH v2 08/38] resolve_missing_loose_ref(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 2fc8ec9..0c92ace 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c

[PATCH v2 01/38] resolve_gitlink_ref(): eliminate temporary variable

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 12290d2..74c2c47 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c

[PATCH v2 07/38] get_packed_ref(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index c544de8..2fc8ec9 100644 --- a/refs/files-backend.c +++ b/refs/files

[PATCH v2 10/38] refs: add a transaction_commit() method

2016-09-04 Thread Michael Haggerty
From: Ronnie Sahlberg Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Jeff King Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 9 + refs/files-backend.c | 10 ++ refs/refs

[PATCH v2 18/38] resolve_gitlink_ref(): rename path parameter to submodule

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 13 +++-- refs.h | 9 + 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/refs.c b/refs.c index 34c0c5e..e881874 100644 --- a/refs.c +++ b/refs.c @@ -1299,26 +1299,27 @@ const char

[PATCH v2 02/38] rename_ref_available(): add docstring

2016-09-04 Thread Michael Haggerty
From: David Turner And improve the internal variable names. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 12 ++-- refs/refs-internal.h | 12 +++- 2 files changed, 17

[PATCH v2 14/38] read_raw_ref(): take a (struct ref_store *) argument

2016-09-04 Thread Michael Haggerty
And make the function work for submodules. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 4 +++- refs/files-backend.c | 18 +- refs/refs-internal.h | 9 ++--- 3 files changed, 22 insertions(+), 9 deletions(-) diff --git a/refs.c

[PATCH v2 00/38] Virtualization of the refs API

2016-09-04 Thread Michael Haggerty
lable(): add docstring refs: add methods for reflog refs: add method for initial ref transaction commit refs: make delete_refs() virtual refs: add methods to init refs db refs: add method to rename refs refs: make lock generic refs: implement iteration over only per-worktree refs Mi

[PATCH v2 31/38] refs: add method iterator_begin

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 2 +- refs/files-backend.c | 3 ++- refs/refs-internal.h | 24 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/refs.c b/refs.c index d00126b..798b08a 100644 --- a

[PATCH v2 22/38] refs: make create_symref() virtual

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 9 + refs/files-backend.c | 7 ++- refs/refs-internal.h | 5 + 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 961927a..74874e5 100644 --- a/refs.c +++ b

[PATCH v2 33/38] refs: add method for initial ref transaction commit

2016-09-04 Thread Michael Haggerty
From: David Turner Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 8 refs/files-backend.c | 8 +--- refs/refs-internal.h | 1 + 3 files changed

[PATCH v2 29/38] split_symref_update(): add a files_ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index ab2c1de..3a0db5a 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c

[PATCH v2 30/38] files_ref_iterator_begin(): take a ref_store argument

2016-09-04 Thread Michael Haggerty
Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 2 +- refs/files-backend.c | 4 ++-- refs/refs-internal.h | 8 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/refs.c b/refs.c index f10f86a..d00126b 100644 --- a/refs.c +++ b/refs.c

[PATCH v2 37/38] refs: make lock generic

2016-09-04 Thread Michael Haggerty
From: David Turner Instead of including a files-backend-specific struct ref_lock, change the generic ref_update struct to include a void pointer that backends can use for their own arbitrary data. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty

[PATCH v2 35/38] refs: add methods to init refs db

2016-09-04 Thread Michael Haggerty
From: David Turner Alternate refs backends might not need the refs/heads directory and so on, so we make ref db initialization part of the backend. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- builtin/init-db.c

[PATCH v2 38/38] refs: implement iteration over only per-worktree refs

2016-09-04 Thread Michael Haggerty
iterating. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 4 refs/refs-internal.h | 10 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/refs/files-backend.c b/refs/files

[PATCH v2 09/38] {lock,commit,rollback}_packed_refs(): add files_ref_store arguments

2016-09-04 Thread Michael Haggerty
These functions currently only work in the main repository, so add an assert_main_repository() check to each function. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 32 1 file changed, 16 insertions(+), 16 deletions

[PATCH v2 23/38] refs: make peel_ref() virtual

2016-09-04 Thread Michael Haggerty
For now it only supports the main reference store. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 7 +++ refs/files-backend.c | 6 -- refs/refs-internal.h | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c

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

2016-09-04 Thread Michael Haggerty
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 exactly one ref_store for the main repository and one for any submodules whose references have been accessed. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano

[PATCH v2 13/38] resolve_gitlink_packed_ref(): remove function

2016-09-04 Thread Michael Haggerty
Now that resolve_packed_ref() can work with an arbitrary files_ref_store, there is no need to have a separate resolve_gitlink_packed_ref() function. Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/files-backend.c | 26 +- 1 file changed, 5

[PATCH v2 36/38] refs: add method to rename refs

2016-09-04 Thread Michael Haggerty
From: David Turner This removes the last caller of function get_files_ref_store(), so remove it. Signed-off-by: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 7 +++ refs/files-backend.c | 24

[PATCH v2 34/38] refs: make delete_refs() virtual

2016-09-04 Thread Michael Haggerty
: David Turner Signed-off-by: Junio C Hamano Signed-off-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs.c | 7 +++ refs/files-backend.c | 6 -- refs/refs-internal.h | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index

<    1   2   3   4   5   6   7   8   9   10   >