Signed-off-by: Nguyễn Thái Ngọc Duy
---
I got mad after tracing two consecutive red history lines in `git log
--graph --oneline` back to their merge points, far far away. Yeah
probably should fire up tig, or gitk or something.
This may sound like a good thing to add, but I don't kno
k
the colors you want.
Even with standard terminal, if your background color is neither black
or white, then the graph line may match your background and become
hidden. You can exclude your background color (or simply the colors you
hate) with this.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Sounds
This version is the same as nd/worktree-move but with the recursive
directory copy code removed. We rely on rename() to move directories.
Nguyễn Thái Ngọc Duy (6):
worktree.c: add validate_worktree()
worktree.c: add update_worktree_location()
worktree move: new command
worktree move
move the repository with the main worktree. The tricky part is make
sure all file descriptors to the repository are closed, or it may
fail on Windows.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/git-worktree.txt | 7 +-
builtin/worktree.c
d we should not move that one.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
worktree.c | 63 ++
worktree.h | 5 +
2 files changed, 68 insertions(+)
diff --git a/worktree.c b/worktree.c
index eb61212..929072a 100644
--- a/worktree.c
+++ b/
Signed-off-by: Nguyễn Thái Ngọc Duy
---
worktree.c | 21 +
worktree.h | 6 ++
2 files changed, 27 insertions(+)
diff --git a/worktree.c b/worktree.c
index 929072a..7684951 100644
--- a/worktree.c
+++ b/worktree.c
@@ -354,6 +354,27 @@ int validate_worktree(const struct
Similar to "mv a b/", which is actually "mv a b/a", we extract basename
of source worktree and create a directory of the same name at
destination if dst path is a directory.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/worktree.c | 19 ++-
1 file changed,
de is in
place, this validate_no_submodules() could be removed.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/worktree.c | 23 +++
1 file changed, 23 insertions(+)
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 900b68b..64d0264 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/git-worktree.txt | 21 +
builtin/worktree.c | 79 ++
contrib/completion/git-completion.bash | 5 ++-
t/t2028-worktree-move.sh | 26 +++
4 files changed
k
the colors you want.
Even with standard terminal, if your background color is neither black
or white, then the graph line may match your background and become
hidden. You can exclude your background color (or simply the colors you
hate) with this.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Compared
k
the colors you want.
Even with standard terminal, if your background color is neither black
or white, then the graph line may match your background and become
hidden. You can exclude your background color (or simply the colors you
hate) with this.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
v4:
* r
ut is done automatically _update_ a config variable with "git
config --worktree".
I think this one is more or less ready. I have an RFC follow-up patch
about core.bare, but that could be handled separately.
[1] http://public-inbox.org/git/20160720172419.25473-1-pclo...@gmail.com/
Nguyễn T
As noted in the previous commit, "git config" without options will read
both per-worktree and per-repo by default. --worktree is needed to read
just per-worktree config. Writing goes to per-repo by default though,
unless --worktree is given.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Doc
It's not fun to ask the user to set extensions.worktreeConfig manually.
It's error-prone too. So we do it automatically whenever anybody sets a
per-worktree config with "git config" (support for builtin commands is
coming later).
Signed-off-by: Nguyễn Thái Ngọc Duy
--
design places a bet on the assumption that the majority of config
variables are shared so it is the default mode. A safer move would be
default writes go to per-worktree file, so that accidental changes are
isolated.
(*) "git config --worktree" points back to "config" file wh
Signed-off-by: Nguyễn Thái Ngọc Duy
---
t/t2029-worktree-config.sh (new +x) | 82 +
1 file changed, 82 insertions(+)
create mode 100755 t/t2029-worktree-config.sh
diff --git a/t/t2029-worktree-config.sh b/t/t2029-worktree-config.sh
new file mode 100755
index
e.
This patch is incomplete. I need to go through all is_bare_repository()
calls and adjust their behavior. But I wanted to run the idea through
the community first..
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/config.txt | 2 +-
Documentation/git-worktree.txt | 7 +++
t
In this code we want to match the word "reset". If len is zero,
strncasecmp() will return zero and we incorrectly assume it's "reset" as
a result.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
color.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/color.c b/color
v5 moves space trimming to color_parse_mem() from read_graph_colors_config,
which is renamed to parse_graph... because the config reading is moved
back to graph_init.
I think it looks better, but we may be pushing the limits of
argv_array's abuse.
Nguyễn Thái Ngọc Duy (3):
color.c
Normally color_parse_mem() is called from config parser which trims the
leading spaces already. The new caller in the next patch won't. Let's be
tidy and trim leading spaces too (we already trim trailing spaces before
comma).
Signed-off-by: Nguyễn Thái Ngọc Duy
---
color.c | 7 +
k
the colors you want.
Even with standard terminal, if your background color is neither black
or white, then the graph line may match your background and become
hidden. You can exclude your background color (or simply the colors you
hate) with this.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Document
t;origin/foo@{1}"
This is for remote refs only because based on my experience, docorating
local reflog is just too noisy. You will most likely see HEAD@{1},
HEAD@{2} and so on. We can add that as a separate option in future if we
see a need for it.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
I
OK This patch is horrible. Though the idea is cool and I've found it
very useful. So here it is. Perhaps the idea may be revised a bit
that's more suitable for more than one user.
The problem is old, SHA-1 name is not keyboard-friendly, even in
abbreviated form. And recent change has made abbrev f
).
Signed-off-by: Nguyễn Thái Ngọc Duy
---
revision.c | 134 +
1 file changed, 100 insertions(+), 34 deletions(-)
diff --git a/revision.c b/revision.c
index b37dbec378..6ebd38d1c8 100644
--- a/revision.c
+++ b/revision.c
@@ -2059,6
Signed-off-by: Nguyễn Thái Ngọc Duy
---
revision.c | 11 ---
revision.h | 4
2 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/revision.c b/revision.c
index 6ebd38d1c8..cda2606c66 100644
--- a/revision.c
+++ b/revision.c
@@ -2273,10 +2273,15 @@ int setup_revisions(int
Signed-off-by: Nguyễn Thái Ngọc Duy
---
revision.c | 46 ++
1 file changed, 46 insertions(+)
diff --git a/revision.c b/revision.c
index 45cffcab44..b77face513 100644
--- a/revision.c
+++ b/revision.c
@@ -2157,6 +2157,49 @@ static int
series does not really implement --decorate-reflog. It shuffles
revision.c code around a bit so thay the option can be implemented
later. The most controversal patch would be 4/5 where --exclude
behavior is changed slighly.
Good? Bad? Horror hooorrrible?
Nguyễn Thái Ngọc Duy (5):
rev-list-options
The convention has been option name is followed immediately by its
description without a line break.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/rev-list-options.txt | 1 -
1 file changed, 1 deletion(-)
diff --git a/Documentation/rev-list-options.txt
b/Documentation/rev-list
ones") but I feel option order is
not a good fit to express them.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
revision.c | 17 -
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/revision.c b/revision.c
index cda2606c66..45cffcab44 100644
--- a/revision.c
+++ b/r
RECTORY
- worktree $TRASH_DIRECTORY/destination
- worktree $TRASH_DIRECTORY/elsewhere
+ worktree $toplevel
+ worktree $toplevel/destination
+ worktree $toplevel/elsewhere
EOF
test_cmp expected actual &&
git -C destination log --format=%s
This keeps things a bit simpler when we add more fields, knowing that
default values are always zero.
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
worktree.c | 14 ++
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/worktree.c b/worktree.c
This is no-op. But it helps reduce diff noise in the next patch.
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
builtin/worktree.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 5c4854d3e4
It makes it easier to write tests for. But it should also be good for
the user since locating a worktree by eye would be easier once they
notice this.
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
builtin/worktree.c | 2 +-
t/t2027-worktree-list.sh | 19
quot; stuff in HEAD, from
resolve_refs_unsafe(). Now may be the time since refs refactoring is
mostly done.
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
builtin/worktree.c | 6 --
t/t2027-worktree-list.sh | 21 +
worktree.c
move the repository with the main worktree. The tricky part is make
sure all file descriptors to the repository are closed, or it may
fail on Windows.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/git-worktree.txt | 7 +-
builtin/worktree.c
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
worktree.c | 21 +
worktree.h | 6 ++
2 files changed, 27 insertions(+)
diff --git a/worktree.c b/worktree.c
index 929072ad89..7684951da5 100644
--- a/worktree.c
+++ b/worktree.c
@@ -354,6 +354,27
d we should not move that one.
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
worktree.c | 63 ++
worktree.h | 5 +
2 files changed, 68 insertions(+)
diff --git a/worktree.c b/worktree.c
index eb6121263b..929
This is another no-op patch, in preparation for get_worktrees() to do
optional things, like sorting.
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
branch.c | 2 +-
builtin/branch.c | 2 +-
builtin/worktree.c | 6 +++---
worktree.c | 4
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
Documentation/git-worktree.txt | 21 +
builtin/worktree.c | 79 ++
contrib/completion/git-completion.bash | 5 ++-
t/t2028-worktree-move.sh
de is in
place, this validate_no_submodules() could be removed.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/worktree.c | 23 +++
1 file changed, 23 insertions(+)
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 900b68bb5d..6c58d620ce 100644
--- a/builtin/worktree.c
+++ b/builtin/
Similar to "mv a b/", which is actually "mv a b/a", we extract basename
of source worktree and create a directory of the same name at
destination if dst path is a directory.
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Junio C Hamano
---
builtin/worktree.c | 19 ++
This is the document patch for f0298cf1c6 (revision walker: include a
detached HEAD in --all - 2009-01-16)
Signed-off-by: Nguyễn Thái Ngọc Duy
---
Documentation/rev-list-options.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/rev-list-options.txt
b
about the
detached-ness.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
v2 drops "detached".
Documentation/rev-list-options.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/rev-list-options.txt
b/Documentation/rev-list-options.txt
index 5da7cf5a8d..
Created in 5f3c3a4e6f (files_log_ref_write: new function - 2015-11-10)
but probably never used outside refs-internal.c
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 3 +++
refs/refs-internal.h | 4
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/refs/files
This is basically the extended version of resolve_gitlink_ref() where we
have access to more info from the underlying resolve_ref_recursively() call.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 20 ++--
refs.h | 3 +++
2 files changed, 17 insertions(+), 6 deletions
last 24 hours.
Still can't find any fundamental flaw...
Nguyễn Thái Ngọc Duy (2):
refs.c: add resolve_ref_submodule()
worktree.c: use submodule interface to access refs from another worktree
branch.c | 3 +-
refs.c | 20 +-
limit
support to "standard" layout, at least for now.
(*) The differences in sharing object database and refs between
submodules and linked worktrees don't really matter in this context.
(**) At this point, we may want to rename refs *_submodule API to
something more neutral
All these warning() calls are preceded by a system call. Report the
actual error to help the user understand why we fail to remove
something.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
builtin/clean.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/builtin/clean.c b
s
my next step.
Compound ref store will have to wait until I'm done with my
gc-in-worktree problem as I think I can live without it for now. I
think after compound ref store is in place, adding lmdb backend back
should be much cleaner because it does not care about either
submodules or
This code is going to be expanded a bit soon. Keep it out for
better readability later.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 22 ++
1 file changed, 14 insertions(+), 8 deletions(-)
diff --git a/refs.c b/refs.c
index 2cacd934e..8ef7a52ba 100644
--- a/refs.c
+++ b
true...
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 69
1 file changed, 21 insertions(+), 48 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 834bc6fdf..2fb270b6f 100644
--- a/refs/files-backend.c
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 59 ++--
refs.h | 13
refs/files-backend.c | 2 +-
refs/refs-internal.h | 12 ---
4 files changed, 48 insertions(+), 38 deletions(-)
diff --git a
submodules since we
don't convert submodule path to gitdir at every backend call like
before. We pay that once at ref-store creation.
More cleanup in files_downcast() follows shortly. It's separate to keep
noises from this patch.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c
Created in 5f3c3a4e6f (files_log_ref_write: new function - 2015-11-10)
but probably never used outside refs-internal.c
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 3 +++
refs/refs-internal.h | 4
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/refs/files
files-backend.c (probably should not exist in the first place). But
we'll leave it there until we have better multi-worktree support in refs
before we update it.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 193 ++-
1 file c
All refs outside refs/ directory is per-worktree, not just HEAD.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/refs-internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index f4aed49f5..69d02b6ba 100644
--- a/refs/refs
have to worry about memory management again.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 114 ---
1 file changed, 90 insertions(+), 24 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 75565c3aa..6582c9b
le() still does path
translation underneath. But that's for another patch.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index c69e4fe84..5
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 6 --
refs/refs-internal.h | 6 ++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/refs.c b/refs.c
index f03dcf58b..2cacd934e 100644
--- a/refs.c
+++ b/refs.c
@@ -489,12 +489,6 @@ int dwim_log(const char *str
f_store' should be replace by "gitdir". And a
compound ref_store is created to combine two files backends together,
one represents the shared refs in $GIT_COMMON_DIR, one per-worktree. At
that point, files_path() becomes a wrapper of strbuf_vaddf().
Signed-off-by: Nguyễn Thái Ngọc
All these warning() calls are preceded by a system call. Report the
actual error to help the user understand why we fail to remove
something.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
v2 dances with errno
builtin/clean.c | 19 ++-
1 file changed, 14 insertions(+), 5 deletions
binbSOlqAf8r_.bin
Description: plain
f_store' should be replace by "gitdir". And a
compound ref_store is created to combine two files backends together,
one represents the shared refs in $GIT_COMMON_DIR, one per-worktree. At
that point, files_path() becomes a wrapper of strbuf_vaddf().
Signed-off-by: Nguyễn Thái Ngọc
have to worry about memory management again.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 111 +--
1 file changed, 89 insertions(+), 22 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 75565c3aa..f0c878b
Created in 5f3c3a4e6f (files_log_ref_write: new function - 2015-11-10)
but probably never used outside refs-internal.c
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 3 +++
refs/refs-internal.h | 4
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/refs/files
files-backend.c (probably should not exist in the first place). But
we'll leave it there until we have better multi-worktree support in refs
before we update it.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 185 ++-
1 file c
All refs outside refs/ directory is per-worktree, not just HEAD.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/refs-internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index f4aed49f5..69d02b6ba 100644
--- a/refs/refs
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 6 --
refs/refs-internal.h | 6 ++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/refs.c b/refs.c
index 4f845798b..7a474198e 100644
--- a/refs.c
+++ b/refs.c
@@ -489,12 +489,6 @@ int dwim_log(const char *str
le() still does path
translation underneath. But that's for another patch.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 20 ++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 24f5bf7f1..7
This helps the future changes in this code. And because get_ref_store()
is destined to become get_submodule_ref_store(), the "get main store"
code path will be removed eventually. After this the patch to delete
that code will be cleaner.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
r
This is the last function in this code (besides public API) that takes
submodule argument and handles both main/submodule cases. Break it down,
move main store registration in get_main_ref_store() and keep the rest
in register_submodule_ref_store().
Signed-off-by: Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/refs.c b/refs.c
index 7a474198e..10994d992 100644
--- a/refs.c
+++ b/refs.c
@@ -1445,15 +1445,23 @@ static struct ref_store *ref_store_init(const char
*submodule
With get_main_ref_store() being used inside get_ref_store(),
lookup_ref_store() is only used for submodule code path. Rename to
reflect that and delete dead code.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 13 -
1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a
refs is learning to avoid path rewriting that is done by
strbuf_git_path_submodule(). Factor out this code so it could be reused
by refs*
Signed-off-by: Nguyễn Thái Ngọc Duy
---
path.c | 34 +++---
submodule.c | 31 +++
submodule.h
get_ref_store() will soon be renamed to get_submodule_ref_store().
Together with future get_worktree_ref_store(), the three functions
provide an appropriate ref store for different operation modes. New APIs
will be added to operate directly on ref stores.
Signed-off-by: Nguyễn Thái Ngọc Duy
true...
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 70
1 file changed, 21 insertions(+), 49 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index e8946e638..d9fc29d8d 100644
--- a/refs/files-backend.c
submodules since we
don't convert submodule path to gitdir at every backend call like
before. We pay that once at ref-store creation.
More cleanup in files_downcast() follows shortly. It's separate to keep
noises from this patch.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c
This function is intended to replace *_submodule() refs API. It provides
a ref store for a specific submodule, which can be operated on by a new
set of refs API.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 12
refs.h | 11 +++
refs/files
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 22 +-
refs.h | 4
2 files changed, 21 insertions(+), 5 deletions(-)
diff --git a/refs.c b/refs.c
index e0e191107..23e0a8eda 100644
--- a/refs.c
+++ b/refs.c
@@ -1535,13 +1535,25 @@ int peel_ref(const char *refname
The manual parsing code is replaced with a call to refs_resolve_ref_unsafe().
The manual parsing code must die because only refs/files-backend.c
should do that.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
branch.c | 3 +-
worktree.c | 102
Surprise surprise. This is just rename and introduce
resolve_ref_recursively() to the public.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 9 +
refs.h | 6 ++
refs/files-backend.c | 2 +-
refs/refs-internal.h | 5 -
4 files changed, 12 insertions
the naming convention with refs_ prefix for new APIs may not be
the best idea...
[1] public-inbox.org/git/20170213152011.12050-1-pclo...@gmail.com
Nguyễn Thái Ngọc Duy (5):
refs: introduce get_worktree_ref_store()
refs.c: add refs_resolve_ref_unsafe()
worktree.c: kill parse_ref() i
lists worktrees of a submodule), we can
update this function to work with submodules as well.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 27 +++
refs.h | 2 ++
2 files changed, 29 insertions(+)
diff --git a/refs.c b/refs.c
index e7206a420..ba4d9420c 100644
--- a
refs_create_symref(), we can move back pretty close to the code before
70999e9cec, where create_symref() was used for updating HEAD.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
branch.c | 12 ++--
refs.h | 9 -
refs/files-backend.c | 41
Created in 5f3c3a4e6f (files_log_ref_write: new function - 2015-11-10)
but probably never used outside refs-internal.c
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 3 +++
refs/refs-internal.h | 4
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/refs/files
All refs outside refs/ directory is per-worktree, not just HEAD.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/refs-internal.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs/refs-internal.h b/refs/refs-internal.h
index f4aed49f5..69d02b6ba 100644
--- a/refs/refs
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 6 --
refs/refs-internal.h | 6 ++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/refs.c b/refs.c
index 4f845798b..7a474198e 100644
--- a/refs.c
+++ b/refs.c
@@ -489,12 +489,6 @@ int dwim_log(const char *str
files-backend.c (probably should not exist in the first place). But
we'll leave it there until we have better multi-worktree support in refs
before we update it.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 185 ++-
1 file c
f_store' should be replace by "gitdir". And a
compound ref_store is created to combine two files backends together,
one represents the shared refs in $GIT_COMMON_DIR, one per-worktree. At
that point, files_path() becomes a wrapper of strbuf_vaddf().
Signed-off-by: Nguyễn Thái Ngọc
have to worry about memory management again.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 111 +--
1 file changed, 89 insertions(+), 22 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 75565c3aa..f0c878b
->gitcommondir.buf, tmp.buf);
+ else if (is_per_worktree_ref(tmp.buf) ||
+(skip_prefix(tmp.buf, "logs/", &ref) &&
+ is_per_worktree_ref(ref)))
strbuf_addf(sb, "%s/%s", refs->gitdir.buf, tmp.buf);
else
get_ref_store() will soon be renamed to get_submodule_ref_store().
Together with future get_worktree_ref_store(), the three functions
provide an appropriate ref store for different operation modes. New APIs
will be added to operate directly on ref stores.
Signed-off-by: Nguyễn Thái Ngọc Duy
This helps the future changes in this code. And because get_ref_store()
is destined to become get_submodule_ref_store(), the "get main store"
code path will be removed eventually. After this the patch to delete
that code will be cleaner.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
r
refs is learning to avoid path rewriting that is done by
strbuf_git_path_submodule(). Factor out this code so it could be reused
by refs*
Signed-off-by: Nguyễn Thái Ngọc Duy
---
path.c | 34 +++---
submodule.c | 31 +++
submodule.h
This function is intended to replace *_submodule() refs API. It provides
a ref store for a specific submodule, which can be operated on by a new
set of refs API.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 12
refs.h | 11 +++
refs/files
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/refs.c b/refs.c
index 7a474198e..10994d992 100644
--- a/refs.c
+++ b/refs.c
@@ -1445,15 +1445,23 @@ static struct ref_store *ref_store_init(const char
*submodule
submodules since we
don't convert submodule path to gitdir at every backend call like
before. We pay that once at ref-store creation.
More cleanup in files_downcast() follows shortly. It's separate to keep
noises from this patch.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs.c
This is the last function in this code (besides public API) that takes
submodule argument and handles both main/submodule cases. Break it down,
move main store registration in get_main_ref_store() and keep the rest
in register_submodule_ref_store().
Signed-off-by: Nguyễn Thái Ngọc Duy
le() still does path
translation underneath. But that's for another patch.
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 22 --
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 24f5bf7f1..0
true...
Signed-off-by: Nguyễn Thái Ngọc Duy
---
refs/files-backend.c | 70
1 file changed, 21 insertions(+), 49 deletions(-)
diff --git a/refs/files-backend.c b/refs/files-backend.c
index 627466043..d35032fcd 100644
--- a/refs/files-backend.c
201 - 300 of 5892 matches
Mail list logo