Re: [PATCH 6/8] xdl_change_compact(): keep track of the earliest end

2016-08-10 Thread Michael Haggerty
On 08/04/2016 08:46 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> This makes it easier to detect whether shifting is possible, and will >> also make the next change easier. > > I can see the code keeping track of earliest_end but the above does > not

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

2016-08-10 Thread Michael Haggerty
On 08/04/2016 02:04 AM, Stefan Beller wrote: > On Wed, Aug 3, 2016 at 4:30 PM, Michael Haggerty wrote: >> Stefan Beller wrote: >>> [...] >>> Rather the 10 describes the ratio of "advanced magic" to pure indentation >>> based scoring in my underst

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

2016-08-10 Thread Michael Haggerty
On 08/04/2016 09:39 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >>>> + } >>>> + /* >>>> +* We have reached the end of the line without finding any >>>> non-space >>>> +* characters

Re: [PATCH 2/8] xdl_change_compact(): clarify code

2016-08-10 Thread Michael Haggerty
On 08/04/2016 01:50 AM, Stefan Beller wrote: > On Wed, Aug 3, 2016 at 4:14 PM, Michael Haggerty wrote: >> On 08/04/2016 12:11 AM, Stefan Beller wrote: >>> On Wed, Aug 3, 2016 at 3:00 PM, Michael Ha

Re: [PATCH 5/8] xdl_change_compact(): fix compaction heuristic to adjust io

2016-08-10 Thread Michael Haggerty
On 08/10/2016 06:58 PM, Michael Haggerty wrote: > On 08/04/2016 09:27 AM, Jeff King wrote: >> On Thu, Aug 04, 2016 at 12:00:33AM +0200, Michael Haggerty wrote: >> >>> The code branch used for the compaction heuristic incorrectly forgot to >>> keep io in sync whi

Re: patch submission process, was Re: [PATCH v6 06/16] merge_recursive: abort properly upon errors

2016-08-09 Thread Michael Haggerty
On 08/09/2016 06:22 AM, Duy Nguyen wrote: > On Tue, Aug 9, 2016 at 12:20 AM, Michael Haggerty > wrote: >> On 08/04/2016 05:58 PM, Johannes Schindelin wrote: >>> [...] >>> Even requiring every contributor to register with GitHub would be too much >

Re: patch submission process, was Re: [PATCH v6 06/16] merge_recursive: abort properly upon errors

2016-08-08 Thread Michael Haggerty
On 08/09/2016 12:36 AM, Junio C Hamano wrote: > Michael Haggerty writes: > >> Is it *really* so insane to consider moving collaboration on the Git >> project to GitHub or some other similar platform? > > I only know how "pull requests" and "issue

Re: patch submission process, was Re: [PATCH v6 06/16] merge_recursive: abort properly upon errors

2016-08-08 Thread Michael Haggerty
On 08/04/2016 05:58 PM, Johannes Schindelin wrote: > [...] > Even requiring every contributor to register with GitHub would be too much > of a limitation, I would wager. > [...] Is it *really* so insane to consider moving collaboration on the Git project to GitHub or some other similar platform?

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

2016-08-03 Thread Michael Haggerty
On 08/04/2016 12:51 AM, Stefan Beller wrote: > On Wed, Aug 3, 2016 at 3:41 PM, Michael Haggerty wrote: >> On 08/04/2016 12:30 AM, Stefan Beller wrote: >>> On Wed, Aug 3, 2016 at 3:00 PM, Michael Haggerty >>> wrote: >>> >>>> +return 10

Re: [PATCH 2/8] xdl_change_compact(): clarify code

2016-08-03 Thread Michael Haggerty
On 08/04/2016 12:11 AM, Stefan Beller wrote: > On Wed, Aug 3, 2016 at 3:00 PM, Michael Haggerty wrote: >> Write things out a bit longer but less cryptically. Add more comments. > > By less cryptic you mean in Git coding style ;) > The original author (do we want to cc Dav

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

2016-08-03 Thread Michael Haggerty
On 08/04/2016 12:30 AM, Stefan Beller wrote: > On Wed, Aug 3, 2016 at 3:00 PM, Michael Haggerty wrote: > >> +return 10 * score - bonus; > > Would it make sense to define-ify the 10 as well > as this is the only hardcoded number in the > scoring function?

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

2016-08-03 Thread Michael Haggerty
On 08/04/2016 12:29 AM, Jacob Keller wrote: > On Wed, Aug 3, 2016 at 3:00 PM, Michael Haggerty wrote: >> +/* >> + * If a line is indented more than this, get_indent() just returns this >> value. >> + * This avoids having to do absurd amounts of work for data that ar

[PATCH 3/8] xdl_change_compact(): rename i to end

2016-08-03 Thread Michael Haggerty
Rename i to end, and alternate between using start and end as the indexing variable as appropriate. Rename ixref to end_matching_other. Add some more comments. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 70 -- 1 file changed

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

2016-08-03 Thread Michael Haggerty
optimization and analysis and the human-generated data values are recorded in a separate project [1]. If other people add more test data (especially in other programming languages and/or other text formats) and come up with weighting factors that work better over a wider breadth of samples, it wi

[PATCH 0/8] Better heuristics make prettier diffs

2016-08-03 Thread Michael Haggerty
ing either `--indent-heuristic` or `git config diff.indentheuristic true`. Michael Haggerty (8): xdl_change_compact(): rename some local variables for clarity xdl_change_compact(): clarify code xdl_change_compact(): rename i to end xdl_change_compact(): do one final shift or the other, not

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

2016-08-03 Thread Michael Haggerty
* ix -> i * ixo -> io * ixs -> start * grpsiz -> groupsize Signed-off-by: Michael Haggerty --- Thankfully, we don't have to limit indentifers to six characters, so start naming things more understandably. xdiff/xdiffi.c | 66 +

Re: [PATCH 0/8] Better heuristics make prettier diffs

2016-08-03 Thread Michael Haggerty
On 08/04/2016 12:00 AM, Michael Haggerty wrote: > I've talked about this quite a bit on the list already. The idea is to > improve ugly diffs I forgot to note that this patch series is also available from my GitHub account [1] as branch "diff-indent-heuristics". Also, I

[PATCH 4/8] xdl_change_compact(): do one final shift or the other, not both

2016-08-03 Thread Michael Haggerty
have ignored the compaction heuristic in that case, whereas the new code always gives precedence to the compaction heuristic when it is turned on. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 44 ++-- 1 file changed, 22 insertions(+), 22 deletions(-)

[PATCH 2/8] xdl_change_compact(): clarify code

2016-08-03 Thread Michael Haggerty
Write things out a bit longer but less cryptically. Add more comments. Signed-off-by: Michael Haggerty --- I find the loops in the old code, with unfamiliar patterns of embedded increment/decrement operators, confusing, and I think that writing things out a little bit more verbosely (and with

[PATCH 6/8] xdl_change_compact(): keep track of the earliest end

2016-08-03 Thread Michael Haggerty
This makes it easier to detect whether shifting is possible, and will also make the next change easier. Signed-off-by: Michael Haggerty --- xdiff/xdiffi.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c index 66129db..34f021a 100644

[PATCH 5/8] xdl_change_compact(): fix compaction heuristic to adjust io

2016-08-03 Thread Michael Haggerty
The code branch used for the compaction heuristic incorrectly forgot to keep io in sync while the group was shifted. I think that could have led to reading past the end of the rchgo array. Signed-off-by: Michael Haggerty --- I didn't actually try to verify the presence of a bug, because it

[PATCH 7/8] is_blank_line: take a single xrecord_t as argument

2016-08-03 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 34f021a

Re: Find a topic branch containing a commit

2016-07-28 Thread Michael Haggerty
On 07/27/2016 08:03 PM, Duy Nguyen wrote: > On Wed, Jul 27, 2016 at 7:50 PM, Stefan Beller wrote: >> On Wed, Jul 27, 2016 at 10:42 AM, Duy Nguyen wrote: >>> Before I start doing anything silly because I don't know it can >>> already be done without waving my C wand like a mad man... >>> >>> I oft

Re: [PATCH 00/38] Virtualization of the refs API

2016-07-13 Thread Michael Haggerty
On 07/10/2016 05:09 PM, Duy Nguyen wrote: > On Fri, Jun 3, 2016 at 11:03 PM, Michael Haggerty > wrote: >> Since the that ref-iterator [1] changes seem to have gotten a positive >> reception, let's try to keep up the momentum. I hope I'm not >> overloading the re

diff heuristics dramatically improved by considering line indentation and blank lines

2016-07-01 Thread Michael Haggerty
On 06/30/2016 03:54 PM, Michael Haggerty wrote: > On 06/23/2016 07:10 PM, Michael Haggerty wrote: >> On 06/17/2016 06:09 PM, Stefan Beller wrote: >>> I think before spending more time on discussing and implementing new >>> (hopefully better) heuristics, I'd want

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

2016-06-30 Thread Michael Haggerty
On 06/23/2016 07:10 PM, Michael Haggerty wrote: > On 06/17/2016 06:09 PM, Stefan Beller wrote: >> I think before spending more time on discussing and implementing new >> (hopefully better) heuristics, I'd want to step back and try to be a bit more >> systematic, i.e. I&

Re: [PATCH v1] git-p4: place temporary refs used for branch import under ref/git-p4-tmp

2016-06-28 Thread Michael Haggerty
On 06/27/2016 09:26 AM, larsxschnei...@gmail.com wrote: > Git-P4 used to place temporary refs under "git-p4-tmp". Since 3da1f37 > Git checks that all refs are placed under "ref". Instruct Git-P4 to > place temporary refs under "ref/git-p4-tmp". There are no backwards > compatibility considerations

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

2016-06-28 Thread Michael Haggerty
On 06/23/2016 09:32 AM, Michael Haggerty wrote: > [...] > I have to say, I'm still confused about how the old code could have > worked at all. For quite some time, Git hasn't allowed references with > weird names like `git-p4-tmp/6` to be created, so how could there be any &

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

2016-06-23 Thread Michael Haggerty
On 06/23/2016 07:37 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> Scoring heuristic: >> >>> # A place to accumulate bonus factors (positive makes this >>> # index more favored): >>> bonus = 0 >>> >>> # Bon

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

2016-06-23 Thread Michael Haggerty
On 06/17/2016 06:09 PM, Stefan Beller wrote: > I think before spending more time on discussing and implementing new > (hopefully better) heuristics, I'd want to step back and try to be a bit more > systematic, i.e. I'll want to collect lots of test cases in different > languages > and use cases. A

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

2016-06-23 Thread Michael Haggerty
On 06/20/2016 09:57 AM, Lars Schneider wrote: > >> On 20 Jun 2016, at 01:51, Junio C Hamano wrote: >> >> Junio C Hamano writes: >> >>> Michael Haggerty writes: >>> >>>> According to [1], something in that test seems to have been

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

2016-06-19 Thread Michael Haggerty
On 06/18/2016 08:20 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> 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) >>>

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

2016-06-19 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) >> + lock_ref_sha1_basic(): only handle REF_NODEREF mode >> + commit_ref_update(): remov

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

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

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

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

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

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

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

[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

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

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

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 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 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: > 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 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 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 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 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 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 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] 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 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 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 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 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

[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

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

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 25/38] lock_raw_ref(): add a files_ref_store argument

2016-06-03 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs/files-backend.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 48b37fa..dfce4d1 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -1527,7 +1527,8 @@ static

[PATCH 28/38] lock_ref_sha1_basic(): add a files_ref_store argument

2016-06-03 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs/files-backend.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index 225e0af..24b7c60 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -1987,15

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

2016-06-03 Thread Michael Haggerty
For now it only supports the main reference store. Signed-off-by: Michael Haggerty --- 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 22837f4..2d84c5c 100644

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

2016-06-03 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- 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 57f1965..9307fa0 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -1416,13 +1416,11 @@ static

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

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

2016-06-03 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 --- refs.c | 7 +++ refs/files-backend.c | 24 ++-- refs/refs

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

2016-06-03 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- 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 f4f5f32..22837f4 100644 --- a/refs.c +++ b/refs.c @@ -1425,6 +1425,15

[PATCH 26/38] commit_ref_update(): add a files_ref_store argument

2016-06-03 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- refs/files-backend.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/refs/files-backend.c b/refs/files-backend.c index dfce4d1..bc7d250 100644 --- a/refs/files-backend.c +++ b/refs/files-backend.c @@ -2578,12 +2578,14

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

2016-06-03 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 --- refs.c | 8 refs/files-backend.c | 8 +--- refs/refs-internal.h | 1 + 3 files changed, 14 insertions(+), 3 deletions

[PATCH 37/38] refs: make lock generic

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

<    4   5   6   7   8   9   10   11   12   13   >