[PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread David Turner
tween pseudorefs and real refs can correctly handle notes merges. This will also enable us to prevent pseudorefs from being updated by the ref update machinery e.g. git update-ref. Signed-off-by: David Turner --- Documentation/git-notes.txt | 12 ++--- builtin/notes.c

[PATCH v3 1/6] refs: Introduce pseudoref and per-worktree ref concepts

2015-07-28 Thread David Turner
Add glossary entries for both concepts. Pseudorefs and per-worktree refs do not yet have special handling, because the files refs backend already handles them correctly. Later, we will make the LMDB backend call out to the files backend to handle per-worktree refs. Signed-off-by: David Turner

[PATCH v3 0/6] pseudorefs

2015-07-28 Thread David Turner
This version fixes documentation issues found by Eric Sunshine. It also adds a new patch so as not to create static functions that aren't immediately used; Eric also noticed that issue. I refactored the functions to classify a ref into a single public ref_type function. This makes it easy for ba

[PATCH v3 4/6] pseudorefs: create and use pseudoref update and delete functions

2015-07-28 Thread David Turner
Pseudorefs should not be updated through the ref transaction API, because alternate ref backends still need to store pseudorefs in GIT_DIR (instead of wherever they store refs). Instead, change update_ref and delete_ref to call pseudoref-specific functions. Signed-off-by: David Turner

[PATCH v3 5/6] rebase: use update_ref

2015-07-28 Thread David Turner
Instead of manually writing a pseudoref (in one case) and shelling out to git update-ref (in another), use the update_ref function. This is much simpler. Signed-off-by: David Turner --- bisect.c | 37 - 1 file changed, 8 insertions(+), 29 deletions(-) diff

[PATCH v3 6/6] sequencer: replace write_cherry_pick_head with update_ref

2015-07-28 Thread David Turner
Now update_ref (via write_pseudoref) does almost exactly what write_cherry_pick_head did, so we can remove write_cherry_pick_head and just use update_ref. Signed-off-by: David Turner --- sequencer.c | 23 --- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a

[PATCH v3 3/6] refs: add ref_type function

2015-07-28 Thread David Turner
Add a function ref_type, which categorizes refs as per-worktree, pseudoref, or normal ref. Later, we will use this in refs.c to treat pseudorefs specially. Alternate ref backends may use it to treat both pseudorefs and per-worktree refs differently. Signed-off-by: David Turner --- refs.c | 29

Re: [PATCH 4/5] rebase: use update_ref

2015-07-28 Thread David Turner
On Tue, 2015-07-28 at 11:18 -0700, Junio C Hamano wrote: > David Turner writes: > > > Instead of manually writing a pseudoref (in one case) and shelling out > > to git update-ref (in another), use the update_ref function. This > > is much simpler. > > &

Re: [PATCH v3 0/6] pseudorefs

2015-07-28 Thread David Turner
On Tue, 2015-07-28 at 12:01 -0700, Junio C Hamano wrote: > On top of what work is this series expected to be applied? I think I started from 'next' as of a few days ago: commit df7aaa5e3454bbcbb1f142dd6b95b214d0b8efad Author: Zoë Blade Date: Tue Jul 21 14:22:46 2015 +0100 userdiff: add s

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread David Turner
On Tue, 2015-07-28 at 12:00 -0700, Junio C Hamano wrote: > David Turner writes: > > > All-caps files like NOTES_MERGE_REF are pseudorefs, and thus are > > per-worktree. We don't want multiple notes merges happening at once > > (in different worktrees), so we want

[PATCH] cache-tree: populate cache-tree on successful merge

2015-07-28 Thread David Turner
When we unpack trees into an existing index, we discard the old index and replace it with the new, merged index. Ensure that this index has its cache-tree populated. This will make subsequent git status and commit commands faster. Signed-off-by: David Turner Signed-off-by: Brian Degenhardt

Re: [PATCH] cache-tree: populate cache-tree on successful merge

2015-07-28 Thread David Turner
On Tue, 2015-07-28 at 12:50 -0700, Junio C Hamano wrote: > David Turner writes: > > > When we unpack trees into an existing index, we discard the old index > > and replace it with the new, merged index. Ensure that this index has > > its cache-tree populated. This

Re: [PATCH] cache-tree: populate cache-tree on successful merge

2015-07-28 Thread David Turner
On Tue, 2015-07-28 at 13:04 -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > > David Turner writes: > > > >> The work done to produce the cache-tree is work that the commit would > >> otherwise have to do. So we're spending extra time in o

Re: [PATCH] cache-tree: populate cache-tree on successful merge

2015-07-28 Thread David Turner
On Tue, 2015-07-28 at 13:47 -0700, Junio C Hamano wrote: > David Turner writes: > > > When we unpack trees into an existing index, we discard the old index > > and replace it with the new, merged index. Ensure that this index has > > its cache-tree populated. This

[PATCH] notes: handle multiple worktrees

2015-07-28 Thread David Turner
ref to examine; previously, it just looked at HEAD. Reported-by: Junio C Hamano Signed-off-by: David Turner --- branch.c | 15 + branch.h | 2 +- builtin/checkout.c | 2 +- builtin/notes.c | 2 ++ bui

Re: [PATCH] notes: handle multiple worktrees

2015-07-28 Thread David Turner
Sorry, this one is on top of next. On Tue, 2015-07-28 at 17:23 -0400, David Turner wrote: > Prevent merges to the same notes branch from different worktrees. > Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using the same > code we use to check that two HEADs in different worktr

[PATCH v4 0/5] pseudorefs

2015-07-29 Thread David Turner
This version removes the old patch 2/6, which changed notes to use normal refs instead of pseudorefs. We don't actually want to forbid per-worktree notes merge; instead, we want to either ensure that they don't conflict, or use a completely different merge mechanism. So we omit this patch. In ad

[PATCH v4 2/5] refs: add ref_type function

2015-07-29 Thread David Turner
Add a function ref_type, which categorizes refs as per-worktree, pseudoref, or normal ref. Later, we will use this in refs.c to treat pseudorefs specially. Alternate ref backends may use it to treat both pseudorefs and per-worktree refs differently. Signed-off-by: David Turner --- refs.c | 26

[PATCH v4 1/5] refs: Introduce pseudoref and per-worktree ref concepts

2015-07-29 Thread David Turner
Add glossary entries for both concepts. Pseudorefs and per-worktree refs do not yet have special handling, because the files refs backend already handles them correctly. Later, we will make the LMDB backend call out to the files backend to handle per-worktree refs. Signed-off-by: David Turner

[PATCH v4 4/5] bisect: use update_ref

2015-07-29 Thread David Turner
Instead of manually writing a pseudoref (in one case) and shelling out to git update-ref (in another), use the update_ref function. This is much simpler. Signed-off-by: David Turner --- bisect.c | 37 - 1 file changed, 8 insertions(+), 29 deletions(-) diff

[PATCH v4 3/5] pseudorefs: create and use pseudoref update and delete functions

2015-07-29 Thread David Turner
Pseudorefs should not be updated through the ref transaction API, because alternate ref backends still need to store pseudorefs in GIT_DIR (instead of wherever they store refs). Instead, change update_ref and delete_ref to call pseudoref-specific functions. Signed-off-by: David Turner

[PATCH v4 5/5] sequencer: replace write_cherry_pick_head with update_ref

2015-07-29 Thread David Turner
Now update_ref (via write_pseudoref) does almost exactly what write_cherry_pick_head did, so we can remove write_cherry_pick_head and just use update_ref. Signed-off-by: David Turner --- sequencer.c | 23 --- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a

Confused about sparse vs untracked-cache

2015-07-29 Thread David Turner
I'm looking at dir.c, and there's a bit I'm confused about: prep_exclude() says: /* * .. and .gitignore does not exist before * (i.e. null exclude_sha1 and skip_worktree is * not set). Then we can skip loading .

Re: Confused about sparse vs untracked-cache

2015-07-30 Thread David Turner
On Thu, 2015-07-30 at 21:09 +0700, Duy Nguyen wrote: > On Thu, Jul 30, 2015 at 9:32 AM, David Turner > wrote: > > I'm looking at dir.c, and there's a bit I'm confused about: > > > > prep_exclude() says: > > /* > >

Re: Confused about sparse vs untracked-cache

2015-07-30 Thread David Turner
On Thu, 2015-07-30 at 19:30 -0400, David Turner wrote: > On Thu, 2015-07-30 at 21:09 +0700, Duy Nguyen wrote: > > On Thu, Jul 30, 2015 at 9:32 AM, David Turner > > wrote: > > > I'm looking at dir.c, and there's a bit I'm confused

[PATCH v5 3/5] pseudorefs: create and use pseudoref update and delete functions

2015-07-30 Thread David Turner
Pseudorefs should not be updated through the ref transaction API, because alternate ref backends still need to store pseudorefs in GIT_DIR (instead of wherever they store refs). Instead, change update_ref and delete_ref to call pseudoref-specific functions. Signed-off-by: David Turner

[PATCH v5 2/5] refs: add ref_type function

2015-07-30 Thread David Turner
Add a function ref_type, which categorizes refs as per-worktree, pseudoref, or normal ref. Later, we will use this in refs.c to treat pseudorefs specially. Alternate ref backends may use it to treat both pseudorefs and per-worktree refs differently. Signed-off-by: David Turner --- refs.c | 26

[PATCH v5 1/5] refs: introduce pseudoref and per-worktree ref concepts

2015-07-30 Thread David Turner
Add glossary entries for both concepts. Pseudorefs and per-worktree refs do not yet have special handling, because the files refs backend already handles them correctly. Later, we will make the LMDB backend call out to the files backend to handle per-worktree refs. Signed-off-by: David Turner

[PATCH v5 4/5] bisect: use update_ref

2015-07-30 Thread David Turner
Instead of manually writing a pseudoref (in one case) and shelling out to git update-ref (in another), use the update_ref function. This is much simpler. Signed-off-by: David Turner --- bisect.c | 37 - 1 file changed, 8 insertions(+), 29 deletions(-) diff

[PATCH v5 5/5] sequencer: replace write_cherry_pick_head with update_ref

2015-07-30 Thread David Turner
Now update_ref (via write_pseudoref) does almost exactly what write_cherry_pick_head did, so we can remove write_cherry_pick_head and just use update_ref. Signed-off-by: David Turner --- sequencer.c | 23 --- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a

[PATCH] untracked-cache: support sparse checkout

2015-07-31 Thread David Turner
Remove a check that would disable the untracked cache for sparse checkouts. Add tests that ensure that the untracked cache works with sparse checkouts -- specifically considering the case that a file foo/bar is checked out, but foo/.gitignore is not. Signed-off-by: David Turner --- dir.c

[PATCH v2] notes: handle multiple worktrees

2015-07-31 Thread David Turner
Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using die_if_shared_symref. This prevents simultaneous merges to the same notes branch from different worktrees. Signed-off-by: David Turner --- This version addresses Eric Sunshine's critiques of v1. It breaks out the symref-che

[PATCH v3 2/2] notes: handle multiple worktrees

2015-07-31 Thread David Turner
Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using die_if_shared_symref. This prevents simultaneous merges to the same notes branch from different worktrees. Signed-off-by: David Turner --- builtin/notes.c | 2 ++ t/t3320-notes-merge-worktrees.sh | 71

[PATCH v3 1/2] worktrees: add die_if_shared_symref

2015-07-31 Thread David Turner
Add a new function, die_if_shared_symref, which works like die_if_checked_out, but for all references. Refactor die_if_checked_out to work in terms of die_if_shared_symref. Soon, we will use die_if_shared_symref to protect notes merges in worktrees. Signed-off-by: David Turner --- Oops

Re: [PATCH v3 1/2] worktrees: add die_if_shared_symref

2015-07-31 Thread David Turner
On Fri, 2015-07-31 at 15:35 -0400, Eric Sunshine wrote: > On Fri, Jul 31, 2015 at 3:01 PM, David Turner > wrote: > > Add a new function, die_if_shared_symref, which works like > > die_if_checked_out, but for all references. Refactor > > die_if_checked

Re: [PATCH v2] notes: handle multiple worktrees

2015-07-31 Thread David Turner
On Fri, 2015-07-31 at 11:46 -0700, Junio C Hamano wrote: > David Turner writes: > > > Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using > > die_if_shared_symref. This prevents simultaneous merges to the same > > notes branch from different worktrees. >

Re: [PATCH v3 1/2] worktrees: add die_if_shared_symref

2015-07-31 Thread David Turner
On Fri, 2015-07-31 at 17:36 -0400, Eric Sunshine wrote: > On Fri, Jul 31, 2015 at 5:15 PM, David Turner > wrote: > > On Fri, 2015-07-31 at 15:35 -0400, Eric Sunshine wrote: > >> On Fri, Jul 31, 2015 at 3:01 PM, David Turner > >> wrote: > >> > Add a

[PATCH v4 1/2] worktrees: add find_shared_symref

2015-07-31 Thread David Turner
Add a new function, find_shared_symref, which contains the heart of die_if_checked_out, but works for all symrefs. Refactor die_if_checked_out to use the same infrastructure as find_shared_symref. Soon, we will use find_shared_symref to protect notes merges in worktrees. Signed-off-by: David

[PATCH v4 2/2] notes: handle multiple worktrees

2015-07-31 Thread David Turner
Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using find_shared_symref and die if we find one. This prevents simultaneous merges to the same notes branch from different worktrees. Signed-off-by: David Turner --- builtin/notes.c | 5 +++ t/t3320-notes-merge

[PATCH 2/2] bisect: make bisection refs per-worktree

2015-07-31 Thread David Turner
Using the new worktree-refs/ refs, make bisection per-worktree. git show-ref presently only handles refs under refs/, so we change git bisect to use git rev-parse instead. Signed-off-by: David Turner --- Documentation/git-bisect.txt | 4 ++-- Documentation/rev-list-options.txt | 14

[PATCH/RFC 0/2] bisect per-worktree

2015-07-31 Thread David Turner
This is RFC because I'm not sure why show-ref only works on refs/ (and whether it should learn to look in worktree-refs/). I'm also not sure whether there are other changes I should make to refs.c to handle per-worktree refs; I basically did the simplest thing I could think of to start with. -- T

[PATCH 1/2] refs: workree-refs/* become per-worktree

2015-07-31 Thread David Turner
ated docs learn that worktree-refs/ is per-worktree. The ref-packing functions learn that refs beginning with worktree-refs/ should not be packed (since packed-refs is common rather than per-worktree). Signed-off-by: David Turner --- Documentation/glossary-content.txt | 3 ++- refs.c

Re: [PATCH/RFC 0/2] bisect per-worktree

2015-07-31 Thread David Turner
On Sat, 2015-08-01 at 06:04 +0200, Christian Couder wrote: > > Le 1 août 2015 09:01, "David Turner" a > écrit : > > > > This is RFC because I'm not sure why show-ref only works on refs/ > (and > > whether it should learn to look in worktree-refs/

Re: [PATCH/RFC 0/2] bisect per-worktree

2015-07-31 Thread David Turner
On Fri, 2015-07-31 at 22:12 -0700, Junio C Hamano wrote: > On Fri, Jul 31, 2015 at 8:59 PM, Michael Haggerty > wrote: > > > > It seems to me that adding a new top-level "worktree-refs" directory is > > pretty traumatic. Lots of people and tools will have made the assumption > > that all "normal"

Re: [PATCH v4 2/2] notes: handle multiple worktrees

2015-08-03 Thread David Turner
On Sat, 2015-08-01 at 15:51 +0200, Johan Herland wrote: > On Sat, Aug 1, 2015 at 12:11 AM, David Turner > wrote: > > Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using > > find_shared_symref and die if we find one. This prevents simultaneous > > merges to th

[PATCH v5 2/2] notes: handle multiple worktrees

2015-08-03 Thread David Turner
Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using find_shared_symref and die if we find one. This prevents simultaneous merges to the same notes branch from different worktrees. Signed-off-by: David Turner --- builtin/notes.c | 6 t/t3320-notes-merge

[PATCH v5 1/2] worktrees: add find_shared_symref

2015-08-03 Thread David Turner
-off-by: David Turner --- This reroll fixes issues reported by Eric Sunshine: leaks and Johan Herland: prepositions and broken && --- branch.c | 45 ++--- branch.h | 8 2 files changed, 42 insertions(+), 11 deletions(-) diff --git a/br

Re: [PATCH/RFC 0/2] bisect per-worktree

2015-08-03 Thread David Turner
On Sat, 2015-08-01 at 08:51 +0200, Michael Haggerty wrote: > On 08/01/2015 07:12 AM, Junio C Hamano wrote: > > On Fri, Jul 31, 2015 at 8:59 PM, Michael Haggerty > > wrote: > >> > >> It seems to me that adding a new top-level "worktree-refs" directory is > >> pretty traumatic. Lots of people and t

Re: [PATCH v5 2/5] refs: add ref_type function

2015-08-03 Thread David Turner
On Mon, 2015-08-03 at 20:55 +0700, Duy Nguyen wrote: > On Fri, Jul 31, 2015 at 1:06 PM, David Turner > wrote: > > Add a function ref_type, which categorizes refs as per-worktree, > > pseudoref, or normal ref. > > For per-worktree refs, you probably should follow c

[PATCH] untracked-cache: fix subdirectory handling

2015-08-03 Thread David Turner
kup_untracked_recursive, helps untracked_cache_invalidate_path to perform this operation. Signed-off-by: David Turner --- This patch applies on top of dt/untracked-sparse, presently in `pu` at d2cd01bd. I think only the test part depends on that patch. Duy, let me know if you think this is t

Re: [PATCH/RFC 0/2] bisect per-worktree

2015-08-03 Thread David Turner
On Tue, 2015-08-04 at 06:09 +0700, Duy Nguyen wrote: > On Tue, Aug 4, 2015 at 2:49 AM, David Turner wrote: > > Simply treating refs/worktree as per-worktree, while the rest of refs/ > > is not, would be a few dozen lines of code. The full remapping approach > > is likely t

Re: What's cooking in git.git

2015-08-05 Thread David Turner
On Wed, 2015-08-05 at 15:55 -0700, Junio C Hamano wrote: > * dt/untracked-subdir (2015-08-05) 2 commits > - DONTMERGE: Waiting for an Ack from Duy > - untracked-cache: fix subdirectory handling > (this branch uses dt/untracked-sparse.) > > This seems to break some tests. All tests pass for me

[PATCH v2] untracked-cache: fix subdirectory handling

2015-08-07 Thread David Turner
kup_untracked_recursive, helps untracked_cache_invalidate_path to perform this operation. Signed-off-by: David Turner --- This version removes debugging cruft. Oops! --- dir.c | 50 --- dir.h | 1 + t/t7063-

[PATCH v6] notes: handle multiple worktrees

2015-08-10 Thread David Turner
Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using find_shared_symref and die if we find one. This prevents simultaneous merges to the same notes branch from different worktrees. Signed-off-by: David Turner --- This reroll addresses Eric Sunshine's comments on v5. --- bu

Re: [PATCH v6] notes: handle multiple worktrees

2015-08-10 Thread David Turner
Sorry, that should have included the first patch as well. Will re-send as .v7 On Mon, 2015-08-10 at 13:43 -0400, David Turner wrote: > Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using > find_shared_symref and die if we find one. This prevents simultaneous > merges to the s

[PATCH v6 1/2] worktrees: add find_shared_symref

2015-08-10 Thread David Turner
-off-by: David Turner --- Please disregard v6. This version addresses Eric Sunshine's comments on v5. It fixes an error message and cleans up the code. --- branch.c | 46 ++ branch.h | 8 2 files changed, 42 insertions(+), 12 dele

[PATCH v6 2/2] notes: handle multiple worktrees

2015-08-10 Thread David Turner
Before creating NOTES_MERGE_REF, check NOTES_MERGE_REF using find_shared_symref and die if we find one. This prevents simultaneous merges to the same notes branch from different worktrees. Signed-off-by: David Turner --- builtin/notes.c | 6 t/t3320-notes-merge

Re: [PATCH v6 1/2] worktrees: add find_shared_symref

2015-08-10 Thread David Turner
On Mon, 2015-08-10 at 18:30 -0400, Eric Sunshine wrote: > On Mon, Aug 10, 2015 at 1:52 PM, David Turner > wrote: > > worktrees: add find_shared_symref > > s/worktrees/branch/ perhaps? Do you mean "this is in branch.c, so should be labeled with branch"? Because

Re: [PATCH v3] worktree: add 'list' command

2015-08-10 Thread David Turner
On Mon, 2015-08-10 at 16:53 -0400, Michael Rappazzo wrote: > + while ((d = readdir(dir)) != NULL) { I think it would be useful to break this loop out into a for_each_worktree function. While looking into per-worktree ref stuff, I have just noticed that git prune will delete ob

[PATCH v2 2/2] bisect: make bisection refs per-worktree

2015-08-10 Thread David Turner
Using the new refs/worktree/ refs, make bisection per-worktree. Signed-off-by: David Turner --- Documentation/git-bisect.txt | 4 ++-- Documentation/rev-list-options.txt | 14 +++--- bisect.c | 2 +- builtin/rev-parse.c| 6

[PATCH v2 1/2] refs: refs/worktree/* become per-worktree

2015-08-10 Thread David Turner
that refs beginning with refs/worktree/ should not be packed (since packed-refs is common rather than per-worktree). Signed-off-by: David Turner --- This implements the very simple solution of making refs/worktree/ per-worktree, as we discussed on the PATCH/RFC first version of this patch. Note

Re: [PATCH v5 2/5] refs: add ref_type function

2015-08-11 Thread David Turner
On Mon, 2015-08-03 at 20:55 +0700, Duy Nguyen wrote: > On Fri, Jul 31, 2015 at 1:06 PM, David Turner > wrote: > > Add a function ref_type, which categorizes refs as per-worktree, > > pseudoref, or normal ref. > > For per-worktree refs, you probably should follow c

Re: [PATCH v5 3/5] pseudorefs: create and use pseudoref update and delete functions

2015-08-11 Thread David Turner
es. If you prefer, I can resend the whole series, but I thought this might be easier. From 6c86c38f533c6b35db3a557270aab95b342875c9 Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 15 Jul 2015 18:05:28 -0400 Subject: [PATCH 3/5] pseudorefs: create and use pseudoref update and delete functions

Re: Re* [PATCH v2 1/2] refs: refs/worktree/* become per-worktree

2015-08-11 Thread David Turner
On Tue, 2015-08-11 at 14:10 -0700, Junio C Hamano wrote: > David Turner writes: > > > We need a place to stick refs for bisects in progress that is not > > shared between worktrees. So we use the refs/worktree/ hierarchy. > > This is by itself OK, but to help existing

Re: Re* [PATCH v2 1/2] refs: refs/worktree/* become per-worktree

2015-08-11 Thread David Turner
On Tue, 2015-08-11 at 14:10 -0700, Junio C Hamano wrote: > David Turner writes: P.S. I noticed an issue with patch 2/2; I had reverted a now-unnecessary hack, but accidentally reverted the whole file. So I'll need to re-roll anyway. -- To unsubscribe from this list: send the line &quo

Re: [PATCH v5 3/5] pseudorefs: create and use pseudoref update and delete functions

2015-08-11 Thread David Turner
On Tue, 2015-08-11 at 15:47 -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > > David Turner writes: > > > >> On Fri, 2015-07-31 at 16:40 -0700, Stefan Beller wrote: > >>> I am sorry for being late to the review, I looked into coverity today a

[PATCH v3 2/4] path: optimize common dir checking

2015-08-12 Thread David Turner
Instead of a linear search over common_list to check whether a path is common, use a trie. The trie search operates on path prefixes, and handles excludes. Signed-off-by: David Turner --- Probably overkill, but maybe we could later use it for making exclude or sparse-checkout matching faster

[PATCH v3 3/4] refs: make refs/worktree/* per-worktree

2015-08-12 Thread David Turner
that per-worktree refs should not be packed (since packed-refs is common rather than per-worktree). Signed-off-by: David Turner --- Documentation/glossary-content.txt | 5 +++-- path.c | 1 + refs.c | 32

[PATCH v3 1/4] refs: clean up common_list

2015-08-12 Thread David Turner
Instead of common_list having formatting like ! and /, use a struct to hold common_list data in a structured form. We don't use 'exclude' yet; instead, we keep the old codepath that handles info/sparse-checkout and logs/HEAD. Later, we will use exclude. Signed-off-by: David Tur

[PATCH v3 4/4] bisect: make bisection refs per-worktree

2015-08-12 Thread David Turner
Using the new refs/worktree/ refs, make bisection per-worktree. Signed-off-by: David Turner --- Documentation/git-bisect.txt | 4 ++-- Documentation/rev-list-options.txt | 14 +++--- bisect.c | 2 +- builtin/rev-parse.c| 6 -- git

Re: [PATCH v3 3/4] refs: make refs/worktree/* per-worktree

2015-08-13 Thread David Turner
On Thu, 2015-08-13 at 13:15 -0400, Eric Sunshine wrote: > On Wed, Aug 12, 2015 at 5:57 PM, David Turner > wrote: > > diff --git a/t/t0060-path-utils.sh b/t/t0060-path-utils.sh > > index 93605f4..28e6dff 100755 > > --- a/t/t0060-path-utils.sh > &g

Re: [PATCH 1/2 v4] worktree: add 'for_each_worktree' function

2015-08-13 Thread David Turner
On Thu, 2015-08-13 at 14:32 -0400, Michael Rappazzo wrote: > for_each_worktree iterates through each worktree and invokes a callback > function. The main worktree (if not bare) is always encountered first, > followed by worktrees created by `git worktree add`. Thanks! This will be super-useful!

Re: [PATCH 2/2 v4] worktree: add 'list' command

2015-08-13 Thread David Turner
On Thu, 2015-08-13 at 14:32 -0400, Michael Rappazzo wrote: > 'git worktree list' uses the for_each_worktree function to iterate, > and outputs in the format: ' ()' I'm not sure I'm going to have time to review the whole thing, but I think we ought to have tests with both bare and non-bare main re

Re: [PATCH v3 3/4] refs: make refs/worktree/* per-worktree

2015-08-13 Thread David Turner
On Thu, 2015-08-13 at 22:16 +0200, Michael Haggerty wrote: > On 08/13/2015 07:41 PM, David Turner wrote: > > On Thu, 2015-08-13 at 13:15 -0400, Eric Sunshine wrote: > >> On Wed, Aug 12, 2015 at 5:57 PM, David Turner > >> wrote: > >>> diff --git a/t/t006

Re: [PATCH v3 2/4] path: optimize common dir checking

2015-08-14 Thread David Turner
On Fri, 2015-08-14 at 10:04 -0700, Junio C Hamano wrote: > Michael Haggerty writes: > > > Let's take a step back. > > > > We have always had a ton of code that uses `git_path()` and friends to > > convert abstract things into filesystem paths. Let's take the > > reference-handling code as an exam

Re: [PATCH v3 2/4] path: optimize common dir checking

2015-08-14 Thread David Turner
On Fri, 2015-08-14 at 13:27 -0700, Junio C Hamano wrote: > David Turner writes: > > > Random side note: the present workspace path name component is not > > acceptable for this if alternate ref backends use a single db for > > storage across all workspaces. That'

Re: [PATCH v3 2/4] path: optimize common dir checking

2015-08-15 Thread David Turner
Duy Nguyen writes: > On Thu, Aug 13, 2015 at 4:57 AM, David Turner wrote: > > Instead of a linear search over common_list to check whether > > a path is common, use a trie. The trie search operates on > > path prefixes, and handles excludes. > > Just be care

[PATCH v3] untracked-cache: fix subdirectory handling

2015-08-15 Thread David Turner
tead of just looking for 'bar'). This would cause untracked cache corruption. Instead, treat_directory learns to track the base length of the parent directory, so that only the last path component is passed to lookup_untracked. Helped-by: Nguyễn Thái Ngọc Duy Signed-off-by: David Turn

Re: [PATCH v4 3/3] untracked cache: fix entry invalidation

2015-08-25 Thread David Turner
nder the given > directory. In the last case, it will look for the entry "b/c" in > directory "a" instead. This means if you delete or add an entry in a > subdirectory, untracked cache may become out of date because it does not > invalidate properly. This is noticed

[PATCH v4 0/4] per-worktree bisection refs

2015-08-26 Thread David Turner
This reroll includes changes suggested by Duy Nguyen: A. Path normalization (partial). B. Rearrangement of common_list struct to make formatting prettier. It also includes a test style fix suggested by Eric Sunshine and others: a bogus test_must_fail on a non-git command has been replaced by a tw

[PATCH v4 3/4] refs: make refs/worktree/* per-worktree

2015-08-26 Thread David Turner
that per-worktree refs should not be packed (since packed-refs is common rather than per-worktree). Since refs/worktree is per-worktree, logs/refs/worktree should be too. Signed-off-by: David Turner --- Documentation/glossary-content.txt | 5 +++-- path.c | 2

[PATCH v4 4/4] bisect: make bisection refs per-worktree

2015-08-26 Thread David Turner
Using the new refs/worktree/ refs, make bisection per-worktree. Signed-off-by: David Turner --- Documentation/git-bisect.txt | 4 ++-- Documentation/rev-list-options.txt | 14 +++--- bisect.c | 2 +- builtin/rev-parse.c| 6 -- git

[PATCH v4 1/4] refs: clean up common_list

2015-08-26 Thread David Turner
Instead of common_list having formatting like ! and /, use a struct to hold common_list data in a structured form. We don't use 'exclude' yet; instead, we keep the old codepath that handles info/sparse-checkout and logs/HEAD. Later, we will use exclude. Signed-off-by: David Turn

[PATCH v4 2/4] path: optimize common dir checking

2015-08-26 Thread David Turner
Instead of a linear search over common_list to check whether a path is common, use a trie. The trie search operates on path prefixes, and handles excludes. Signed-off-by: David Turner --- path.c| 226 ++ t/t0060-path-utils.sh

Re: [PATCH v4 2/4] path: optimize common dir checking

2015-08-26 Thread David Turner
On Wed, 2015-08-26 at 14:15 -0700, Junio C Hamano wrote: > > + * For example, consider the following set of strings: > > + * abc > > + * def > > + * definite > > + * definition > > + * > > + * The trie would look look like: > > + * root: len = 0, value = (something), children a and d non-NULL. > >

Re: [PATCH v4 2/4] path: optimize common dir checking

2015-08-26 Thread David Turner
On Wed, 2015-08-26 at 18:10 -0400, David Turner wrote: > On Wed, 2015-08-26 at 14:15 -0700, Junio C Hamano wrote: > > > + * For example, consider the following set of strings: > > > + * abc > > > + * def > > > + * definite > > > + * definition &

[PATCH] commit: don't rewrite shared index unnecessarily

2015-08-27 Thread David Turner
h the old builtin/commit.c code. Signed-off-by: David Turner --- I introduced this bug last year while improving the cache-tree code. I guess I probably didn't notice that active_cache_changed wasn't a boolean. --- builtin/commit.c| 4 +--- t/t0090-cache-tree.sh | 10 ++

Re: [PATCH v4 2/4] path: optimize common dir checking

2015-08-28 Thread David Turner
On Fri, 2015-08-28 at 09:39 -0700, Junio C Hamano wrote: > David Turner writes: > > > On Wed, 2015-08-26 at 18:10 -0400, David Turner wrote: > >> On Wed, 2015-08-26 at 14:15 -0700, Junio C Hamano wrote: > >> > > + * For example, consider the follow

Re: What's cooking in git.git (Aug 2015, #05; Fri, 28)

2015-08-31 Thread David Turner
On Mon, 2015-08-31 at 07:36 -0700, Junio C Hamano wrote: > Christian Couder writes: > > >> * dt/refs-bisection (2015-08-28) 5 commits > >> - bisect: make bisection refs per-worktree > >> - refs: make refs/worktree/* per-worktree > >> - SQUASH??? > >> - path: optimize common dir checking > >>

Re: [PATCH] commit: don't rewrite shared index unnecessarily

2015-08-31 Thread David Turner
On Mon, 2015-08-31 at 17:02 +0700, Duy Nguyen wrote: > On Fri, Aug 28, 2015 at 12:07 AM, David Turner > wrote: > > Remove a cache invalidation which would cause the shared index to be > > rewritten on as-is commits. > > > > When the cache-tree has changed, we ne

Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-31 Thread David Turner
On Mon, 2015-08-31 at 01:11 -0400, Eric Sunshine wrote: > Stepping back a bit, is a for-each-foo()-style interface desirable? > This sort of interface imposes a good deal of complexity on callers, > demanding a callback function and callback data (cb_data), and is > generally (at least in C) more d

Re: [PATCH v4 2/4] path: optimize common dir checking

2015-08-31 Thread David Turner
On Sun, 2015-08-30 at 08:25 +0200, Torsten Bögershausen wrote: > On 26.08.15 21:46, David Turner wrote: > > Instead of a linear search over common_list to check whether > > a path is common, use a trie. The trie search operates on > > path prefixes, and handles excludes. &

Re: [PATCH v6 1/2] worktree: add 'for_each_worktree' function

2015-08-31 Thread David Turner
On Mon, 2015-08-31 at 15:03 -0400, Eric Sunshine wrote: > On Mon, Aug 31, 2015 at 2:44 PM, David Turner > wrote: > > On Mon, 2015-08-31 at 01:11 -0400, Eric Sunshine wrote: > >> Stepping back a bit, is a for-each-foo()-style interface desirable? > >> This sort of in

[PATCH v5 3/3] refs: make refs/bisect/* per-worktree

2015-08-31 Thread David Turner
functions learn that per-worktree refs should not be packed (since packed-refs is common rather than per-worktree). Since refs/bisect is per-worktree, logs/refs/bisect should be too. Signed-off-by: David Turner Signed-off-by: Junio C Hamano --- Documentation/glossary-content.txt | 5 +++-- path.c

[PATCH v5 1/3] refs: clean up common_list

2015-08-31 Thread David Turner
Instead of common_list having formatting like ! and /, use a struct to hold common_list data in a structured form. We don't use 'exclude' yet; instead, we keep the old codepath that handles info/sparse-checkout and logs/HEAD. Later, we will use exclude. Signed-off-by: David Tur

[PATCH v5 2/3] path: optimize common dir checking

2015-08-31 Thread David Turner
Instead of a linear search over common_list to check whether a path is common, use a trie. The trie search operates on path prefixes, and handles excludes. Signed-off-by: David Turner Signed-off-by: Junio C Hamano --- path.c| 227

[no subject]

2015-08-31 Thread David Turner
This version of the patch series squashes in Junio's comment fix and the xstrndup fix. In addition, it removes refs/worktree, and just makes refs/bisect per-worktree. If we later discover that other things need to be per-worktree, we can do refs/worktree, but for now, this is backwards-compatible

[PATCH 00/43] refs lmdb backend

2015-09-02 Thread David Turner
I think I've broken about all of the standalone stuff out, so here's the main enchilada. This series depends on at least the following topics in pu: dt/refs-bisection dt/refs-pseudo dt/reflog-tests kn/for-each-tag (patch 21 and corresponding bits of 42 depend on this; we could skip them, but I wan

[PATCH 08/43] refs.c: move the hidden refs functions to the common code

2015-09-02 Thread David Turner
From: Ronnie Sahlberg Move the hidden refs functions to the refs.c file since these functions do not contain any backend specific code. Signed-off-by: Ronnie Sahlberg Signed-off-by: David Turner --- refs-be-files.c | 51 --- refs.c

[PATCH 17/43] refs.c: move head_ref_namespaced to the common code

2015-09-02 Thread David Turner
From: Ronnie Sahlberg Signed-off-by: Ronnie Sahlberg --- refs-be-files.c | 15 --- refs.c | 15 +++ 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/refs-be-files.c b/refs-be-files.c index a36568f..21b38cf 100644 --- a/refs-be-files.c +++ b/refs-

  1   2   3   4   5   6   7   8   9   10   >