[GIT PULL] some updates from German l10n team

2014-09-27 Thread Jiang Xin
Hi Junio, Please pull German l10n updates to the maint branch, and merge them back to the master branch later. The following changes since commit 96db324a73fdada6fbe7b63221986f8f18cc63b0: Merge git://github.com/git-l10n/git-po (2014-08-29 10:18:22 -0700) are available in the git repository

[PATCH] init - Honour the global core.filemode setting

2014-09-27 Thread Hilco Wijbenga
If ~/.gitconfig contains a core.filemode entry then git init should honour that setting. Signed-off-by: Hilco Wijbenga hilco.wijbe...@gmail.com --- This bit me at work where I have to work with Windows. Git on Cygwin and the Eclipse Git plugin do not agree on file attributes so I had set filemode

[PATCH v3 00/32] nd/multiple-work-trees

2014-09-27 Thread Nguyễn Thái Ngọc Duy
On Fri, Sep 26, 2014 at 4:20 AM, Junio C Hamano gits...@pobox.com wrote: It has been a while since the last review exchanges were seen.  Will it be time for v3 soon? Sorry I've been slow on picking up feedback from v2. v3 is rebased on latest master. Other changes are mostly *.txt, and one

[PATCH v3 03/32] git_snpath(): retire and replace with strbuf_git_path()

2014-09-27 Thread Nguyễn Thái Ngọc Duy
In the previous patch, git_snpath() is modified to allocate a new strbuf buffer because vsnpath() needs that. But that makes it awkward because git_snpath() receives a pre-allocated buffer from outside and has to copy data back. Rename it to strbuf_git_path() and make it receive strbuf directly.

[PATCH v3 07/32] *.sh: respect $GIT_INDEX_FILE

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- git-pull.sh | 2 +- git-stash.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/git-pull.sh b/git-pull.sh index 4d4fc77..ad44226 100755 --- a/git-pull.sh +++

[PATCH v3 04/32] path.c: rename vsnpath() to do_git_path()

2014-09-27 Thread Nguyễn Thái Ngọc Duy
The name vsnpath() gives an impression that this is general path handling function. It's not. This is the underlying implementation of git_path(), git_pathdup() and strbuf_git_path() which will prefix $GIT_DIR in the result string. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

[PATCH v3 01/32] path.c: make get_pathname() return strbuf instead of static buffer

2014-09-27 Thread Nguyễn Thái Ngọc Duy
We've been avoiding PATH_MAX whenever possible. This patch makes get_pathname() return a strbuf and updates the callers to take advantage of this. The code is simplified as we no longer need to worry about buffer overflow. vsnpath() behavior is changed slightly: previously it always clears the

[PATCH v3 05/32] path.c: group git_path(), git_pathdup() and strbuf_git_path() together

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- path.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/path.c b/path.c index 6991103..df0f75b 100644 --- a/path.c +++ b/path.c @@ -78,6 +78,16 @@

[PATCH v3 02/32] path.c: make get_pathname() call sites return const char *

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Before the previous commit, get_pathname returns an array of PATH_MAX length. Even if git_path() and similar functions does not use the whole array, git_path() caller can, in theory. After the commit, get_pathname() may return a buffer that has just enough room for the returned string and

[PATCH v3 08/32] reflog: avoid constructing .lock path with git_path

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Among pathnames in $GIT_DIR, e.g. index or packed-refs, we want to automatically and silently map some of them to the $GIT_DIR of the repository we are borrowing from via $GIT_COMMON_DIR mechanism. When we formulate the pathname for its lockfile, we want it to be in the same location as its final

[PATCH v3 06/32] git_path(): be aware of file relocation in $GIT_DIR

2014-09-27 Thread Nguyễn Thái Ngọc Duy
We allow the user to relocate certain paths out of $GIT_DIR via environment variables, e.g. GIT_OBJECT_DIRECTORY, GIT_INDEX_FILE and GIT_GRAFT_FILE. Callers are not supposed to use git_path() or git_pathdup() to get those paths. Instead they must use get_object_directory(), get_index_file() and

[PATCH v3 11/32] $GIT_COMMON_DIR: a new environment variable

2014-09-27 Thread Nguyễn Thái Ngọc Duy
This variable is intended to support multiple working directories attached to a repository. Such a repository may have a main working directory, created by either git init or git clone and one or more linked working directories. These working directories and the main repository share the same

[PATCH v3 12/32] git-sh-setup.sh: use rev-parse --git-path to get $GIT_DIR/objects

2014-09-27 Thread Nguyễn Thái Ngọc Duy
If $GIT_COMMON_DIR is set, $GIT_OBJECT_DIRECTORY should be $GIT_COMMON_DIR/objects, not $GIT_DIR/objects. Just let rev-parse --git-path handle it. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- git-sh-setup.sh | 2 +- 1 file changed, 1

[PATCH v3 10/32] commit: use SEQ_DIR instead of hardcoding sequencer

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- builtin/commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/commit.c b/builtin/commit.c index b0fe784..08df727 100644 --- a/builtin/commit.c +++

[PATCH v3 09/32] fast-import: use git_path() for accessing .git dir instead of get_git_dir()

2014-09-27 Thread Nguyễn Thái Ngọc Duy
This allows git_path() to redirect info/fast-import to another place if needed Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- fast-import.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fast-import.c

[PATCH v3 16/32] setup.c: detect $GIT_COMMON_DIR in is_git_directory()

2014-09-27 Thread Nguyễn Thái Ngọc Duy
If the file $GIT_DIR/commondir exists, it contains the value of $GIT_COMMON_DIR. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- Documentation/gitrepository-layout.txt | 7 ++ setup.c| 43

[PATCH v3 14/32] git-stash: avoid hardcoding $GIT_DIR/logs/....

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- git-stash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-stash.sh b/git-stash.sh index 4294aa0..2784f8b 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -184,7

[PATCH v3 15/32] setup.c: convert is_git_directory() to use strbuf

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- setup.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/setup.c b/setup.c index 979b13f..afd6742 100644 --- a/setup.c +++ b/setup.c

[PATCH v3 17/32] setup.c: convert check_repository_format_gently to use strbuf

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- setup.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setup.c b/setup.c index 6c52f75..00a23e6 100644 --- a/setup.c +++ b/setup.c @@ -342,7 +342,9 @@ void

[PATCH v3 13/32] *.sh: avoid hardcoding $GIT_DIR/hooks/...

2014-09-27 Thread Nguyễn Thái Ngọc Duy
If $GIT_COMMON_DIR is set, it should be $GIT_COMMON_DIR/hooks/, not $GIT_DIR/hooks/. Just let rev-parse --git-path handle it. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- git-am.sh | 22

[PATCH v3 22/32] checkout: support checking out into a new working directory

2014-09-27 Thread Nguyễn Thái Ngọc Duy
git checkout --to sets up a new working directory with a .git file pointing to $GIT_DIR/worktrees/id. It then executes git checkout again on the new worktree with the same arguments except --to is taken out. The second checkout execution, which is not contaminated with any info from the current

[PATCH v3 24/32] checkout: reject if the branch is already checked out elsewhere

2014-09-27 Thread Nguyễn Thái Ngọc Duy
One branch obviously can't be checked out at two places (but detached heads are ok). Give the user a choice in this case: --detach, -b new-branch, switch branch in the other checkout first or simply 'cd' and continue to work there. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com ---

[PATCH v3 23/32] prune: strategies for linked checkouts

2014-09-27 Thread Nguyễn Thái Ngọc Duy
(alias R=$GIT_COMMON_DIR/worktrees/id) - linked checkouts are supposed to keep its location in $R/gitdir up to date. The use case is auto fixup after a manual checkout move. - linked checkouts are supposed to update mtime of $R/gitdir. If $R/gitdir's mtime is older than a limit, and it

[PATCH v3 20/32] wrapper.c: wrapper to open a file, fprintf then close

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- cache.h | 2 ++ wrapper.c | 31 +++ 2 files changed, 33 insertions(+) diff --git a/cache.h b/cache.h index 1784fc6..aedfd05 100644 --- a/cache.h +++ b/cache.h

[PATCH v3 27/32] gc: factor out gc.pruneexpire parsing code

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- builtin/gc.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index b690929..849a87c 100644 --- a/builtin/gc.c +++

[PATCH v3 26/32] gc: style change -- no SP before closing parenthesis

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- builtin/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/gc.c b/builtin/gc.c index ced1456..b690929 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -287,7

[PATCH v3 21/32] use new wrapper write_file() for simple file writing

2014-09-27 Thread Nguyễn Thái Ngọc Duy
This fixes common problems in these code about error handling, forgetting to close the file handle after fprintf() fails, or not printing out the error string.. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- builtin/branch.c | 4 +---

[PATCH v3 28/32] gc: support prune --worktrees

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Helped-by: Marc Branchaud marcn...@xiplink.com Signed-off-by: Marc Branchaud marcn...@xiplink.com Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/config.txt | 7 +++ Documentation/git-checkout.txt | 11 +++ builtin/gc.c | 10 ++

[PATCH v3 19/32] setup.c: support multi-checkout repo setup

2014-09-27 Thread Nguyễn Thái Ngọc Duy
The repo setup procedure is updated to detect $GIT_DIR/commondir and set $GIT_COMMON_DIR properly. The core.worktree is ignored when $GIT_COMMON_DIR is set. This is because the config file is shared in multi-checkout setup, but checkout directories _are_ different. Making core.worktree effective

[PATCH v3 18/32] setup.c: detect $GIT_COMMON_DIR check_repository_format_gently()

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Junio C Hamano gits...@pobox.com --- setup.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.c b/setup.c index 00a23e6..1d4f1aa 100644 --- a/setup.c +++ b/setup.c @@ -346,6 +346,10 @@ static int

[PATCH v3 25/32] checkout: clean up half-prepared directories in --to mode

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/checkout.c | 48 t/t2025-checkout-to.sh | 6 ++ 2 files changed, 54 insertions(+) diff --git a/builtin/checkout.c b/builtin/checkout.c index 6d68913..bd0e2d5 100644 ---

[PATCH v3 32/32] t2025: add a test to make sure grafts is working from a linked checkout

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- t/t2025-checkout-to.sh | 18 ++ 1 file changed, 18 insertions(+) diff --git a/t/t2025-checkout-to.sh b/t/t2025-checkout-to.sh index 4bd1df4..eddd325 100755 --- a/t/t2025-checkout-to.sh +++ b/t/t2025-checkout-to.sh @@ -96,4

[PATCH v3 31/32] checkout: don't require a work tree when checking out into a new one

2014-09-27 Thread Nguyễn Thái Ngọc Duy
From: Dennis Kaarsemaker den...@kaarsemaker.net For normal use cases, it does not make sense for 'checkout' to work on a bare repository, without a worktree. But checkout --to is an exception because it _creates_ a new worktree. Allow this option to run on bare repositories. People who check out

[PATCH v3 30/32] git_path(): keep info/sparse-checkout per work-tree

2014-09-27 Thread Nguyễn Thái Ngọc Duy
Currently git_path(info/sparse-checkout) resolves to $GIT_COMMON_DIR/info/sparse-checkout in multiple worktree mode. It makes more sense for the sparse checkout patterns to be per worktree, so you can have multiple checkouts with different parts of the tree. With this, git checkout --to new on a

[PATCH v3 29/32] count-objects: report unused files in $GIT_DIR/worktrees/...

2014-09-27 Thread Nguyễn Thái Ngọc Duy
In linked checkouts, borrowed parts like config is taken from $GIT_COMMON_DIR. $GIT_DIR/config is never used. Report them as garbage. Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- builtin/count-objects.c | 4 +++- cache.h | 1 + path.c | 29