From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
max@max630.net, git@drmicha.warpmail.net, Jens.Lehmann@web.de,
"Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH v3 1/6] worktree: new repo extension to manage worktree behaviors
Date: Tue, 26 Jan 2016 18:44:40 +0700 [thread overview]
Message-ID: <1453808685-21235-2-git-send-email-pclouds@gmail.com> (raw)
In-Reply-To: <1453808685-21235-1-git-send-email-pclouds@gmail.com>
Multiple worktree setup is still evolving and its behavior may be
changed in future. But we do not want to break existing worktree
setups. A new set of extensions, worktree=X, is recognized to tell Git
what multiple worktree "version" is being used so that Git can
behavior accordingly.
This extension has no use yet. The first one will be config split.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
Documentation/git-worktree.txt | 12 ++++++++++++
Documentation/technical/repository-version.txt | 6 ++++++
cache.h | 1 +
environment.c | 1 +
setup.c | 3 +++
5 files changed, 23 insertions(+)
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index 5b9ad04..048d7d6 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git-worktree.txt
@@ -106,6 +106,18 @@ OPTIONS
--expire <time>::
With `prune`, only expire unused working trees older than <time>.
+WORKTREE VERSIONS AND MIGRATION
+-------------------------------
+Multiple worktree is still an experimental feature and evolving. Every
+time the behavior is changed, the "worktree version" is stepped
+up. Worktree version is stored as a configuration variable
+extensions.worktree.
+
+Version 0
+~~~~~~~~~
+This is the first release. Version 0 is implied if extensions.worktree
+does not exist.
+
DETAILS
-------
Each linked working tree has a private sub-directory in the repository's
diff --git a/Documentation/technical/repository-version.txt b/Documentation/technical/repository-version.txt
index 00ad379..e4583c5 100644
--- a/Documentation/technical/repository-version.txt
+++ b/Documentation/technical/repository-version.txt
@@ -86,3 +86,9 @@ for testing format-1 compatibility.
When the config key `extensions.preciousObjects` is set to `true`,
objects in the repository MUST NOT be deleted (e.g., by `git-prune` or
`git repack -d`).
+
+`worktree`
+~~~~~~~~~~
+
+Define behavior in multiple worktree setup. The value specifies the
+version. Default version is zero.
diff --git a/cache.h b/cache.h
index dfc459c..e742c46 100644
--- a/cache.h
+++ b/cache.h
@@ -727,6 +727,7 @@ extern int grafts_replace_parents;
#define GIT_REPO_VERSION_READ 1
extern int repository_format_version;
extern int repository_format_precious_objects;
+extern int repository_format_worktree_version;
extern int check_repository_format(void);
#define MTIME_CHANGED 0x0001
diff --git a/environment.c b/environment.c
index 1cc4aab..1bd4a56 100644
--- a/environment.c
+++ b/environment.c
@@ -27,6 +27,7 @@ int warn_on_object_refname_ambiguity = 1;
int ref_paranoia = -1;
int repository_format_version;
int repository_format_precious_objects;
+int repository_format_worktree_version;
const char *git_commit_encoding;
const char *git_log_output_encoding;
int shared_repository = PERM_UMASK;
diff --git a/setup.c b/setup.c
index d343725..2f41648 100644
--- a/setup.c
+++ b/setup.c
@@ -373,6 +373,9 @@ static int check_repo_format(const char *var, const char *value, void *cb)
;
else if (!strcmp(ext, "preciousobjects"))
repository_format_precious_objects = git_config_bool(var, value);
+ else if (!strcmp(ext, "worktree"))
+ repository_format_worktree_version =
+ git_config_ulong(var, value);
else
string_list_append(&unknown_extensions, ext);
}
--
2.7.0.288.g1d8ad15
next prev parent reply other threads:[~2016-01-26 11:45 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-02 19:13 [PATCH 0/5] Split .git/config in multiple worktree setup Nguyễn Thái Ngọc Duy
2015-12-02 19:13 ` [PATCH 1/5] dir.c: clean the entire struct in clear_exclude_list() Nguyễn Thái Ngọc Duy
2015-12-02 19:13 ` [PATCH 2/5] config.c: move worktree-specific variables to .git/worktrees/ Nguyễn Thái Ngọc Duy
2015-12-06 7:47 ` Eric Sunshine
2015-12-06 10:22 ` Duy Nguyen
2015-12-02 19:13 ` [PATCH 3/5] setup.c: remove special case of core.worktree and core.bare Nguyễn Thái Ngọc Duy
2015-12-02 19:13 ` [PATCH 4/5] worktree: make core.sparseCheckout and core.ignoreStat per-worktree Nguyễn Thái Ngọc Duy
2015-12-02 19:13 ` [PATCH 5/5] git-worktree.txt: mention about the config file split Nguyễn Thái Ngọc Duy
2015-12-06 8:02 ` Eric Sunshine
2015-12-03 6:15 ` [PATCH 0/5] Split .git/config in multiple worktree setup Max Kirillov
2015-12-03 8:07 ` Duy Nguyen
2015-12-03 19:52 ` Junio C Hamano
2015-12-03 21:00 ` Max Kirillov
2015-12-03 20:53 ` Max Kirillov
2015-12-04 15:57 ` Duy Nguyen
2015-12-27 3:14 ` [PATCH v2 0/6] " Nguyễn Thái Ngọc Duy
2015-12-27 3:14 ` [PATCH v2 1/6] Define new repo extension to manage multiple worktree behaviors Nguyễn Thái Ngọc Duy
2015-12-27 3:14 ` [PATCH v2 2/6] config.c: move worktree-specific variables to .git/worktrees/ Nguyễn Thái Ngọc Duy
2015-12-27 3:14 ` [PATCH v2 3/6] setup.c: remove special case of core.worktree and core.bare Nguyễn Thái Ngọc Duy
2015-12-27 3:14 ` [PATCH v2 4/6] worktree: make core.sparseCheckout and core.ignoreStat per-worktree Nguyễn Thái Ngọc Duy
2015-12-27 3:14 ` [PATCH v2 5/6] config.c: allow to un-share certain config in multi-worktree setup Nguyễn Thái Ngọc Duy
2015-12-27 3:14 ` [PATCH v2 6/6] worktree: bump worktree version to 1 on "worktree add" Nguyễn Thái Ngọc Duy
2016-01-11 22:43 ` [PATCH v2 0/6] Split .git/config in multiple worktree setup Max Kirillov
2016-01-26 11:44 ` [PATCH v3 " Nguyễn Thái Ngọc Duy
2016-01-26 11:44 ` Nguyễn Thái Ngọc Duy [this message]
2016-01-27 22:12 ` [PATCH v3 1/6] worktree: new repo extension to manage worktree behaviors Junio C Hamano
2016-01-28 12:11 ` Duy Nguyen
2016-01-30 14:20 ` Max Kirillov
2016-01-31 16:42 ` Junio C Hamano
2016-02-01 2:41 ` Stefan Monnier
2016-02-01 2:47 ` Stefan Monnier
2016-02-01 5:23 ` Duy Nguyen
2016-02-01 18:19 ` Junio C Hamano
2016-02-04 18:12 ` git worktree (was: [PATCH v3 1/6] worktree: new repo extension to manage worktree behaviors) Stefan Monnier
2016-02-01 18:39 ` [PATCH v3 1/6] worktree: new repo extension to manage worktree behaviors Dennis Kaarsemaker
2016-01-30 13:59 ` Max Kirillov
2016-01-26 11:44 ` [PATCH v3 2/6] path.c: new (identical) list for worktree v1 Nguyễn Thái Ngọc Duy
2016-01-27 22:18 ` Junio C Hamano
2016-01-30 14:45 ` Max Kirillov
2016-01-26 11:44 ` [PATCH v3 3/6] worktree: share .git/common in v1 Nguyễn Thái Ngọc Duy
2016-01-26 11:44 ` [PATCH v3 4/6] worktree: new config file hierarchy Nguyễn Thái Ngọc Duy
2016-01-27 22:22 ` Junio C Hamano
2016-01-28 12:03 ` Duy Nguyen
2016-01-28 18:45 ` Junio C Hamano
2016-02-01 5:09 ` Duy Nguyen
2016-01-26 11:44 ` [PATCH v3 5/6] config: select .git/common/config with --repo Nguyễn Thái Ngọc Duy
2016-01-30 22:10 ` Max Kirillov
2016-02-01 5:15 ` Duy Nguyen
2016-01-26 11:44 ` [PATCH v3 6/6] worktree add: switch to worktree version 1 Nguyễn Thái Ngọc Duy
2016-02-01 5:33 ` Max Kirillov
2016-02-01 6:05 ` Duy Nguyen
2016-02-02 5:35 ` Max Kirillov
2016-01-27 22:23 ` [PATCH v3 0/6] Split .git/config in multiple worktree setup Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1453808685-21235-2-git-send-email-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=Jens.Lehmann@web.de \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=max@max630.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).