Re: [PATCH v2 00/21] Support multiple worktrees

2013-12-14 Thread Duy Nguyen
On Sat, Dec 14, 2013 at 5:54 PM, Nguyễn Thái Ngọc Duy wrote: > Known issues Scripts that expand "$GIT_DIR/objects" and are not aware about the new env variable. I introduced "test-path-utils --git-path" to test git_path(). I could move it to "git rev-parse --git-path" for use in scripts, but ther

Re: [PATCH v2 02/21] path.c: rename vsnpath() to git_vsnpath()

2013-12-14 Thread Duy Nguyen
On Sun, Dec 15, 2013 at 3:23 AM, Ramsay Jones wrote: > On 14/12/13 10:54, Nguyễn Thái Ngọc Duy wrote: >> This is the underlying implementation of git_path(), git_pathdup() and >> git_snpath() which will prefix $GIT_DIR in the result string. Put git_ >> prefix in front of it to avoid the confusion

Re: [PATCH v2] t9605: test for cvsps commit ordering bug

2013-12-14 Thread Eric S. Raymond
Replying to very old but newly relevant mail: Chris Rorvick : > Import of a trivial CVS repository fails due to a cvsps bug. The t9605 test you sent me is now part of cvs-fast-export's regression-test suite, along with suitably adapted versions of t960[1-4] from the git tree. Here is a summary

[PATCH v3 2/3] diff: Let "git diff -O" read orderfile from any file, failing when appropriate

2013-12-14 Thread Samuel Bronson
The -O flag really shouldn't silently fail to do anything when given a path that it can't read from. However, it should be able to read from un-mappable files, such as pipes/fifos, /dev/null (as we document in the next patch), or in fact *any* empty file (since Linux 2.6.12). (Especially since we

[RFC v3 3/3] diff: Add diff.orderfile configuration variable

2013-12-14 Thread Samuel Bronson
diff.orderfile acts as a default for the -O command line option. [sb: split up aw's original patch; reworked tests and docs] [FIXME: Relative paths should presumably be interpreted relative to repository root; how should this be accomplished?] Signed-off-by: Anders Waldenborg Signed-off-by: Sam

[PATCH v3 0/3] diff: Add diff.orderfile configuration variable

2013-12-14 Thread Samuel Bronson
The original purpose of this patch [series] was to allow specifying the "-O" option for "git diff" in the config, but I need help with the relative path handling [RFC 3]. It also added tests for "git diff -O", which I have split out because they are independantly useful [PATCH 1]. I also noticed

[PATCH v3 1/3] diff: Tests for "git diff -O"

2013-12-14 Thread Samuel Bronson
Heavily adapted from Anders' patch: "diff: Add diff.orderfile configuration variable" Signed-off-by: Anders Waldenborg Signed-off-by: Samuel Bronson --- t/t4056-diff-order.sh | 72 +++ 1 file changed, 72 insertions(+) create mode 100755 t/t4056-d

Re: [PATCH v2 02/21] path.c: rename vsnpath() to git_vsnpath()

2013-12-14 Thread Ramsay Jones
On 14/12/13 10:54, Nguyễn Thái Ngọc Duy wrote: > This is the underlying implementation of git_path(), git_pathdup() and > git_snpath() which will prefix $GIT_DIR in the result string. Put git_ > prefix in front of it to avoid the confusion that this is a generic > path handling function.# > > Sign

Re: Unexpected cherry-pick behaviour

2013-12-14 Thread Antoine Pelisse
On Sat, Dec 14, 2013 at 8:33 PM, Junio C Hamano wrote: > Antoine Pelisse writes: > >> If you only want to see the diff applied to master, you >> should run: >> >> $ git diff --ours > > Does "git diff HEAD" have the same/similar effect? Yes, it does produce the same output as --ours. >> You

Re: [PATCH/POC 2/7] Add new environment variable $GIT_SUPER_DIR

2013-12-14 Thread Junio C Hamano
Duy Nguyen writes: > The exception list could be equally long (most of them are *_HEAD). > .git is also used for temporary files with mkstemp, but I think that's > safe for sharing. What could break is when people add a new local > *_HEAD and forget to update the exception list. Sensible; it may

Re: Unexpected cherry-pick behaviour

2013-12-14 Thread Junio C Hamano
"Philip Oakley" writes: > Would this be a good use of the >* Magic pathspecs like ":(icase) > that was recently released (v1.8.5 2Dec13) so that the merge stages > can be named. Because the pathspec mechahism is for you to tell an operation that works on a collection of paths (e.g. "all th

Re: Unexpected cherry-pick behaviour

2013-12-14 Thread Junio C Hamano
Antoine Pelisse writes: > If you only want to see the diff applied to master, you > should run: > > $ git diff --ours Does "git diff HEAD" have the same/similar effect? > You can also have a look at what is currently being applied: > > $ git diff :1:gcc/tree-ssa-threadedge.c :3:gcc/tree

Re: Looking for pre-commit hook to check whitespace errors but not for all files

2013-12-14 Thread John Keeping
On Sat, Dec 14, 2013 at 04:28:14PM +0100, Paul Menzel wrote: > in coreboot we try to check for whitespace errors before committing. Of > course a pre-commit hook is the way to go, but unfortunately it is not > so simple (at least for me) as the following requirements exist. > > 1. Only the files a

Looking for pre-commit hook to check whitespace errors but not for all files

2013-12-14 Thread Paul Menzel
Dear git folks, in coreboot we try to check for whitespace errors before committing. Of course a pre-commit hook is the way to go, but unfortunately it is not so simple (at least for me) as the following requirements exist. 1. Only the files actually committed should be checked. That means runni

Re: Subtree: My Status

2013-12-14 Thread Adam Spiers
On Thu, Dec 12, 2013 at 11:26:36AM -0800, Junio C Hamano wrote: > Adam Spiers writes: > > On Mon, Apr 22, 2013 at 09:18:46AM +0200, Jeremy Rosen wrote: > >> David Green wrote: > >> > Please remember that I don't consider myself a gatekeeper to > >> > git subtree. In fact I could use some help rev

Re: Unexpected cherry-pick behaviour

2013-12-14 Thread Philip Oakley
- Original Message - From: "Antoine Pelisse" You can also have a look at what is currently being applied: $ git diff :1:gcc/tree-ssa-threadedge.c :3:gcc/tree-ssa-threadedge.c By the way, does anybody know a better way to do that ? I happen to do that quite a lot when fixing c

[PATCH v5 1/2] diff: move no-index detection to builtin/diff.c

2013-12-14 Thread Thomas Gummerer
Currently the --no-index option is parsed in diff_no_index(). Move the detection if a no-index diff should be executed to builtin/diff.c, where we can use it for executing diff_no_index() conditionally. This will also allow us to execute other operations conditionally, which will be done in the n

[PATCH v5 2/2] diff: don't read index when --no-index is given

2013-12-14 Thread Thomas Gummerer
git diff --no-index ... currently reads the index, during setup, when calling gitmodules_config(). This results in worse performance when the index is not actually needed. This patch avoids calling gitmodules_config() when the --no-index option is given. The times for executing "git diff --no-in

[PATCH] Prevent buffer overflows when path is too long

2013-12-14 Thread Antoine Pelisse
Some buffers created with PATH_MAX length are not checked when being written, and can overflow if PATH_MAX is not big enough to hold the path. Replace those buffers by strbufs so that their size is automatically grown if necessary. They are created as static local variables to avoid reallocating m

[PATCH v3] contrib/git-credential-gnome-keyring.c: small stylistic cleanups

2013-12-14 Thread John Szakmeister
Signed-off-by: John Szakmeister Signed-off-by: Junio C Hamano Reviewed-by: Felipe Contreras --- Thanks for the extra patch Junio. I incorporated it and fixed a few other minor violations I found afterwards. This version builds on the first version of the patch--without dropping the gpointer c

[PATCH v2 21/21] revision: include repos/../HEAD in --all

2013-12-14 Thread Nguyễn Thái Ngọc Duy
This makes sure repack won't drop detached HEADS from $GIT_DIR/repos/ Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 21 + refs.h | 1 + revision.c | 1 + 3 files changed, 23 insertions(+) diff --git a/refs.c b/refs.c index 8ef1cb0..a9c8651 100644 --- a/refs.c ++

[PATCH v2 20/21] refs.c: refactor do_head_ref(... to do_one_head_ref("HEAD", ...

2013-12-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/refs.c b/refs.c index d856b1a..8ef1cb0 100644 --- a/refs.c +++ b/refs.c @@ -1721,32 +1721,33 @@ static int do_for_each_ref(struct ref_cache *refs, const char *base,

[PATCH v2 19/21] refs: detach split repos' HEAD when the linked ref is updated/deleted

2013-12-14 Thread Nguyễn Thái Ngọc Duy
This is effective when a ref is updated from the super repository as well as all linked repositories because "repos" directory is shared between all repos. We could even forbid a ref update if it's some repo's HEAD. But I'd rather see a generic, permanent ref locking mechanism in place first and m

[PATCH v2 18/21] refs: adjust reflog path for repos//HEAD

2013-12-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- refs.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index 5e5a382..3691ef5 100644 --- a/refs.c +++ b/refs.c @@ -2676,13 +2676,24 @@ static int copy_msg(char *buf, const char *msg) int log_ref_setup(co

[PATCH v2 15/21] checkout: clean up half-prepared directories in --to mode

2013-12-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- builtin/checkout.c | 49 +++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/builtin/checkout.c b/builtin/checkout.c index 95a1a61..6353557 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c

[PATCH v2 12/21] environment.c: support super .git file specified by $GIT_DIR

2013-12-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- environment.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/environment.c b/environment.c index d5ae7a3..cbfa879 100644 --- a/environment.c +++ b/environment.c @@ -125,13 +125,17 @@ static char *expand_namespace(const char *raw

[PATCH v2 11/21] setup.c: reduce cleanup sites in setup_explicit_git_dir()

2013-12-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- setup.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/setup.c b/setup.c index 01fe89a..397eecc 100644 --- a/setup.c +++ b/setup.c @@ -406,16 +406,13 @@ static const char *setup_explicit_git_dir(const char *gitdir

[PATCH v2 17/21] prune: strategies for split repositories

2013-12-14 Thread Nguyễn Thái Ngọc Duy
alias REPO=$GIT_SUPER_DIR/repos/ - split repos are supposed to update mtime of $REPO/gitdir - split repos are supposed to keep its location in $REPO/gitdir up to date - "git checkout --to" is supposed to create $REPO/locked if the new repo is on a different partition than the shared one

[PATCH v2 16/21] setup.c: keep track of the .git file location if read

2013-12-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 2 +- environment.c | 2 +- setup.c | 44 ++-- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/cache.h b/cache.h index 4c09223..e036a7d 100644 --- a/cache.h +++ b/cache.h @@ -4

[PATCH v2 13/21] setup: support $GIT_SUPER_DIR as well as super .git files

2013-12-14 Thread Nguyễn Thái Ngọc Duy
The same rules for git repo setup apply except: - detect super .git files, set $GIT_SUPER_DIR accordingly - if $GIT_SUPER_DIR is set (or specified by super .git files), look for non-worktree stuff in this directory instead of $GIT_DIR. This mostly affects is_git_directory() and check_reposito

[PATCH v2 14/21] checkout: support checking out into a new working directory

2013-12-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- Documentation/git-checkout.txt | 6 +++ Documentation/gitrepository-layout.txt | 3 +- builtin/checkout.c | 94 ++ path.c | 3 +- 4 files changed, 104 insertions(

[PATCH v2 10/21] setup.c: add split-repo support to is_git_directory()

2013-12-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- setup.c | 28 ++-- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/setup.c b/setup.c index e9f0ef6..01fe89a 100644 --- a/setup.c +++ b/setup.c @@ -182,28 +182,38 @@ void verify_non_filename(const char *prefix, const ch

[PATCH v2 09/21] setup.c: add split-repo support to .git files

2013-12-14 Thread Nguyễn Thái Ngọc Duy
If a .git file contains gitsuper: gitdir: then we set GIT_SUPER_DIR to and GIT_DIR to $GIT_SUPER_DIR/repos/. Signed-off-by: Nguyễn Thái Ngọc Duy --- cache.h | 1 + setup.c | 41 + 2 files changed, 38 insertions(+), 4 deletions(-) diff --git a/cache.

[PATCH v2 08/21] setup.c: refactor path manipulation out of read_gitfile()

2013-12-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- setup.c | 44 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/setup.c b/setup.c index 5432a31..c040981 100644 --- a/setup.c +++ b/setup.c @@ -278,15 +278,31 @@ static int check_repository_format_g

[PATCH v2 00/21] Support multiple worktrees

2013-12-14 Thread Nguyễn Thái Ngọc Duy
The UI and behavior are taking shape now. On the UI side, you do git checkout --to /somewhere -b newbranch origin/master which will create worktree-only repo at /somewhere. "git prune --repos" could be used to remove cruft in .git/repos. On the behavior side, you should be able to do everythin

[PATCH v2 03/21] path.c: move git_path() closer to similar functions git_pathdup()

2013-12-14 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/path.c b/path.c index 06863b7..08aa213 100644 --- a/path.c +++ b/path.c @@ -80,6 +80,19 @@ char *git_snpath(char *buf, size_t n, const char *fmt, ...)

[PATCH v2 04/21] Make git_path() aware of file relocation in $GIT_DIR

2013-12-14 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. All 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 v2 07/21] Add new environment variable $GIT_SUPER_DIR

2013-12-14 Thread Nguyễn Thái Ngọc Duy
If $GIT_SUPER_DIR is defined, the repository is splitted into two places: - HEAD, logs/HEAD, index, other top-level refs and unrecognized files are from $GIT_DIR - the rest like objects, refs, info, hooks, packed-refs, shallow... are from $GIT_SUPER_DIR The redirection is done by git_pat

[PATCH v2 02/21] path.c: rename vsnpath() to git_vsnpath()

2013-12-14 Thread Nguyễn Thái Ngọc Duy
This is the underlying implementation of git_path(), git_pathdup() and git_snpath() which will prefix $GIT_DIR in the result string. Put git_ prefix in front of it to avoid the confusion that this is a generic path handling function.# Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 8

[PATCH v2 01/21] path.c: avoid PATH_MAX as buffer size from get_pathname()

2013-12-14 Thread Nguyễn Thái Ngọc Duy
We've been avoiding PATH_MAX whenever possible. This patch avoids PATH_MAX in get_pathname() and gives it enough room not to worry about really long paths. Signed-off-by: Nguyễn Thái Ngọc Duy --- path.c | 28 1 file changed, 16 insertions(+), 12 deletions(-) diff --

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

2013-12-14 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 --- fast-import.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fast-import.c b/fast-import.c index f4d9969..04bba3d 100644 --- a/fast-import.c +++ b/fast-

[PATCH v2 05/21] reflog: use avoid constructing .lock path with git_path

2013-12-14 Thread Nguyễn Thái Ngọc Duy
git_path() understands the path given to it. Unrecognized paths by default go to $GIT_SUPER_DIR/repos//... in split-repo mode. We want the %s.lock file to be at the same place %s file is. Avoid git_path() in this case and use log_file as %s, which should contain the final path of %s file. Signed-o

Re: [PATCH v4 1/2] diff: move no-index detection to builtin/diff.c

2013-12-14 Thread Thomas Gummerer
Jonathan Nieder writes: > Hi, > > Thomas Gummerer wrote: > >> Signed-off-by: Thomas Gummerer > > Thanks, and sorry for the slow follow-up. > > [...] >> --- a/builtin/diff.c >> +++ b/builtin/diff.c >> @@ -16,6 +16,9 @@ > [...] >> @@ -283,14 +286,57 @@ int cmd_diff(int argc, const char **argv, con

Re: Unexpected cherry-pick behaviour

2013-12-14 Thread Antoine Pelisse
On Wed, Dec 11, 2013 at 12:19 PM, Paulo Matos wrote: > On 11/12/2013 11:09, Antoine Pelisse wrote: >>> >>> >>> I don't know how to interpret the fact that the line you sent (with the >>> obvious --conflicts being --conflict) outputs nothing... >> >> >> That is expected. git-checkout with this opti