Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-15 Thread Junio C Hamano
On Mon, Jul 14, 2014 at 7:15 PM, Duy Nguyen pclo...@gmail.com wrote: It makes me wonder if a cleaner way of rebuilding cache-treei in this case is from git-add--interactive.perl, or by simply spawn git update-index --rebuild-cache-tree after running git-add--interactive.perl. We could check

Re: [PATCH RFC v2 07/19] rebase -i: The replay of root commits is not shown with --verbose

2014-07-15 Thread Chris Webb
Fabian Ruch baf...@gmail.com wrote: you're the original author of the code touched by this patch. Is the second -q option really a simple copy-and-paste of the first or am I overlooking something here? I'd like to confirm this as, in retrospect, I feel a bit uncertain about the hasty claim in

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-15 Thread Duy Nguyen
On Mon, Jul 14, 2014 at 11:38:06PM -0700, Junio C Hamano wrote: On Mon, Jul 14, 2014 at 7:15 PM, Duy Nguyen pclo...@gmail.com wrote: It makes me wonder if a cleaner way of rebuilding cache-treei in this case is from git-add--interactive.perl, or by simply spawn git update-index

Re: [PATCH v8 1/2] add `config_set` API for caching config-like files

2014-07-15 Thread Tanay Abhra
On 7/11/2014 7:51 PM, Matthieu Moy wrote: +`int git_configset_add_file(struct config_set *cs, const char *filename)`:: + +Parses the file and adds the variable-value pairs to the `config_set`, +dies if there is an error in parsing the file. The return value is undocumented. If

Re: [PATCH v8 2/2] test-config: add tests for the config_set API

2014-07-15 Thread Tanay Abhra
Junio C Hamano gitster at pobox.com writes: Tanay Abhra tanayabh at gmail.com writes: diff --git a/test-config.c b/test-config.c new file mode 100644 index 000..dc313c2 --- /dev/null +++ b/test-config.c at at -0,0 +1,125 at at + + +int main(int argc, char **argv)

[PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-15 Thread Ephrim Khong
When adding alternate object directories, we try not to add the directory of the current repository to avoid cycles. Unfortunately, that test was broken, since it compared an absolute with a relative path. Signed-off-by: Ephrim Khong dr.kh...@gmail.com --- Since v2: Added Johannes' comments.

Re: [PATCH v8 1/2] add `config_set` API for caching config-like files

2014-07-15 Thread Matthieu Moy
Tanay Abhra tanay...@gmail.com writes: I checked the whole codebase and in all of the cases if they cannot read a file they return -1 and continue running. More precisely: in git_config_from_file, any fopen failure results in return -1. But in git_config_early (one caller of

[PATCH 2/3] Win32: Unicode file name support (dirent)

2014-07-15 Thread Stepan Kasal
From: Karsten Blees bl...@dcon.de Date: Sat, 14 Jan 2012 22:01:09 +0100 Changes opendir/readdir to use Windows Unicode APIs and convert between UTF-8/UTF-16. Removes parameter checks that are already covered by xutftowcs_path. This changes detection of ENAMETOOLONG from MAX_PATH - 2 to MAX_PATH

[PATCH 0/3] fix test suite with mingw-unicode patches

2014-07-15 Thread Stepan Kasal
Hello Hannes, attached please find the patches that Karsten pointed out: 1) The unicode file name support was omitted from his unicode patch series; my mistake, sorry. There is still big part missing: support for unicode environment; I can only hope the tests would choke on that. 2) Windows

[PATCH 3/3] tests: do not pass iso8859-1 encoded parameter

2014-07-15 Thread Stepan Kasal
From: Pat Thoyts pattho...@users.sourceforge.net Date: Mon, 2 Sep 2013 15:44:54 +0100 git commit -m with some iso8859-1 encoded stuff is doomed to fail in MinGW, because Windows don't let you pass encoded bytes to a process (CreateProcessW always takes a UTF-16LE encoded string). It is safe to

[PATCH 1/3] Win32: Unicode file name support (except dirent)

2014-07-15 Thread Stepan Kasal
From: Karsten Blees bl...@dcon.de Date: Thu, 15 Mar 2012 18:21:28 +0100 Replaces Windows ANSI APIs dealing with file- or path names with their Unicode equivalent, adding UTF-8/UTF-16LE conversion as necessary. The dirent API (opendir/readdir/closedir) is updated in a separate commit. Adds

[PATCH] .gitignore: Add git-verify-commit

2014-07-15 Thread Øyvind A . Holm
builtin/verify-commit.c was added in commit d07b00b (verify-commit: scriptable commit signature verification, 2014-06-23), update .gitignore to ignore the generated file. Signed-off-by: Øyvind A. Holm su...@sunbase.org --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore

Re: [PATCH 0/3] fix test suite with mingw-unicode patches

2014-07-15 Thread Stepan Kasal
Hello, I'm sorry that I have to reply to my own mail, but I forgot this: Karsten Blees (2): Win32: Unicode file name support (except dirent) .. has this one squashed in: Win32: fix detection of empty directories in is_dir_empty https://github.com/msysgit/git/commit/91db148 Win32:

[PATCH v9 0/3] git config cache special querying api utilizing the cache

2014-07-15 Thread Tanay Abhra
Hi, [PATCH v9]: Applied most of the review comments mentioned in [11]. Mostly asthetic changes. test-config now clears the config_set before exiting. Most of the tests now use the check-config function. check_config_init() now handles return values correctly. Diff

[PATCH v9 2/2] test-config: add tests for the config_set API

2014-07-15 Thread Tanay Abhra
Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Matthieu Moy matthieu@imag.fr Signed-off-by: Tanay Abhra tanay...@gmail.com ---

[PATCH v9 1/2] add `config_set` API for caching config-like files

2014-07-15 Thread Tanay Abhra
Currently `git_config()` uses a callback mechanism and file rereads for config values. Due to this approach, it is not uncommon for the config files to be parsed several times during the run of a git program, with different callbacks picking out different variables useful to themselves. Add a

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Keller, Jacob E
On Mon, 2014-07-14 at 10:17 -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: On Sun, Jul 13, 2014 at 01:33:56PM -0400, Jeff King wrote: I realize that I am reinventing the error-reporting wheel on a sleepy Sunday afternoon without having thought about it much, so there is

Re: [PATCH v9 1/2] add `config_set` API for caching config-like files

2014-07-15 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: diff --git a/config.c b/config.c index ba882a1..89e2d67 100644 --- a/config.c +++ b/config.c ... +const struct string_list *git_configset_get_value_multi(struct config_set *cs, const char *key) +{ + struct config_set_element *e =

Re: [PATCH v9 2/2] test-config: add tests for the config_set API

2014-07-15 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: Expose the `config_set` C API as a set of simple commands in order to facilitate testing. Add tests for the `config_set` API as well as for `git_config_get_*()` family for the usual config files. Signed-off-by: Matthieu Moy matthieu@imag.fr

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Junio C Hamano
Keller, Jacob E jacob.e.kel...@intel.com writes: On Mon, 2014-07-14 at 10:17 -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: On Sun, Jul 13, 2014 at 01:33:56PM -0400, Jeff King wrote: I realize that I am reinventing the error-reporting wheel on a sleepy Sunday afternoon

Re: [PATCH v9 1/2] add `config_set` API for caching config-like files

2014-07-15 Thread Tanay Abhra
On 7/15/2014 9:16 PM, Junio C Hamano wrote: Tanay Abhra tanay...@gmail.com writes: diff --git a/config.c b/config.c index ba882a1..89e2d67 100644 --- a/config.c +++ b/config.c ... +const struct string_list *git_configset_get_value_multi(struct config_set *cs, const char *key) +{ +

[no subject]

2014-07-15 Thread Woody Wu
Hi, I have tried some methods introduced in the network, but always failed.  Some big files committed by me to a very old branch then the files deleted and new branches were continuously created. Now the checkout directory has grown to about 80 megabytes.  What's the right way to permenently

Re: [PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-07-15 Thread Ronnie Sahlberg
On Tue, Jul 8, 2014 at 8:02 AM, Michael Haggerty mhag...@alum.mit.edu wrote: On 06/20/2014 04:43 PM, Ronnie Sahlberg wrote: 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.

Big repository cannot be reduced

2014-07-15 Thread Woody Wu
Hi, I have tried some methods introduced in the network, but always failed.  Some big files committed by me to a very old branch then the files deleted and new branches were continuously created. Now the checkout directory has grown to about 80 megabytes.  What's the right way to permenently

Re: [PATCH v8 4/4] cache-tree: Write updated cache-tree after commit

2014-07-15 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: On Mon, Jul 14, 2014 at 11:38:06PM -0700, Junio C Hamano wrote: On Mon, Jul 14, 2014 at 7:15 PM, Duy Nguyen pclo...@gmail.com wrote: It makes me wonder if a cleaner way of rebuilding cache-treei in this case is from git-add--interactive.perl, or by

Re: [PATCH v9 2/2] test-config: add tests for the config_set API

2014-07-15 Thread Tanay Abhra
On 7/15/2014 9:27 PM, Junio C Hamano wrote: +test_expect_success 'setup default config' ' +cat .git/config \EOF So the default .git/config that was prepared by git init is discarded and replaced with this? Shouldn't it be cat .git/config \EOF instead? Most of tests like

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Keller, Jacob E
On Tue, 2014-07-15 at 09:03 -0700, Junio C Hamano wrote: Keller, Jacob E jacob.e.kel...@intel.com writes: On Mon, 2014-07-14 at 10:17 -0700, Junio C Hamano wrote: Jeff King p...@peff.net writes: On Sun, Jul 13, 2014 at 01:33:56PM -0400, Jeff King wrote: I realize that I am

Re: [PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-07-15 Thread Jonathan Nieder
Michael Haggerty wrote: So...I like the idea of enforcing refname checks at the lowest level possible, but I think that the change you propose is too abrupt. I think it needs either more careful analysis showing that it won't hurt anybody, or some kind of tooling or non-strict mode that

Re: [PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-07-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: What I suggest doing here is to create a new patch towards the end of the series that will : * change the resolve_ref_unsafe(... , int reading, ...) argument to be a bitmask of flags with #define RESOLVE_REF_READING 0x01 (== current flag) #define

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Junio C Hamano
Keller, Jacob E jacob.e.kel...@intel.com writes: On Tue, 2014-07-15 at 09:03 -0700, Junio C Hamano wrote: ... Yes, that is fun. I actually think your In 'version:pefname' and 'wersion:refname', we want be able to report 'pefname' and 'wersion' are misspelled, and returning -1 or enum

Re: [PATCH 0/3] fix test suite with mingw-unicode patches

2014-07-15 Thread Junio C Hamano
Stepan Kasal ka...@ucw.cz writes: Hello Hannes, attached please find the patches that Karsten pointed out: 1) The unicode file name support was omitted from his unicode patch series; my mistake, sorry. There is still big part missing: support for unicode environment; I can only hope the

Re: [PATCH v9 2/2] test-config: add tests for the config_set API

2014-07-15 Thread Junio C Hamano
Tanay Abhra tanay...@gmail.com writes: ... I need it for test_expect_success 'proper error on error in default config files' ' which requires me to compare the line no at which the error was found. I see. We may want to later rethink the way you validate the line numbers, but in the meantime

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Keller, Jacob E
On Tue, 2014-07-15 at 11:17 -0700, Junio C Hamano wrote: Keller, Jacob E jacob.e.kel...@intel.com writes: On Tue, 2014-07-15 at 09:03 -0700, Junio C Hamano wrote: ... Yes, that is fun. I actually think your In 'version:pefname' and 'wersion:refname', we want be able to report

Re: [PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-07-15 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes: How to take care of the recovery use case is another question. FWIW I also would prefer if git update-ref -d or git branch -D could be used to delete corrupt refs instead of having to use fsck (since a fsck run can take a while), but that's a

Re: [PATCH v1 1/3] dir.c: coding style fix

2014-07-15 Thread Karsten Blees
Am 15.07.2014 00:30, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= pclo...@gmail.com Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Signed-off-by: Karsten Blees bl...@dcon.de --- Thanks

Re: [PATCH v1 1/3] dir.c: coding style fix

2014-07-15 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes: Am 15.07.2014 00:30, schrieb Junio C Hamano: Karsten Blees karsten.bl...@gmail.com writes: From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= pclo...@gmail.com Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Junio C Hamano
Junio C Hamano gits...@pobox.com writes: Keller, Jacob E jacob.e.kel...@intel.com writes: On Tue, 2014-07-15 at 09:03 -0700, Junio C Hamano wrote: ... Yes, that is fun. I actually think your In 'version:pefname' and 'wersion:refname', we want be able to report 'pefname' and 'wersion'

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Junio C Hamano
Keller, Jacob E jacob.e.kel...@intel.com writes: I am going to re-submit this with an enum-style return. I am also changing how we parse so that we can correctly report whether the sort function or sort atom is incorrect. Oh, our mails crossed, I guess. As long as it will leave the door open

[PATCH 1/2] rebase--am: use --cherry-pick instead of --ignore-if-in-upstream

2014-07-15 Thread John Keeping
When using `git format-patch --ignore-if-in-upstream` we are only allowed to give a single revision range. In the next commit we will want to add an additional exclusion revision in order to handle fork points correctly, so convert `git-rebase--am` to use a symmetric difference with

Re: [PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-15 Thread Junio C Hamano
Ephrim Khong dr.kh...@gmail.com writes: @@ -320,7 +320,7 @@ static int link_alt_odb_entry(const char *entry, const char *relative_base, int return -1; } } - if (!strcmp(ent-base, objdir)) { + if (!strcmp_icase(ent-base, normalized_objdir))

Re: [PATCH] doc: State coding guideline for error message punctuation

2014-07-15 Thread Philip Oakley
From: Junio C Hamano gits...@pobox.com Sent: Thursday, July 10, 2014 9:36 PM Jeff King p...@peff.net writes: On Mon, Jun 16, 2014 at 01:55:57PM +0100, Philip Oakley wrote: +Error Messages + + - We typically do not end error messages with a full stop. While + we've been rather inconsistent

Re: [PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-15 Thread Eric Sunshine
On Tue, Jul 15, 2014 at 7:29 AM, Ephrim Khong dr.kh...@gmail.com wrote: When adding alternate object directories, we try not to add the directory of the current repository to avoid cycles. Unfortunately, that test was broken, since it compared an absolute with a relative path.

Re: [PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-07-15 Thread Ronnie Sahlberg
On Tue, Jul 15, 2014 at 11:04 AM, Jonathan Nieder jrnie...@gmail.com wrote: Michael Haggerty wrote: So...I like the idea of enforcing refname checks at the lowest level possible, but I think that the change you propose is too abrupt. I think it needs either more careful analysis showing that

Re: [PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-07-15 Thread Ronnie Sahlberg
On Tue, Jul 15, 2014 at 11:34 AM, Junio C Hamano gits...@pobox.com wrote: Jonathan Nieder jrnie...@gmail.com writes: How to take care of the recovery use case is another question. FWIW I also would prefer if git update-ref -d or git branch -D could be used to delete corrupt refs instead of

Re: [PATCH v9 1/4] cache-tree: Create/update cache-tree on checkout

2014-07-15 Thread Torsten Bögershausen
On 07/13/2014 10:28 PM, David Turner wrote: From: David Turner dtur...@twopensource.com [] diff --git a/cache-tree.c b/cache-tree.c index 7fa524a..f951d7d 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -239,9 +239,12 @@ static int update_one(struct cache_tree *it, struct strbuf

Re: [PATCH 2/2] rebase: omit patch-identical commits with --fork-point

2014-07-15 Thread Ted Felix
Thanks, John. My test script is working fine for me now with these patches. -- 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 http://vger.kernel.org/majordomo-info.html

Re: [PATCH v3] sha1_file: do not add own object directory as alternate

2014-07-15 Thread Junio C Hamano
Ephrim Khong dr.kh...@gmail.com writes: diff --git a/t/t7702-repack-cyclic-alternate.sh b/t/t7702-repack-cyclic-alternate.sh new file mode 100755 index 000..8341d46 --- /dev/null +++ b/t/t7702-repack-cyclic-alternate.sh @@ -0,0 +1,24 @@ +#!/bin/sh +# +# Copyright (c) 2014 Ephrim

Re: [PATCH v2 1/8] alloc.c: remove the alloc_raw_commit_node() function

2014-07-15 Thread Junio C Hamano
Jeff King p...@peff.net writes: #define DEFINE_ALLOCATOR(name, type) \ +static struct alloc_state name##_state; \ void *alloc_##name##_node(void) \ {

Re: [PATCH v2 2/8] alloc: write out allocator definitions

2014-07-15 Thread Junio C Hamano
Jeff King p...@peff.net writes: Because the allocator functions for tree, blobs, etc are all very similar, we originally used a macro to avoid repeating ourselves. Since the prior commit, though, the heavy lifting is done by an inline helper function. The macro does still save us a few

Re: [PATCH v2 3/8] move setting of object-type to alloc_* functions

2014-07-15 Thread Junio C Hamano
Jeff King p...@peff.net writes: diff --git a/alloc.c b/alloc.c index 03e458b..fd2e32d 100644 --- a/alloc.c +++ b/alloc.c @@ -52,6 +52,7 @@ static struct alloc_state blob_state; void *alloc_blob_node(void) { struct blob *b = alloc_node(blob_state, sizeof(struct blob)); +

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Keller, Jacob E
On Tue, 2014-07-15 at 12:12 -0700, Junio C Hamano wrote: Keller, Jacob E jacob.e.kel...@intel.com writes: I am going to re-submit this with an enum-style return. I am also changing how we parse so that we can correctly report whether the sort function or sort atom is incorrect. Oh, our

Re: [PATCH v20 43/48] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-07-15 Thread Ronnie Sahlberg
On Tue, Jul 15, 2014 at 12:34 PM, Ronnie Sahlberg sahlb...@google.com wrote: On Tue, Jul 15, 2014 at 11:04 AM, Jonathan Nieder jrnie...@gmail.com wrote: Michael Haggerty wrote: So...I like the idea of enforcing refname checks at the lowest level possible, but I think that the change you

[PATCH v8 0/4] tag: configure default tag sort via .gitconfig

2014-07-15 Thread Jacob Keller
This patch series is hopefully the final version of a series of patches which updates git-tag to allow the .gitconfig variable 'tag.sort' to be used as the default sort parameter. This version uses a new set/pop error routine setup which enables correctly modifying the error routine to handle the

[PATCH v8 1/4] usage: make error functions a stack

2014-07-15 Thread Jacob Keller
Let error routine be a stack of error functions so that callers can temporarily override the error_routine and then pop their modification off the stack. This enables customizing error for a small code segment. Signed-off-by: Jacob Keller jacob.e.kel...@intel.com --- This is a modification of

[PATCH v8 4/4] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Jacob Keller
Add support for configuring default sort specification for git tags. Command line option will override the configured value. Both methods use the same syntax. Make use of (set/pop)_error_routine to temporarily modify error reporting when parsing as a configuration option. Cc: Jeff King

[PATCH v8 2/4] tag: fix --sort tests to use cat-\EOF format

2014-07-15 Thread Jacob Keller
The --sort tests should use the better format for expect to maintain indenting and ensure that no substitution is occurring. This makes parsing and understanding the tests a bit easier. Signed-off-by: Jacob Keller jacob.e.kel...@intel.com --- t/t7004-tag.sh | 40

[PATCH v8 3/4] tag: update parsing to be more precise regarding errors

2014-07-15 Thread Jacob Keller
Update the parsing of sort string specifications so that it is able to properly detect errors in the function type and allowed atoms. Cc: Jeff King p...@peff.net Signed-off-by: Jacob Keller jacob.e.kel...@intel.com --- This function should replace the one I think is already on one of the

Re: [PATCH v9 1/4] cache-tree: Create/update cache-tree on checkout

2014-07-15 Thread Junio C Hamano
Torsten Bögershausen tbo...@web.de writes: On 07/13/2014 10:28 PM, David Turner wrote: From: David Turner dtur...@twopensource.com [] diff --git a/cache-tree.c b/cache-tree.c index 7fa524a..f951d7d 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -239,9 +239,12 @@ static int

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Keller, Jacob E
On Tue, 2014-07-15 at 12:12 -0700, Junio C Hamano wrote: Keller, Jacob E jacob.e.kel...@intel.com writes: I am going to re-submit this with an enum-style return. I am also changing how we parse so that we can correctly report whether the sort function or sort atom is incorrect. Oh, our

Re: [PATCH v2 3/4] use new config API for worktree configurations of submodules

2014-07-15 Thread Junio C Hamano
Heiko Voigt hvo...@hvoigt.net writes: Can there be any caller that include and use submodule-config.h that does not need anythjing from submodule.h? Or vice versa? It just did not look like these two headers describe independent subsystems but they almost always have to go hand-in-hand.

Re: [PATCH v8 0/4] tag: configure default tag sort via .gitconfig

2014-07-15 Thread Junio C Hamano
Jacob Keller jacob.e.kel...@intel.com writes: This patch series is hopefully the final version of a series of patches which updates git-tag to allow the .gitconfig variable 'tag.sort' to be used as the default sort parameter. This version uses a new set/pop error routine setup which enables

Re: [PATCH v8 1/4] usage: make error functions a stack

2014-07-15 Thread Junio C Hamano
Jacob Keller jacob.e.kel...@intel.com writes: extern void set_error_routine(void (*routine)(const char *err, va_list params)); +extern void pop_error_routine(void); pop that undoes set smells somewhat weird. Perhaps we should rename set to push? That would allow us catch possible topics

Re: [PATCH 0/3] fix test suite with mingw-unicode patches

2014-07-15 Thread Karsten Blees
Am 15.07.2014 20:20, schrieb Junio C Hamano: Stepan Kasal ka...@ucw.cz writes: Hello Hannes, attached please find the patches that Karsten pointed out: 1) The unicode file name support was omitted from his unicode patch series; my mistake, sorry. There is still big part missing: support

[PATCH 1/2] MinGW: fix compile error due to missing ELOOP

2014-07-15 Thread Karsten Blees
MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka Too many links) instead. Signed-off-by: Karsten Blees bl...@dcon.de --- compat/mingw.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compat/mingw.h b/compat/mingw.h index 405c08f..510530c 100644 --- a/compat/mingw.h +++

[PATCH 2/2] config: use chmod() instead of fchmod()

2014-07-15 Thread Karsten Blees
There is no fchmod() on native Windows platforms (MinGW and MSVC), and the equivalent Win32 API (SetFileInformationByHandle) requires Windows Vista. Use chmod() instead. Signed-off-by: Karsten Blees bl...@dcon.de --- config.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff

[PATCH] refs.c: add a public is_branch function

2014-07-15 Thread Ronnie Sahlberg
Both refs.c and fsck.c have their own private copies of the is_branch function. Delete the is_branch function from fsck.c and make the version in refs.c public. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/fsck.c | 5 - refs.c | 2 +- refs.h | 2 ++ 3 files

[PATCH] remove duplicate of is_branch

2014-07-15 Thread Ronnie Sahlberg
Jun, List Please find a trivial patch that makes refs.c:is_branch public. This allows us to delete the identical copy of is_branch in fsck.c Ronnie Sahlberg (1): refs.c: add a public is_branch function builtin/fsck.c | 5 - refs.c | 2 +- refs.h | 2 ++ 3 files changed,

Re: [PATCH] refs.c: add a public is_branch function

2014-07-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/fsck.c | 5 - refs.c | 2 +- refs.h | 2 ++ 3 files changed, 3 insertions(+), 6 deletions(-) Makes sense -- thanks. (This is an old one: v1.5.4-rc4~27 (2008-01-15), v1.5.4-rc4~30

Re: [PATCH v8 1/4] usage: make error functions a stack

2014-07-15 Thread Keller, Jacob E
On Tue, 2014-07-15 at 15:47 -0700, Junio C Hamano wrote: Jacob Keller jacob.e.kel...@intel.com writes: extern void set_error_routine(void (*routine)(const char *err, va_list params)); +extern void pop_error_routine(void); pop that undoes set smells somewhat weird. Perhaps we should

Re: [PATCH v8 1/4] usage: make error functions a stack

2014-07-15 Thread Keller, Jacob E
On Tue, 2014-07-15 at 15:47 -0700, Junio C Hamano wrote: Jacob Keller jacob.e.kel...@intel.com writes: extern void set_error_routine(void (*routine)(const char *err, va_list params)); +extern void pop_error_routine(void); pop that undoes set smells somewhat weird. Perhaps we should

[PATCH v9 4/4] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Jacob Keller
Add support for configuring default sort specification for git tags. Command line option will override the configured value. Both methods use the same syntax. Make use of (set/pop)_error_routine to temporarily modify error reporting when parsing as a configuration option. Cc: Jeff King

[PATCH v9 3/4] tag: update parsing to be more precise regarding errors

2014-07-15 Thread Jacob Keller
Update the parsing of sort string specifications so that it is able to properly detect errors in the function type and allowed atoms. Cc: Jeff King p...@peff.net Signed-off-by: Jacob Keller jacob.e.kel...@intel.com --- builtin/tag.c | 55 +-- 1

[PATCH v9 2/4] tag: fix --sort tests to use cat-\EOF format

2014-07-15 Thread Jacob Keller
The --sort tests should use the better format for expect to maintain indenting and ensure that no substitution is occurring. This makes parsing and understanding the tests a bit easier. Signed-off-by: Jacob Keller jacob.e.kel...@intel.com --- t/t7004-tag.sh | 40

[PATCH v9 1/4] usage: make error functions a stack

2014-07-15 Thread Jacob Keller
Rename set_error_routine to be push_error_routine, and add a new pop_error_routine. This allows temporary modifications of the error routine over a small block of code. Signed-off-by: Jacob Keller jacob.e.kel...@intel.com --- Renamed set_error_routine to push_error_routine in order to match the

[PATCH 19/20] refs.c: make prune_ref use a transaction to delete the ref

2014-07-15 Thread Ronnie Sahlberg
Change prune_ref to delete the ref using a ref transaction. To do this we also need to add a new flag REF_ISPRUNING that will tell the transaction that we do not want to delete this ref from the packed refs. This flag is private to refs.c and not exposed to external callers. Reviewed-by: Jonathan

[PATCH 15/20] refs.c: make lock_ref_sha1 static

2014-07-15 Thread Ronnie Sahlberg
No external callers reference lock_ref_sha1 any more so lets declare it static. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 2 +- refs.h | 6 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/refs.c b/refs.c

[PATCH 07/20] commit.c: use ref transactions for updates

2014-07-15 Thread Ronnie Sahlberg
Change commit.c to use ref transactions for all ref updates. Make sure we pass a NULL pointer to ref_transaction_update if have_old is false. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/commit.c | 24 +++- 1

[PATCH 14/20] walker.c: use ref transaction for ref updates

2014-07-15 Thread Ronnie Sahlberg
Switch to using ref transactions in walker_fetch(). As part of the refactoring to use ref transactions we also fix a potential memory leak where in the original code if write_ref_sha1() would fail we would end up returning from the function without free()ing the msg string. Note that this

[PATCH 02/20] refs.c: update ref_transaction_delete to check for error and return status

2014-07-15 Thread Ronnie Sahlberg
Change ref_transaction_delete() to do basic error checking and return non-zero of error. Update all callers to check the return for ref_transaction_delete(). There are currently no conditions in _delete that will return error but there will be in the future. Add an err argument that will be

[PATCH 18/20] refs.c: remove lock_ref_sha1

2014-07-15 Thread Ronnie Sahlberg
lock_ref_sha1 was only called from one place in refc.c and only provided a check that the refname was sane before adding back the initial refs/ part of the ref path name, the initial refs/ that this caller had already stripped off before calling lock_ref_sha1. Reviewed-by: Jonathan Nieder

[PATCH 04/20] refs.c: add transaction.status and track OPEN/CLOSED/ERROR

2014-07-15 Thread Ronnie Sahlberg
Track the state of a transaction in a new state field. Check the field for sanity, i.e. that state must be OPEN when _commit/_create/_delete or _update is called or else die(BUG:...) Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 39 ++- 1

[PATCH 09/20] fast-import.c: change update_branch to use ref transactions

2014-07-15 Thread Ronnie Sahlberg
Change update_branch() to use ref transactions for updates. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- fast-import.c | 24 ++-- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/fast-import.c

[PATCH 06/20] replace.c: use the ref transaction functions for updates

2014-07-15 Thread Ronnie Sahlberg
Update replace.c to use ref transactions for updates. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/replace.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builtin/replace.c b/builtin/replace.c

[PATCH 12/20] receive-pack.c: use a reference transaction for updating the refs

2014-07-15 Thread Ronnie Sahlberg
Wrap all the ref updates inside a transaction. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/receive-pack.c | 96 +- 1 file changed, 63 insertions(+), 33 deletions(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c

[PATCH 13/20] fast-import.c: use a ref transaction when dumping tags

2014-07-15 Thread Ronnie Sahlberg
Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- fast-import.c | 29 +++-- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/fast-import.c b/fast-import.c index d5206ee..a95e1be 100644 --- a/fast-import.c

[PATCH 20/20] refs.c: make delete_ref use a transaction

2014-07-15 Thread Ronnie Sahlberg
Change delete_ref to use a ref transaction for the deletion. At the same time since we no longer have any callers of repack_without_ref we can now delete this function. Change delete_ref to return 0 on success and 1 on failure instead of the previous 0 on success either 1 or -1 on failure.

[PATCH 17/20] refs.c: remove the update_ref_write function

2014-07-15 Thread Ronnie Sahlberg
Since we only call update_ref_write from a single place and we only call it with onerr==QUIET_ON_ERR we can just as well get rid of it and just call write_ref_sha1 directly. This changes the return status for _commit from 1 to -1 on failures when writing to the ref. Eventually we will want _commit

[PATCH 11/20] refs.c: change update_ref to use a transaction

2014-07-15 Thread Ronnie Sahlberg
Change the update_ref helper function to use a ref transaction internally. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 28 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/refs.c

[PATCH 01/20] refs.c: change ref_transaction_create to do error checking and return status

2014-07-15 Thread Ronnie Sahlberg
Do basic error checking in ref_transaction_create() and make it return non-zero on error. Update all callers to check the result of ref_transaction_create(). There are currently no conditions in _create that will return error but there will be in the future. Add an err argument that will be

[PATCH 10/20] branch.c: use ref transaction for all ref updates

2014-07-15 Thread Ronnie Sahlberg
Change create_branch to use a ref transaction when creating the new branch. This also fixes a race condition in the old code where two concurrent create_branch could race since the lock_any_ref_for_update/write_ref_sha1 did not protect against the ref already existing. I.e. one thread could end

[PATCH 00/20] ref transactions part 2

2014-07-15 Thread Ronnie Sahlberg
This is the next 20 patches from my originally big patch series and follow the previous 19 patches that is now in juns tree. These patches were numbered 20-39 in the original 48-patch series. Changes since these patches were in the original series: - Addressing concerns from mhagger's review

[PATCH 08/20] sequencer.c: use ref transactions for all ref updates

2014-07-15 Thread Ronnie Sahlberg
Change to use ref transactions for all updates to refs. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- sequencer.c | 27 ++- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/sequencer.c b/sequencer.c

[PATCH 05/20] tag.c: use ref transactions when doing updates

2014-07-15 Thread Ronnie Sahlberg
Change tag.c to use ref transactions for all ref updates. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/tag.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builtin/tag.c b/builtin/tag.c index

[PATCH 03/20] refs.c: make ref_transaction_begin take an err argument

2014-07-15 Thread Ronnie Sahlberg
Add an err argument to _begin so that on non-fatal failures in future ref backends we can report a nice error back to the caller. While _begin can currently never fail for other reasons than OOM, in which case we die() anyway, we may add other types of backends in the future. For example, a

Re: [PATCH 00/20] ref transactions part 2

2014-07-15 Thread Ronnie Sahlberg
Hi Michael, Here is the next set of 20 patches of those you already reviewed. I cut this patch off just before patch #40 in the previous series. These are the patches numbered 20-39 in the original series. I think I have addressed your concerns here so If you could take a quick look and

Re: [PATCH 3/3] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Jeff King
On Tue, Jul 15, 2014 at 09:03:53AM -0700, Junio C Hamano wrote: Do we want to go this way? I do not speak for Peff, but I personally think this is just a fun demonstration, nothing more, and my gut feeling is that it would make things unnecessary complex without much real gain to pursue it

[PATCH 16/20] refs.c: remove the update_ref_lock function

2014-07-15 Thread Ronnie Sahlberg
Since we now only call update_ref_lock with onerr==QUIET_ON_ERR we no longer need this function and can replace it with just calling lock_any_ref_for_update directly. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 30

Re: [PATCH v9 4/4] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Jeff King
On Tue, Jul 15, 2014 at 04:32:59PM -0700, Jacob Keller wrote: +static void error_bad_sort_config(const char *err, va_list params) +{ + vreportf(warning: tag.sort has , err, params); +} This feels a little like an abuse of the prefix field of vreportf, but as you probably saw in my for

Re: [PATCH 1/2] MinGW: fix compile error due to missing ELOOP

2014-07-15 Thread Jonathan Nieder
Karsten Blees wrote: MinGW and MSVC before 2010 don't define ELOOP, use EMLINK (aka Too many links) instead. [...] +#ifndef ELOOP +#define ELOOP EMLINK +#endif This could use #define ELOOP WSAELOOP as an alternative. But it shouldn't matter since git doesn't look for EMLINK

Re: [PATCH v9 4/4] tag: support configuring --sort via .gitconfig

2014-07-15 Thread Keller, Jacob E
On Tue, 2014-07-15 at 19:42 -0400, Jeff King wrote: On Tue, Jul 15, 2014 at 04:32:59PM -0700, Jacob Keller wrote: +static void error_bad_sort_config(const char *err, va_list params) +{ + vreportf(warning: tag.sort has , err, params); +} This feels a little like an abuse of the

  1   2   >