Skip to content

nd/multiple-work-trees reroll

Nguyễn Thái Ngọc Duy git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest34 patches 10 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/34path.c: make get_pathname() return strbuf instead of static bufferpath.c+51 -690 replies
2/34path.c: make get_pathname() call sites return const char *builtin/checkout.c builtin/clone.c builtin/fetch.c +12 more+36 -320 replies
3/34git_snpath(): retire and replace with strbuf_git_path()builtin/checkout.c cache.h path.c +2 more+55 -260 replies
4/34path.c: rename vsnpath() to do_git_path()path.c+4 -40 replies
5/34path.c: group git_path(), git_pathdup() and strbuf_git_path() togetherpath.c+10 -100 replies
6/34git_path(): be aware of file relocation in $GIT_DIRDocumentation/git-rev-parse.txt builtin/rev-parse.c cache.h +3 more+95 -70 replies
7/34*.sh: respect $GIT_INDEX_FILEgit-pull.sh git-stash.sh+2 -20 replies
8/34reflog: avoid constructing .lock path with git_pathbuiltin/reflog.c+1 -10 replies
9/34fast-import: use git_path() for accessing .git dir instead of get_git_dir()fast-import.c+1 -40 replies
10/34commit: use SEQ_DIR instead of hardcoding "sequencer"builtin/commit.c+1 -10 replies
11/34$GIT_COMMON_DIR: a new environment variableDocumentation/git.txt Documentation/gitrepository-layout.txt cache.h +3 more+117 -190 replies
12/34git-sh-setup.sh: use rev-parse --git-path to get $GIT_DIR/objectsgit-sh-setup.sh+1 -10 replies
13/34*.sh: avoid hardcoding $GIT_DIR/hooks/...git-am.sh git-rebase--interactive.sh git-rebase--merge.sh +3 more+22 -240 replies
14/34git-stash: avoid hardcoding $GIT_DIR/logs/....git-stash.sh+2 -20 replies
15/34setup.c: convert is_git_directory() to use strbufsetup.c+21 -160 replies
16/34setup.c: detect $GIT_COMMON_DIR in is_git_directory()Documentation/gitrepository-layout.txt setup.c+44 -60 replies
17/34setup.c: convert check_repository_format_gently to use strbufsetup.c+8 -40 replies
18/34setup.c: detect $GIT_COMMON_DIR check_repository_format_gently()setup.c+4 -20 replies
19/34setup.c: support multi-checkout repo setupDocumentation/config.txt Documentation/git-rev-parse.txt builtin/rev-parse.c +6 more+115 -140 replies
20/34wrapper.c: wrapper to open a file, fprintf then closecache.h wrapper.c+33 -00 replies
21/34use new wrapper write_file() for simple file writingbuiltin/branch.c builtin/init-db.c daemon.c +2 more+8 -310 replies
22/34checkout: support checking out into a new working directoryDocumentation/git-checkout.txt Documentation/git.txt Documentation/gitrepository-layout.txt +3 more+212 -40 replies
23/34prune: strategies for linked checkoutsDocumentation/git-checkout.txt Documentation/git-prune.txt Documentation/gitrepository-layout.txt +4 more+251 -20 replies
24/34checkout: reject if the branch is already checked out elsewherebuiltin/checkout.c t/t2025-checkout-to.sh+104 -710 replies
25/34checkout: clean up half-prepared directories in --to modebuiltin/checkout.c t/t2025-checkout-to.sh+54 -00 replies
26/34gc: style change -- no SP before closing parenthesisbuiltin/gc.c+1 -10 replies
27/34gc: factor out gc.pruneexpire parsing codebuiltin/gc.c+12 -100 replies
28/34gc: support prune --worktreesDocumentation/config.txt Documentation/git-checkout.txt builtin/gc.c+24 -40 replies
29/34count-objects: report unused files in $GIT_DIR/worktrees/...builtin/count-objects.c cache.h path.c+31 -30 replies
30/34git_path(): keep "info/sparse-checkout" per work-treepath.c t/t0060-path-utils.sh+3 -10 replies
31/34checkout: don't require a work tree when checking out into a new onebuiltin/checkout.c git.c t/t2025-checkout-to.sh+19 -10 replies
32/34t2025: add a test to make sure grafts is working from a linked checkoutt/t2025-checkout-to.sh+18 -00 replies
33/34checkout: do not fail if target is an empty directorybuiltin/checkout.c t/t2025-checkout-to.sh+7 -20 replies
34/34git-common-dir: make "modules/" per-working-directory directoryDocumentation/gitrepository-layout.txt path.c t/t7410-submodule-checkout-to.sh+52 -40 replies

Reviews trailers per patch

None of the 34 patches has a Reviewed-by or Acked-by.

PatchJens LehmannJohannes SixtMarc BranchaudEric Sunshine
1/34
2/34
3/34
4/34
5/34
6/34
7/34
8/34
9/34
10/34
11/34Helped-by
12/34
13/34
14/34
15/34
16/34
17/34
18/34
19/34Helped-by
20/34
21/34
22/34Helped-by
23/34Helped-by Helped-by Helped-by
24/34
25/34
26/34
27/34
28/34Helped-by
29/34
30/34
31/34
32/34
33/34
34/34

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 00/34] nd/multiple-work-trees reroll

This is rebased so the diff below (against the version on Junio's repo) is only approximate. Changes include test fixes for Windows port, $GIT_COMMON_DIR and $GIT_DIR/modules problems with submodules. Patch 03/34 is rewritten to touch less in refs.c to reduce conflicts. A lot of changes there are just revert.

Documentation/gitrepository-layout.txt +1 -3
index 2b30a92..7173b38 100644
@@ -248,9 +248,7 @@ commondir::
 	incomplete without the repository pointed by "commondir".
 
 modules::
-	Contains the git-repositories of the submodules. This
-	directory is ignored if $GIT_COMMON_DIR is set and
-	"$GIT_COMMON_DIR/modules" will be used instead.
+	Contains the git-repositories of the submodules.
 
 worktrees::
 	Contains worktree specific information of linked
builtin/checkout.c +2 -2
index 01d0f2f..e70e66c 100644
@@ -865,7 +865,7 @@ static int prepare_linked_checkout(const struct checkout_opts *opts,
 
 	if (!new->commit)
 		die(_("no branch specified"));
-	if (file_exists(path))
+	if (file_exists(path) && !is_empty_dir(path))
 		die(_("'%s' already exists"), path);
 
 	len = strlen(path);
@@ -1207,7 +1207,7 @@ static int parse_branchname_arg(int argc, const char **argv,
 	if (new->path && !force_detach && !*new_branch) {
 		unsigned char sha1[20];
 		int flag;
-		char *head_ref = resolve_refdup("HEAD", sha1, 0, &flag);
+		char *head_ref = resolve_refdup("HEAD", 0, sha1, &flag);
 		if (head_ref &&
 		    (!(flag & REF_ISSYMREF) || strcmp(head_ref, new->path)))
 			check_linked_checkouts(new);
environment.c +1 -0
index d5b0788..8351007 100644
@@ -101,6 +101,7 @@ const char * const local_repo_env[] = {
 	NO_REPLACE_OBJECTS_ENVIRONMENT,
 	GIT_PREFIX_ENVIRONMENT,
 	GIT_SHALLOW_FILE_ENVIRONMENT,
+	GIT_COMMON_DIR_ENVIRONMENT,
 	NULL
 };
 
path.c +1 -1
index 35d498e..a5c51a3 100644
@@ -92,7 +92,7 @@ static void replace_dir(struct strbuf *buf, int len, const char *newdir)
 }
 
 static const char *common_list[] = {
-	"/branches", "/hooks", "/info", "!/logs", "/lost-found", "/modules",
+	"/branches", "/hooks", "/info", "!/logs", "/lost-found",
 	"/objects", "/refs", "/remotes", "/worktrees", "/rr-cache", "/svn",
 	"config", "!gc.pid", "packed-refs", "shallow",
 	NULL
refs.c +61 -47

245 lines not on this page · raw message

t/t1501-worktree.sh +1 -1
index e6ac7a4..4df7a2f 100755
@@ -366,7 +366,7 @@ test_expect_success 'GIT_DIR set (1)' '
 
 test_expect_success 'GIT_DIR set (2)' '
 	echo "gitdir: repo.git/repos/foo" >gitfile &&
-	echo "$TRASH_DIRECTORY/repo.git" >repo.git/repos/foo/commondir &&
+	echo "$(pwd)/repo.git" >repo.git/repos/foo/commondir &&
 	(
 		cd work &&
 		GIT_DIR=../gitfile git rev-parse --git-common-dir >actual &&
t/t2025-checkout-to.sh +6 -1
index eddd325..915b506 100755
@@ -13,10 +13,15 @@ test_expect_success 'checkout --to not updating paths' '
 '
 
 test_expect_success 'checkout --to an existing worktree' '
-	mkdir existing &&
+	mkdir -p existing/subtree &&
 	test_must_fail git checkout --detach --to existing master
 '
 
+test_expect_success 'checkout --to an existing empty worktree' '
+	mkdir existing_empty &&
+	git checkout --detach --to existing_empty master
+'
+
 test_expect_success 'checkout --to refuses to checkout locked branch' '
 	test_must_fail git checkout --to zere master &&
 	! test -d zere &&
t/t2026-prune-linked-checkouts.sh +2 -2
index 3622800..170aefe 100755
@@ -57,7 +57,7 @@ test_expect_success 'prune directories with invalid gitdir' '
 test_expect_success 'prune directories with gitdir pointing to nowhere' '
 	mkdir -p .git/worktrees/def/abc &&
 	: >.git/worktrees/def/def &&
-	echo "$TRASH_DIRECTORY"/nowhere >.git/worktrees/def/gitdir &&
+	echo "$(pwd)"/nowhere >.git/worktrees/def/gitdir &&
 	git prune --worktrees --verbose >actual &&
 	test_i18ngrep "Removing worktrees/def: gitdir file points to non-existent location" actual &&
 	! test -d .git/worktrees/def &&
@@ -76,7 +76,7 @@ test_expect_success 'not prune recent checkouts' '
 	test_when_finished rm -r .git/worktrees
 	mkdir zz &&
 	mkdir -p .git/worktrees/jlm &&
-	echo "$TRASH_DIRECTORY"/zz >.git/worktrees/jlm/gitdir &&
+	echo "$(pwd)"/zz >.git/worktrees/jlm/gitdir &&
 	git prune --worktrees --verbose --expire=2.days.ago &&
 	test -d .git/worktrees/jlm
 '
t/t7410-submodule-checkout-to.sh new file +50 -0

50 lines not on this page · raw message