Re: [PATCH v4 19/32] commit_lock_file(): rollback lock file on failure to rename

2014-09-10 Thread Jeff King
On Sat, Sep 06, 2014 at 09:50:33AM +0200, Michael Haggerty wrote: If rename() fails, call rollback_lock_file() to delete the lock file (in case it is still present) and reset the filename field to the empty string so that the lockfile object is left in a valid state. Unlike the previous

Re: [PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-10 Thread Jeff King
On Sat, Sep 06, 2014 at 09:50:14AM +0200, Michael Haggerty wrote: Sorry for the long delay since v3. This version mostly cleans up a couple more places where the lockfile object was left in an ill-defined state. Thanks to Johannes Sixt and Torsten Bögershausen for their review of v3. I

[PATCH] refs: write packed_refs file using stdio

2014-09-10 Thread Jeff King
We write each line of a new packed-refs file individually using a write() syscall (and sometimes 2, if the ref is peeled). Since each line is only about 50-100 bytes long, this creates a lot of system call overhead. We can instead open a stdio handle around our descriptor and use fprintf to write

[PATCH] refs: speed up is_refname_available

2014-09-10 Thread Jeff King
Our filesystem ref storage does not allow D/F conflicts; so if refs/heads/a/b exists, we do not allow refs/heads/a to exist (and vice versa). This falls out naturally for loose refs, where the filesystem enforces the condition. But for packed-refs, we have to make the check ourselves. We do so by

Re: [PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-10 Thread Duy Nguyen
On Wed, Sep 10, 2014 at 3:13 PM, Jeff King p...@peff.net wrote: I was running pack-refs on a repository with a very large number of loose refs (about 1.8 million). Needless to say, this ran very slowly and thrashed the disk, as that's almost 7G using 4K inodes. But it did eventually generate a

Re: [PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-10 Thread Jeff King
On Wed, Sep 10, 2014 at 05:25:36PM +0700, Duy Nguyen wrote: On Wed, Sep 10, 2014 at 3:13 PM, Jeff King p...@peff.net wrote: I was running pack-refs on a repository with a very large number of loose refs (about 1.8 million). Needless to say, this ran very slowly and thrashed the disk, as

[PATCH v2] refs: speed up is_refname_available

2014-09-10 Thread Jeff King
Our filesystem ref storage does not allow D/F conflicts; so if refs/heads/a/b exists, we do not allow refs/heads/a to exist (and vice versa). This falls out naturally for loose refs, where the filesystem enforces the condition. But for packed-refs, we have to make the check ourselves. We do so by

Re: [PATCH] refs: write packed_refs file using stdio

2014-09-10 Thread Michael Haggerty
On 09/10/2014 12:03 PM, Jeff King wrote: We write each line of a new packed-refs file individually using a write() syscall (and sometimes 2, if the ref is peeled). Since each line is only about 50-100 bytes long, this creates a lot of system call overhead. We can instead open a stdio handle

Re: [PATCH] refs: write packed_refs file using stdio

2014-09-10 Thread Jeff King
On Wed, Sep 10, 2014 at 01:21:27PM +0200, Michael Haggerty wrote: + if (fclose(out)) + die_errno(write error); + packed_ref_cache-lock-fd = -1; It might be a minuscule bit safer to set `lock-fd = -1` *before* calling `fclose()`. Yeah, I considered that. The worst case is

Re: [PATCH v4 19/32] commit_lock_file(): rollback lock file on failure to rename

2014-09-10 Thread Duy Nguyen
On Wed, Sep 10, 2014 at 2:55 PM, Jeff King p...@peff.net wrote: BTW, while grepping for commit_lock_file calls, I notice we often commit the shallow file without checking the return code. I'm not sure what we should do in each case, but I imagine that calling die() is probably better than

git-remote-fd problem

2014-09-10 Thread Jiri Sevcik
Hi! I have problem with using git-remote-fd function. I create two local pipes for communication for locally running process git pull. Then I start git-upload-pack on remote side (this process is started in different part of my code and it works correctly). Communication runs successfully and

Re: git 2.1.0: make fails

2014-09-10 Thread Gerry Reno
On 09/09/2014 06:42 PM, Jeff King wrote: On Tue, Sep 09, 2014 at 04:34:02PM -0400, Gerry Reno wrote: Downloaded the git-2.1.0.tar.gz tarball. Cannot build git 2.1.0: Weird. It works fine for me on Debian unstable. What platform are you on? cc -g -O2 -Wall -I. -DHAVE_ALLOCA_H

[PATCH v2 2/6] Accept object data in the fsck_object() function

2014-09-10 Thread Johannes Schindelin
When fsck'ing an incoming pack, we need to fsck objects that cannot be read via read_sha1_file() because they are not local yet (and might even be rejected if transfer.fsckobjects is set to 'true'). For commits, there is a hack in place: we basically cache commit objects' buffers anyway, but the

[PATCH v2 1/6] Refactor type_from_string() to avoid die()ing in case of errors

2014-09-10 Thread Johannes Schindelin
In the next commits, we will enhance the fsck_tag() function to check tag objects more thoroughly. To this end, we need a function to verify that a given string is a valid object type, but that does not die() in the negative case. While at it, prepare type_from_string() for counted strings, i.e.

[PATCH v2 0/6] Improve tag checking in fsck and with transfer.fsckobjects

2014-09-10 Thread Johannes Schindelin
This patch series introduces detailed checking of tag objects when calling git fsck, and also when transfer.fsckobjects is set to true. To this end, the fsck machinery is reworked to accept the buffer and size of the object to check, and for commit and tag objects, we verify that the buffers

[PATCH v2 4/6] fsck: check tag objects' headers

2014-09-10 Thread Johannes Schindelin
We inspect commit objects pretty much in detail in git-fsck, but we just glanced over the tag objects. Let's be stricter. Since we do not want to limit 'tag' lines unduly, values that would fail the refname check only result in warnings, not errors. Signed-off-by: Johannes Schindelin

[PATCH v2 3/6] Make sure fsck_commit_buffer() does not run out of the buffer

2014-09-10 Thread Johannes Schindelin
So far, we assumed that the buffer is NUL terminated, but this is not a safe assumption, now that we opened the fsck_object() API to pass a buffer directly. So let's make sure that there is at least an empty line in the buffer. That way, our checks would fail if the empty line was encountered

[PATCH v2 6/6] Make sure that index-pack --strict fails upon invalid tag objects

2014-09-10 Thread Johannes Schindelin
One of the most important use cases for the strict tag object checking is when transfer.fsckobjects is set to true to catch invalid objects early on. This new regression test essentially tests the same code path by directly calling 'index-pack --strict' on a pack containing an invalid tag object.

[PATCH v2 5/6] Add regression tests for stricter tag fsck'ing

2014-09-10 Thread Johannes Schindelin
The intent of the two new test cases is to catch general breakages in the fsck_tag() function, not so much to test it extensively, trying to strike the proper balance between thoroughness and speed. Signed-off-by: Johannes Schindelin johannes.schinde...@gmx.de --- t/t1450-fsck.sh | 39

[PATCH] git-notes.txt: Explain how to transfer notes between repos

2014-09-10 Thread Øyvind A . Holm
The documentation for git notes did not mention anywhere how to transfer notes between repositories, create a section that explains this topic. Signed-off-by: Øyvind A. Holm su...@sunbase.org --- Documentation/git-notes.txt | 39 +++ 1 file changed, 39

Re: [PATCH v2 0/6] Improve tag checking in fsck and with transfer.fsckobjects

2014-09-10 Thread Johannes Schindelin
Hi Junio, On Wed, 10 Sep 2014, Johannes Schindelin wrote: Still unaddressed: - getting rid of struct object altogether in fsck (I felt this was quite a big task, getting much more familiar with the non-tag code paths, and I did not want to delay this patch series up any further) -

Re: [PATCH/RFC 0/2] custom format for interactive rebase todo

2014-09-10 Thread William Clifford
Thanks! I've set it up just this way and it seems to work fine. It turns out the formatted string is processed by the shell `read` later on, which happens to ignore everything after the first line, so it seems like it should be safe. But doing something explicit about it seems like a good idea in

Re: git-remote-fd problem

2014-09-10 Thread Ilari Liusvaara
On Wed, Sep 10, 2014 at 03:29:00PM +0200, Jiri Sevcik wrote: Hi! I have problem with using git-remote-fd function. I create two local pipes for communication for locally running process git pull. Then I start git-upload-pack on remote side (this process is started in different part of my code

Re: [PATCH 8/9] autoconf: Check for timer_settime

2014-09-10 Thread Karsten Blees
Am 29.08.2014 19:40, schrieb Keller, Jacob E: On Fri, 2014-08-29 at 19:26 +0200, Johannes Sixt wrote: Am 29.08.2014 18:42, schrieb Jacob Keller: From: Jonas 'Sortie' Termansen sor...@maxsi.org This function will be used in a following commit. The timer_settime function is provided in librt

Re: What's cooking in git.git (Sep 2014, #02; Tue, 9)

2014-09-10 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Tue, Sep 09, 2014 at 02:26:22PM -0700, Junio C Hamano wrote: * jk/command-line-config-empty-string (2014-08-05) 1 commit (merged to 'next' on 2014-08-29 at 74f04af) + config: teach git -c to recognize an empty string git -c section.var command and

Re: [PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-10 Thread Junio C Hamano
Jeff King p...@peff.net writes: Yes, we don't let normal fetchers see these repos. They're only for holding shared objects and the ref tips to keep them reachable. Are these individual refs have relations to the real world after they are created? To ask it another way, let's say that a branch

Re: [RFC PATCH v2 1/2] Makefile: add check-headers target

2014-09-10 Thread Junio C Hamano
David Aguilar dav...@gmail.com writes: On Mon, Sep 08, 2014 at 12:57:46PM -0700, Junio C Hamano wrote: Matthieu Moy matthieu@grenoble-inp.fr writes: ... for header in .h ewah/*.h vcs-svn/*.h xdiff/*.h do ... done Yes, that would be even better. Then you wouldn't even have to

Re: [PATCH/RFC 0/2] custom format for interactive rebase todo

2014-09-10 Thread Junio C Hamano
William Clifford mr.william.cliff...@gmail.com writes: I will see about actually reading in additional lines and raising an error, but it occurs to me that if I can read in the additional lines, I could also insert them as comments, and then it should be as safe as any of the other comments

Re: [PATCH] pretty-format: add append line-feed format specifier

2014-09-10 Thread Junio C Hamano
Jeff King p...@peff.net writes: Something like the patch below might work, but I didn't test it very thoroughly (and note the comments, which might need dealing with). Maybe it would make a sensible base for Harry to build on if he wants to pursue this. With it, you can do: git log

Re: [RFC PATCH v2 1/2] Makefile: add check-headers target

2014-09-10 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com writes: David Aguilar dav...@gmail.com writes: On Mon, Sep 08, 2014 at 12:57:46PM -0700, Junio C Hamano wrote: Matthieu Moy matthieu@grenoble-inp.fr writes: ... for header in .h ewah/*.h vcs-svn/*.h xdiff/*.h do ... done Yes, that would be

Re: [PATCH v2 3/6] Make sure fsck_commit_buffer() does not run out of the buffer

2014-09-10 Thread Junio C Hamano
Johannes Schindelin johannes.schinde...@gmx.de writes: So far, we assumed that the buffer is NUL terminated, but this is not a safe assumption, now that we opened the fsck_object() API to pass a buffer directly. So let's make sure that there is at least an empty line in the buffer. That

Re: [PATCH v2 4/6] fsck: check tag objects' headers

2014-09-10 Thread Junio C Hamano
Johannes Schindelin johannes.schinde...@gmx.de writes: + if (!skip_prefix(buffer, tag , buffer)) { + ret = error_func(tag-object, FSCK_ERROR, invalid format - expected 'tag' line); + goto done; + } + eol = strchr(buffer, '\n'); + if (!eol) { +

Re: [PATCH v2 5/6] Add regression tests for stricter tag fsck'ing

2014-09-10 Thread Junio C Hamano
Johannes Schindelin johannes.schinde...@gmx.de writes: + test_when_finished git update-ref -d refs/tags/wrong + git fsck --tags 2out I wonder what the command does with or without --tags option (applies to both tests added by this patch)? Does running fsck without the option not to

Re: [PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-10 Thread Jeff King
On Wed, Sep 10, 2014 at 09:51:03AM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: Yes, we don't let normal fetchers see these repos. They're only for holding shared objects and the ref tips to keep them reachable. Are these individual refs have relations to the real world

Re: [PATCH] refs: write packed_refs file using stdio

2014-09-10 Thread Jeff King
On Wed, Sep 10, 2014 at 07:32:17AM -0700, Ronnie Sahlberg wrote: Even better could be to build an iovec for all the data and use writev() ? (now without gmail adding formatting) I'm not sure that would make anything easier. We're literally sprintf-ing (and calling sha1_to_hex) into a buffer so

Re: [PATCH] git-notes.txt: Explain how to transfer notes between repos

2014-09-10 Thread Eric Sunshine
On Wed, Sep 10, 2014 at 9:56 AM, Øyvind A. Holm su...@sunbase.org wrote: The documentation for git notes did not mention anywhere how to transfer notes between repositories, create a section that explains this topic. Signed-off-by: Øyvind A. Holm su...@sunbase.org --- diff --git

Re: Next Git conference or meeting

2014-09-10 Thread Jeff King
On Tue, Sep 09, 2014 at 05:49:06PM +0200, Christian Couder wrote: Christian mentioned that he talked to some GitHub folks at LinuxCon. Those folks have also started thinking about things. :) Things are still very tentative at this point, but I think they are considering something like

Re: [PATCH v2 3/6] Make sure fsck_commit_buffer() does not run out of the buffer

2014-09-10 Thread Eric Sunshine
On Wed, Sep 10, 2014 at 9:52 AM, Johannes Schindelin johannes.schinde...@gmx.de wrote: So far, we assumed that the buffer is NUL terminated, but this is not a safe assumption, now that we opened the fsck_object() API to pass a buffer directly. So let's make sure that there is at least an

Re: Next Git conference or meeting

2014-09-10 Thread Christian Couder
On Wed, Sep 10, 2014 at 10:14 PM, Jeff King p...@peff.net wrote: On Tue, Sep 09, 2014 at 05:49:06PM +0200, Christian Couder wrote: Could you ask if they talked to Linux Foundation folks? I've just asked; I'll let you know if I hear. Thanks. I've seen LF folks mentioned a few times in this

Re: [PATCH v2 0/6] Improve tag checking in fsck and with transfer.fsckobjects

2014-09-10 Thread Junio C Hamano
Johannes Schindelin johannes.schinde...@gmx.de writes: This patch series introduces detailed checking of tag objects when calling git fsck, and also when transfer.fsckobjects is set to true. To this end, the fsck machinery is reworked to accept the buffer and size of the object to check, and

Re: [PATCH 8/9] autoconf: Check for timer_settime

2014-09-10 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes: While the timer extension (timer_settime) has graduated to mandatory in the current POSIX spec, the monotonic clock extension is still optional today (i.e. not necessarily supported even on newer Unices). In contrast to this, the XSI extensions

Re: [PATCH 8/9] autoconf: Check for timer_settime

2014-09-10 Thread Keller, Jacob E
On Wed, 2014-09-10 at 14:08 -0700, Junio C Hamano wrote: Karsten Blees karsten.bl...@gmail.com writes: While the timer extension (timer_settime) has graduated to mandatory in the current POSIX spec, the monotonic clock extension is still optional today (i.e. not necessarily supported even

Re: [PATCH v2 0/6] Improve tag checking in fsck and with transfer.fsckobjects

2014-09-10 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Johannes Schindelin johannes.schinde...@gmx.de writes: This patch series introduces detailed checking of tag objects when calling git fsck, and also when transfer.fsckobjects is set to true. To this end, the fsck machinery is reworked to accept the

Re: [PATCH v2 6/6] Make sure that index-pack --strict fails upon invalid tag objects

2014-09-10 Thread Junio C Hamano
Johannes Schindelin johannes.schinde...@gmx.de writes: +test_expect_success 'index-pack --strict fails upon invalid tag' ' +sha=$(git rev-parse HEAD) +cat wrong-tag EOF +object $sha +type commit +tag guten tag + +This is an invalid tag. +EOF Missing tagger is merely a warning

[PATCH 1/2] log-tree: make format_decorations more flexible

2014-09-10 Thread Harry Jeffery
The prefix, separator and suffix for decorations are hard-coded. Make format_decorations more flexible by having the caller specify the prefix, separator and suffix. Signed-off-by: Harry Jeffery ha...@exec64.co.uk --- log-tree.c | 16 +--- log-tree.h | 2 +- pretty.c | 2 +- 3

[PATCH 2/2] pretty: add %D format specifier

2014-09-10 Thread Harry Jeffery
%d prints decorations wrapped by ( and ). %D provides the same output without the parenthesis, making (%D) and %d equivalent to one another. Signed-off-by: Harry Jeffery ha...@exec64.co.uk --- Documentation/pretty-formats.txt | 6 -- pretty.c | 4 2 files

Loan

2014-09-10 Thread Atlas Finance Loan
Do you need a loan or any financial assistance? Kindly get back to us now at: atlasfinanciall...@live.com or 0810604088 for more info -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at

Re: [PATCH v2] refs: speed up is_refname_available

2014-09-10 Thread Junio C Hamano
Jeff King p...@peff.net writes: ... Reviewed-by: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Jeff King p...@peff.net --- Sorry for the quick v2; Michael and I crossed emails off-list, and I missed some of his review. This version has some minor style and comment fixups. Looks

Re: [PATCH v2] refs: speed up is_refname_available

2014-09-10 Thread Junio C Hamano
Jeff King p...@peff.net writes: ... Reviewed-by: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Jeff King p...@peff.net --- Sorry for the quick v2; Michael and I crossed emails off-list, and I missed some of his review. This version has some minor style and comment fixups. Looks

Re: [PATCH v2 2/2] wincred: improve compatibility with windows versions

2014-09-10 Thread Erik Faye-Lund
On Thu, Jan 10, 2013 at 1:10 PM, Karsten Blees karsten.bl...@gmail.com wrote: static int match_cred(const CREDENTIALW *cred) { - return (!wusername || !wcscmp(wusername, cred-UserName)) - match_attr(cred, Lgit_protocol, protocol) - match_attr(cred, Lgit_host,

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

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Changes since last send (diff below): - rename $GIT_DIR/repos to $GIT_DIR/worktrees. update documents and command options accordingly - rewrite the multiple checkout section in git-checkout.txt - reorder some patches to make sure the test suite always pass diff --git

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

2014-09-10 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 v2 03/32] git_snpath(): retire and replace with strbuf_git_path()

2014-09-10 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 v2 05/32] path.c: group git_path(), git_pathdup() and strbuf_git_path() together

2014-09-10 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 2cb2e61..65881aa 100644 --- a/path.c +++ b/path.c @@ -78,6 +78,16 @@

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

2014-09-10 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 v2 04/32] path.c: rename vsnpath() to do_git_path()

2014-09-10 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 v2 11/32] $GIT_COMMON_DIR: a new environment variable

2014-09-10 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 v2 14/32] git-stash: avoid hardcoding $GIT_DIR/logs/....

2014-09-10 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 393e1ec..41f8f6b 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -184,7

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

2014-09-10 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 v2 08/32] reflog: avoid constructing .lock path with git_path

2014-09-10 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 v2 09/32] fast-import: use git_path() for accessing .git dir instead of get_git_dir()

2014-09-10 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 v2 07/32] *.sh: respect $GIT_INDEX_FILE

2014-09-10 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 18a394f..6ab0c31 100755 --- a/git-pull.sh +++

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

2014-09-10 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 0a22f8b..425fd79 100644 --- a/setup.c +++ b/setup.c

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

2014-09-10 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 461c3b1..4b9f012 100644 --- a/builtin/commit.c +++

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

2014-09-10 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 v2 12/32] git-sh-setup.sh: use rev-parse --git-path to get $GIT_DIR/objects

2014-09-10 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 v2 16/32] setup.c: detect $GIT_COMMON_DIR in is_git_directory()

2014-09-10 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 v2 21/32] use new wrapper write_file() for simple file writing

2014-09-10 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 v2 22/32] checkout: support checking out into a new working directory

2014-09-10 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 v2 17/32] setup.c: convert check_repository_format_gently to use strbuf

2014-09-10 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 176d505..a17389f 100644 --- a/setup.c +++ b/setup.c @@ -342,7 +342,9 @@ void

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

2014-09-10 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 v2 20/32] wrapper.c: wrapper to open a file, fprintf then close

2014-09-10 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 e3ff7dc..bf4d15e 100644 --- a/cache.h +++ b/cache.h

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

2014-09-10 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 a17389f..79f79f2 100644 --- a/setup.c +++ b/setup.c @@ -346,6 +346,10 @@ static int

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

2014-09-10 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 v2 25/32] checkout: clean up half-prepared directories in --to mode

2014-09-10 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 6d623fa..f419ddf 100644 ---

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

2014-09-10 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 v2 27/32] gc: factor out gc.pruneexpire parsing code

2014-09-10 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 | 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 +++

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

2014-09-10 Thread Nguyễn Thái Ngọc Duy
Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com --- Documentation/config.txt | 7 +++ Documentation/git-checkout.txt | 2 +- builtin/gc.c | 11 +++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Documentation/config.txt

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

2014-09-10 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

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

2014-09-10 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 8d219d8..3bfb990 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -298,7

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

2014-09-10 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 v2 32/32] t2025: add a test to make sure grafts is working from a linked checkout

2014-09-10 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 2cddbf1..27384a1 100755 --- a/t/t2025-checkout-to.sh +++ b/t/t2025-checkout-to.sh @@ -96,4

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

2014-09-10 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

Re: [PATCH] git-notes.txt: Explain how to transfer notes between repos

2014-09-10 Thread Johan Herland
On Wed, Sep 10, 2014 at 3:56 PM, Øyvind A. Holm su...@sunbase.org wrote: The documentation for git notes did not mention anywhere how to transfer notes between repositories, create a section that explains this topic. Thanks! Although there are some online resource containing similar information

Re: [PATCH v2] refs: speed up is_refname_available

2014-09-10 Thread Jeff King
On Wed, Sep 10, 2014 at 03:21:39PM -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: ... Reviewed-by: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Jeff King p...@peff.net --- Sorry for the quick v2; Michael and I crossed emails off-list, and I missed some of his

[PATCH v21 0/19] rs/ref-transaction (Re: Transaction patch series overview)

2014-09-10 Thread Jonathan Nieder
Jonathan Nieder wrote: The next series from Ronnie's collection is available at https://code-review.googlesource.com/#/q/topic:ref-transaction in case someone wants a fresh series to look at. Here is the outcome of that review. It could use another set of eyes (hint, hint) but should be

[PATCH 01/19] mv test: recreate mod/ directory instead of relying on stale copy

2014-09-10 Thread Jonathan Nieder
The tests for 'git mv moves a submodule' functionality often run commands like git mv sub mod/sub to move a submodule into a subdirectory. Just like plain /bin/mv, this is supposed to succeed if the mod/ parent directory exists and fail if it doesn't exist. Usually these tests mkdir

[PATCH 02/19] wrapper.c: remove/unlink_or_warn: simplify, treat ENOENT as success

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Simplify the function warn_if_unremovable slightly. Additionally, change behaviour slightly. If we failed to remove the object because the object does not exist, we can still return success back to the caller since none of the callers depend on fail if

[PATCH 03/19] wrapper.c: add a new function unlink_or_msg

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Wed, 16 Jul 2014 11:20:36 -0700 This behaves like unlink_or_warn except that on failure it writes the message to its 'err' argument, which the caller can display in an appropriate way or ignore. Signed-off-by: Ronnie Sahlberg sahlb...@google.com

[PATCH 04/19] refs.c: add an err argument to delete_ref_loose

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Thu, 15 May 2014 08:25:23 -0700 Add an err argument to delete_loose_ref so that we can pass a descriptive error string back to the caller. Pass the err argument from transaction commit to this function so that transaction users will have a nice

[PATCH 07/19] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Thu, 1 May 2014 10:40:10 -0700 Move the check for check_refname_format from lock_any_ref_for_update to lock_ref_sha1_basic. At some later stage we will get rid of lock_any_ref_for_update completely. This has no visible impact to callers, except for

[PATCH 06/19] rename_ref: don't ask read_ref_full where the ref came from

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Wed, 30 Apr 2014 12:41:04 -0700 We call read_ref_full with a pointer to flags from rename_ref but since we never actually use the returned flags we can just pass NULL here instead. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by:

[PATCH 05/19] refs.c: pass the ref log message to _create/delete/update instead of _commit

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Wed, 30 Apr 2014 12:22:42 -0700 Change the reference transactions so that we pass the reflog message through to the create/delete/update function instead of the commit message. This allows for individual messages for each change in a multi ref

[PATCH 08/19] refs.c: call lock_ref_sha1_basic directly from commit

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Thu, 1 May 2014 10:43:39 -0700 Skip using the lock_any_ref_for_update wrapper and call lock_ref_sha1_basic directly from the commit function. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com ---

[PATCH 10/19] refs.c: ref_transaction_commit: distinguish name conflicts from other errors

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Fri, 16 May 2014 14:14:38 -0700 In _commit, ENOTDIR can happen in the call to lock_ref_sha1_basic, either when we lstat the new refname and it returns ENOTDIR or if the name checking function reports that the same type of conflict happened. In both

[PATCH 09/19] refs.c: pass a skip list to name_conflict_fn

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Thu, 1 May 2014 11:16:07 -0700 Allow passing a list of refs to skip checking to name_conflict_fn. There are some conditions where we want to allow a temporary conflict and skip checking those refs. For example if we have a transaction that 1,

[PATCH 11/19] fetch.c: change s_update_ref to use a ref transaction

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Mon, 28 Apr 2014 13:49:07 -0700 Change s_update_ref to use a ref transaction for the ref update. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/fetch.c | 34

[PATCH 12/19] refs.c: make write_ref_sha1 static

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Mon, 28 Apr 2014 15:36:58 -0700 No external users call write_ref_sha1 any more so lets declare it static. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 10 -- refs.h | 3

[PATCH 13/19] refs.c: change resolve_ref_unsafe reading argument to be a flags field

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Tue, 15 Jul 2014 12:59:36 -0700 resolve_ref_unsafe takes a boolean argument for reading. Change this to be a flags field instead and pass the new constant RESOLVE_REF_READING when we want this behaviour. Swap two of the arguments in the function to

[PATCH 17/19] refs.c: do not permit err == NULL

2014-09-10 Thread Jonathan Nieder
Some functions that take a strbuf argument to append an error to treat !err as an indication that the message should be suppressed (e.g., ref_update_reject_duplicates). Others write the message to stderr on !err (e.g., repack_without_refs). Others crash (e.g., ref_transaction_update). Some of

  1   2   >