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

2014-08-30 Thread Duy Nguyen
On Sun, Aug 31, 2014 at 11:49 AM, Duy Nguyen wrote: > All checkouts share the same repository. Linked checkouts see the > repository a bit different from the main checkout. When you perform > the command > > > git checkout --to > > > The checkout at will have a unique

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

2014-08-30 Thread Duy Nguyen
On Sun, Aug 31, 2014 at 3:50 AM, Philip Oakley wrote: >> @@ -225,6 +225,13 @@ This means that you can use `git checkout -p` to >> selectively discard >> edits from your current working tree. See the ``Interactive Mode'' >> section of linkgit:git-add[1] to learn how to operate the `--patch` mode. >

[PATCH] gc --auto: do not run 'pack-refs' and 'reflog expire' twice

2014-08-30 Thread Nguyễn Thái Ngọc Duy
In the --auto code path, gc_before_repack() is called once in parent process then again in the forked process. Stop the second run. Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/gc.c | 5 + 1 file changed, 5 insertions(+) diff --git a/builtin/gc.c b/builtin/gc.c index 8d219d8..fb0cff3 100

Re: Auto Packing message twice?

2014-08-30 Thread Duy Nguyen
On Sat, Aug 30, 2014 at 09:12:57PM +0700, Duy Nguyen wrote: > On Sat, Aug 30, 2014 at 6:28 PM, Stefan Beller wrote: > > Auto packing the repository in background for optimum performance. > > See "git help gc" for manual housekeeping. > > Auto packing the repository in background for optimum perfor

Re: Configurable filename for what is now .gitignore

2014-08-30 Thread Bostjan Skufca
Hi Jonathan, nope, haven't seen zit before, it does partly what I would need, but just for one file at a time (a "bit" awkward) and not really portable (git clone will not clone .FILE.git/exclude, for example). Anyway, do you think that a patch which makes .gitignore filename configurable would b

Re: [PATCH 2/2] index-pack: handle duplicate base objects gracefully

2014-08-30 Thread Shawn Pearce
On Sat, Aug 30, 2014 at 6:16 AM, Jeff King wrote: > On Fri, Aug 29, 2014 at 07:59:32PM -0700, Shawn Pearce wrote: > >> > I agree it is probably a bug on the sending side, but I think last time >> > this came up we decided to try to be liberal in what we accept. c.f. >> > http://thread.gmane.org/g

Re: progress.c does not compile under Mac OS X

2014-08-30 Thread Jonas 'Sortie' Termansen
Oh, I'm a bit confused here - lots of things happening. Submitting patches to projects is usually fairly simple; it's excitingly fresh to get a bunch of replies, having the patch set revised, more replies, then a further revised patch set gets merged to a development branch, and then I get suddenl

[PATCH] rev-parse: include HEAD in --all output

2014-08-30 Thread Max Kirillov
for_each_ref() does not include it itself, and without the hash the detached HEAD may be missed by some frontends (like gitk). Add test which verifies the head is returned Update test t6018-rev-list-glob.sh which relied on exact list of returned hashes. Signed-off-by: Max Kirillov --- builtin/

[PATCH] merge-tree: remove unused df_conflict arguments

2014-08-30 Thread René Scharfe
merge_trees_recursive() stores a pointer to its parameter df_conflict in its struct traverse_info, but it is never actually used. Stop doing that, remove the parameter and inline the function into merge_trees(), as the latter is now only passing on its parameters. Remove the parameter df_conflict

[PATCH v3 2/2] MinGW: Update tests to handle a native eol of crlf

2014-08-30 Thread Torsten Bögershausen
Integrate commit b1d07649588102 from msysgit: MinGW: Update tests to handle a native eol of crlf Some of the tests were written with the assumption that the native eol would always be lf. After defining NATIVE_CRLF on MinGW, these tests began failing. This change will update the tests to a

[PATCH v3 1/2] Push the NATIVE_CRLF Makefile variable to C and added a test for native.

2014-08-30 Thread Torsten Bögershausen
From: Pat Thoyts Commit 95f31e9a correctly points out that the NATIVE_CRLF setting is incorrectly set on Mingw git. However, the Makefile variable is not propagated to the C preprocessor and results in no change. This patch pushes the definition to the C code and adds a test to validate that when

[PATCH] reachable.c: add HEAD to reachability starting commits

2014-08-30 Thread Max Kirillov
HEAD is not explicitly used as a starting commit for calculating reachability, so if it's detached and reflogs are disabled it may be pruned. Add test which demonstrates it. Signed-off-by: Max Kirillov --- Hi. This is a followup of http://thread.gmane.org/gmane.comp.version-control.git/255996

Re: [PATCH 2/2] stash: prefer --quiet over shell redirection

2014-08-30 Thread Johannes Sixt
Am 30.08.2014 21:30, schrieb David Aguilar: > Use `git rev-parse --quiet` instead of redirecting to /dev/null. > > Signed-off-by: David Aguilar > --- > git-stash.sh | 14 +++--- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/git-stash.sh b/git-stash.sh > index bcc757

Re: [PATCH 1/2] bisect: remove unnecessary redirection

2014-08-30 Thread Johannes Sixt
Am 30.08.2014 21:30, schrieb David Aguilar: > `git rev-parse` is being called with --quiet so there's no need to > redirect to /dev/null. > > Signed-off-by: David Aguilar > --- > git-bisect.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/git-bisect.sh b/git-bisect.sh

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

2014-08-30 Thread Philip Oakley
From: "Nguyễn Thái Ngọc Duy" "git checkout --to" sets up a new working directory with a .git file pointing to $GIT_DIR/repos/. 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 wi

Re: [PATCH] Improve English grammar

2014-08-30 Thread Johan Herland
On Sat, Aug 30, 2014 at 9:56 PM, Alex Henrie wrote: > Hi, I submitted this patch a week ago and got no reply, so I'm sending > it again and CC'ing the original authors this time... > > Signed-off-by: Alex Henrie Looks good to me. Acked-by: Johan Herland -- Johan Herland, www.herland.net --

progress.c does not compile under Mac OS X

2014-08-30 Thread Torsten Bögershausen
progress.c:66: error: ‘CLOCK_MONOTONIC’ undeclared (first use in this function) You can not cast a undeclared into void in git-compat-uitl.h: #define timer_create(clockid, sevp, timerp) ((void) (clockid), (void) (sevp), (void) (timerp), errno Removing the cast of a define into (void) makes the

[PATCH] Improve English grammar

2014-08-30 Thread Alex Henrie
Hi, I submitted this patch a week ago and got no reply, so I'm sending it again and CC'ing the original authors this time... Signed-off-by: Alex Henrie --- builtin/commit.c | 2 +- builtin/ls-files.c | 2 +- builtin/merge.c| 4 ++-- builtin/notes.c| 2 +- builtin/rm.c | 2 +- git

[PATCH 2/2] stash: prefer --quiet over shell redirection

2014-08-30 Thread David Aguilar
Use `git rev-parse --quiet` instead of redirecting to /dev/null. Signed-off-by: David Aguilar --- git-stash.sh | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/git-stash.sh b/git-stash.sh index bcc757b..5a5185b 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -50

[PATCH 1/2] bisect: remove unnecessary redirection

2014-08-30 Thread David Aguilar
`git rev-parse` is being called with --quiet so there's no need to redirect to /dev/null. Signed-off-by: David Aguilar --- git-bisect.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-bisect.sh b/git-bisect.sh index 1e0d602..c1c2321 100755 --- a/git-bisect.sh +++ b/git-b

[PATCH] imap-send: simplify v_issue_imap_cmd() and get_cmd_result() using starts_with()

2014-08-30 Thread René Scharfe
Use starts_with() instead of memcmp() to check if NUL-terminated strings match prefixes. This gets rid of some magic string length constants. Signed-off-by: Rene Scharfe --- imap-send.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/imap-send.c b/imap-send.c index

[PATCH] config: simplify git_config_include()

2014-08-30 Thread René Scharfe
Instead of using skip_prefix() to check the first part of the string and then strcmp() to check the rest, simply use strcmp() to check the whole string. Signed-off-by: Rene Scharfe --- config.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/config.c b/config.c index 058

Re: [PATCH 2/2] index-pack: handle duplicate base objects gracefully

2014-08-30 Thread René Scharfe
Am 30.08.2014 um 15:16 schrieb Jeff King: On Fri, Aug 29, 2014 at 07:59:32PM -0700, Shawn Pearce wrote: I agree it is probably a bug on the sending side, but I think last time this came up we decided to try to be liberal in what we accept. c.f. http://thread.gmane.org/gmane.comp.version-contro

[PATCH] http-walker: simplify process_alternates_response() using strbuf

2014-08-30 Thread René Scharfe
Use strbuf to build the new base, which takes care of allocations and the terminating NUL character automatically. Signed-off-by: Rene Scharfe --- http-walker.c | 15 ++- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/http-walker.c b/http-walker.c index dbddfaa..88da54

Re: make install fails because GNU tar needed

2014-08-30 Thread dev
On August 28, 2014 at 11:26 AM Matthieu Moy wrote: > dev writes: > > > Actually I found a file called GIT-BUILD-OPTIONS : > > That's a generated file (not included by the Makefile, but by some > shell > scripts later), don't edit it. Use config.mak for your build > configuration. good to know

Re: problem with def of inet_ntop() in git-compat-util.h as well as other places

2014-08-30 Thread dev
On August 28, 2014 at 8:05 PM "brian m. carlson" wrote: > On Thu, Aug 28, 2014 at 12:54:30AM -0400, dev wrote: > > Funny I don't see libcurl anywhere. Thought that was needed? Also > > the > > RUNPATH > > and RPATH look duplicated and slightly borked but the initial data > > there > > is correct

Re: Auto Packing message twice?

2014-08-30 Thread Duy Nguyen
On Sat, Aug 30, 2014 at 6:28 PM, Stefan Beller wrote: > Auto packing the repository in background for optimum performance. > See "git help gc" for manual housekeeping. > Auto packing the repository in background for optimum performance. > See "git help gc" for manual housekeeping. > > Obviously it

[PATCH 3/2] t5309: mark delta-cycle failover tests as passing

2014-08-30 Thread Jeff King
t5309 checks that we detect and fail when there is a cycle of deltas (i.e., A is a delta on B, which is a delta on A). It also checks the cases where we have such a cycle, but we have an extra copy of the object either in the same pack or in another one. These cases are recoverable, because we can

Re: [PATCH 2/2] index-pack: handle duplicate base objects gracefully

2014-08-30 Thread Jeff King
On Fri, Aug 29, 2014 at 07:59:32PM -0700, Shawn Pearce wrote: > > I agree it is probably a bug on the sending side, but I think last time > > this came up we decided to try to be liberal in what we accept. c.f. > > http://thread.gmane.org/gmane.comp.version-control.git/232305/focus=232310 > > II

Re: [PATCH v2 19/19] signed push: fortify against replay attacks

2014-08-30 Thread Stefan Beller
On 22.08.2014 22:30, Junio C Hamano wrote: > @@ -1226,12 +1232,28 @@ static int delete_only(struct command *commands) > return 1; > } > > +static char *prepare_push_cert_nonce(const char *sitename, const char *dir) > +{ > + struct strbuf buf = STRBUF_INIT; > + unsigned char sha1[20

Auto Packing message twice?

2014-08-30 Thread Stefan Beller
Hi, so I fetched from a repository today and I got the message twice: > Auto packing the repository in background for optimum performance. > See "git help gc" for manual housekeeping. I'm running git version 2.1.0.rc2 Full output: $ git fetch --all --prune Fetching origin Fetching mainline rem

Re: [PATCH 00/32] nd/multiple-work-trees cleanup

2014-08-30 Thread Duy Nguyen
On Sat, Aug 30, 2014 at 6:11 PM, Eric Sunshine wrote: > On Sat, Aug 30, 2014 at 4:33 AM, Nguyễn Thái Ngọc Duy > wrote: >> This collapes some bug fix patches into the main ones, adds a few more >> tests to cover recent changes, and removes advice.checkoutLocked (when >> things are controversal, p

Re: [PATCH 00/32] nd/multiple-work-trees cleanup

2014-08-30 Thread Eric Sunshine
On Sat, Aug 30, 2014 at 4:33 AM, Nguyễn Thái Ngọc Duy wrote: > This collapes some bug fix patches into the main ones, adds a few more > tests to cover recent changes, and removes advice.checkoutLocked (when > things are controversal, probably best to go without them until they > are settled). Diff

[PATCH] pack-write: simplify index_pack_lockfile using skip_prefix() and xstrfmt()

2014-08-30 Thread René Scharfe
Get rid of magic string length constants by using skip_prefix() instead of memcmp() and use xstrfmt() for building a string instead of a PATH_MAX-sized buffer, snprintf() and xstrdup(). Signed-off-by: Rene Scharfe --- pack-write.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-)

[PATCH] connect: simplify check_ref() using skip_prefix() and starts_with()

2014-08-30 Thread René Scharfe
Both callers of check_ref() pass in NUL-terminated strings for name. Remove the len parameter and then use skip_prefix() and starts_with() instead of memcmp() to check if it starts with certain strings. This gets rid of several magic string length constants and a strlen() call. Signed-off-by: Ren

Re: [PATCH 1/2] t0027: Tests for core.eol=native, eol=lf, eol=crlf

2014-08-30 Thread Torsten Bögershausen
On 2014-08-28 21.20, Junio C Hamano wrote: > It appears that I missed this patch? You seem to have rerolled the > corresponding 2/2, to which I responded ($gmane/255507). Is this > one still viable/necessary? It seems that both the t0027 and the native_crlf fixes (from MINGW) deserve a re-roll f

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
From: Dennis Kaarsemaker 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 from a bare reposito

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- 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 9f701a1..aa24ea8 100755 --- a/t/t2025-checkout-to.sh +++ b/t/t2025-checkout-to.sh @@ -96,4 +96,22 @@ test_ex

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

2014-08-30 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 Signed-off-by: Junio C Hamano --- builtin/count-objects.c | 4 +++- cache.h | 1 + path.c

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

2014-08-30 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 " on a

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 54 -- t/t2025-checkout-to.sh | 6 ++ 2 files changed, 58 insertions(+), 2 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index 6373823..4ae925a 100644 --- a/b

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/gc.c b/builtin/gc.c index 8d219d8..3bfb990 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -298,7 +298,7 @@ int cmd_gc(int argc, const ch

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

2014-08-30 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/repos/. 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 rep

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/gc.c | 21 + 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index 3bfb990..e38c902 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -55,6 +55,17 @@ static

[PATCH 25/32] prune: strategies for linked checkouts

2014-08-30 Thread Nguyễn Thái Ngọc Duy
(alias R=$GIT_COMMON_DIR/repos/) - 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 points t

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

2014-08-30 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 Signed-off-by: Junio C Hamano --- builtin/branch.c | 4 +--- builtin/init-db.c | 7 +-- dae

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

2014-08-30 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 --- builtin/checkout.c |

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- cache.h | 2 ++ wrapper.c | 31 +++ 2 files changed, 33 insertions(+) diff --git a/cache.h b/cache.h index e3ff7dc..bf4d15e 100644 --- a/cache.h +++ b/cache.h @@ -1359,6 +1359,8 @@ static inline

[PATCH 28/32] gc: support prune --repos

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- Documentation/config.txt | 7 +++ builtin/gc.c | 11 +++ 2 files changed, 18 insertions(+) diff --git a/Documentation/config.txt b/Documentation/config.txt index 286e539..57999fa 100644 --- a/Document

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- setup.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.c b/setup.c index a17389f..79f79f2 100644 --- a/setup.c +++ b/setup.c @@ -346,6 +346,10 @@ static int check_repository_format_gently(const

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

2014-08-30 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 Signed-off-by: Junio C Hamano --- Documentation/gitrepository-layout.txt | 7 ++ setup.c| 43 +- 2 files ch

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

2014-08-30 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 Signed-off-by: Junio C Hamano --- git-sh-setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- git-stash.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-stash.sh b/git-stash.sh index 393e1ec..41f8f6b 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -184,7 +184,7 @@ store_stash () {

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- setup.c | 12 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/setup.c b/setup.c index 176d505..a17389f 100644 --- a/setup.c +++ b/setup.c @@ -342,7 +342,9 @@ void setup_work_tree(void) static int

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- setup.c | 37 + 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/setup.c b/setup.c index 0a22f8b..425fd79 100644 --- a/setup.c +++ b/setup.c @@ -238,31 +238,36 @@ void verify_

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

2014-08-30 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 Signed-off-by: Junio C Hamano --- git-am.sh | 22 +++--- git-rebase--interactive.sh

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

2014-08-30 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 r

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

2014-08-30 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 i

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

2014-08-30 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 Signed-off-by: Junio C Hamano --- fast-import.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fast-import.c b/fast-import.c index d9c068b..ea426c4 100644

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- 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 18a394f..6ab0c31 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -240,7 +240,7 @@ test true

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

2014-08-30 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 get

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

2014-08-30 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 buf

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

2014-08-30 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. U

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

2014-08-30 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 fi

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/commit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/commit.c b/builtin/commit.c index 461c3b1..4b9f012 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -156,7 +156,7 @@ static vo

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- path.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/path.c b/path.c index 2cb2e61..65881aa 100644 --- a/path.c +++ b/path.c @@ -78,6 +78,16 @@ void strbuf_git_path(struct strbuf *s

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

2014-08-30 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 Signed-off-by: Junio C Hamano

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

2014-08-30 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 git_path

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

2014-08-30 Thread Nguyễn Thái Ngọc Duy
This collapes some bug fix patches into the main ones, adds a few more tests to cover recent changes, and removes advice.checkoutLocked (when things are controversal, probably best to go without them until they are settled). Diff against current version in 'pu' diff --git a/Documentation/config.tx