Re: [GIT GUI PATCH] git-gui: use vcompare when comparing the git version

2014-05-14 Thread Chris Packham
On 14/05/14 09:24, Jens Lehmann wrote: Since git 2.0.0 starting git gui in a submodule using a gitfile fails with the following error: No working directory ../../../path couldn't change working directory to ../../../path: no such file or directory This is because git

Re: [GIT GUI PATCH] git-gui: use vcompare when comparing the git version

2014-05-14 Thread Jens Lehmann
Junio, I believe this issue needs to be fixed before 2.0 final. Otherwise git gui will not work inside submodules anymore due to the major version number change from 1 to 2. I'd like to hear Pat's opinion on this; even though I think my patch is less risky (as it doesn't change behavior for pre-2

Re: [GUILT v2 06/29] Fix the do_get_patch function.

2014-05-14 Thread Per Cederqvist
On Tue, May 13, 2014 at 11:13 PM, Jeff Sipek jef...@josefsipek.net wrote: On Tue, May 13, 2014 at 10:30:42PM +0200, Per Cederqvist wrote: A patch file consists of: (1) the description (2) optional diffstat (3) the patches When extracting the patch, we only want part 3. The do_get_patch

Re: [GUILT v2 07/29] Added test cases for guilt fold.

2014-05-14 Thread Per Cederqvist
On Tue, May 13, 2014 at 11:30 PM, Jeff Sipek jef...@josefsipek.net wrote: On Tue, May 13, 2014 at 10:30:43PM +0200, Per Cederqvist wrote: Test that we can combine any combination of patches with empty and non-empty messages, both with and without guilt.diffstat. (All patches are empty.)

Re: [PATCH 2/2] wincred: avoid overwriting configured variables

2014-05-14 Thread Erik Faye-Lund
On Wed, May 14, 2014 at 10:45 AM, Stepan Kasal ka...@ucw.cz wrote: Hello kusma, On Tue, May 13, 2014 at 08:56:54AM +0200, Erik Faye-Lund wrote: --- a/contrib/credential/wincred/Makefile +++ b/contrib/credential/wincred/Makefile @@ -1,12 +1,12 @@ all: git-credential-wincred.exe -CC

Re: [GUILT v2 16/29] Fix backslash handling when creating names of imported patches.

2014-05-14 Thread Per Cederqvist
On Wed, May 14, 2014 at 12:09 AM, Jeff Sipek jef...@josefsipek.net wrote: On Tue, May 13, 2014 at 10:30:52PM +0200, Per Cederqvist wrote: The 'echo %s' construct sometimes processes escape sequences. (This %s? Should this be $s? Yes. Will fix that typo in v3 of the patch series. /ceder

Re: [PATCH 0/4] remote-hg: more improvements

2014-05-14 Thread Philippe Vaucher
It is *way* beyond the quality of any other tool in 'contrib/' and even some tools in the core, like 'git-request-pull' (which has known bugs), and probably even 'git-pt'. Junio, can you comment on this? I understand this probably doesn't really affect the issue at hand, but it'd help

Re: [GUILT v2 25/29] guilt push now fails when there are no more patches to push.

2014-05-14 Thread Per Cederqvist
On Tue, May 13, 2014 at 11:41 PM, Jeff Sipek jef...@josefsipek.net wrote: On Tue, May 13, 2014 at 10:31:01PM +0200, Per Cederqvist wrote: This makes it easier to script operations on the entire queue, for example run the test suite on each patch in the queue: guilt pop -a;while guilt

Re: [PATCH 0/4] remote-hg: more improvements

2014-05-14 Thread David Kastrup
Philippe Vaucher philippe.vauc...@gmail.com writes: Thanks for the explanation. I think it underlines well the A) technical issues (quality commits) and the B) social issues (ability to communicate in a friendly way respond constructively), which we discovered are both *essential* for

Re: [PATCH 0/4] remote-hg: more improvements

2014-05-14 Thread Philippe Vaucher
Thanks for the explanation. I think it underlines well the A) technical issues (quality commits) and the B) social issues (ability to communicate in a friendly way respond constructively), which we discovered are both *essential* for contributing to git. I'm not entirely convinced of that:

Re: [GUILT v2 00/29] Teach guilt import-commit how to create legal patch names, and more

2014-05-14 Thread Per Cederqvist
On Tue, May 13, 2014 at 11:29 PM, Per Cederqvist ced...@opera.com wrote: On Tue, May 13, 2014 at 10:54 PM, Jeff Sipek jef...@josefsipek.net wrote: On Tue, May 13, 2014 at 04:45:47PM -0400, Theodore Ts'o wrote: On Tue, May 13, 2014 at 10:30:36PM +0200, Per Cederqvist wrote: ... - Changed

Re: [PATCH 0/4] remote-hg: more improvements

2014-05-14 Thread David Kastrup
Philippe Vaucher philippe.vauc...@gmail.com writes: Thanks for the explanation. I think it underlines well the A) technical issues (quality commits) and the B) social issues (ability to communicate in a friendly way respond constructively), which we discovered are both *essential* for

Re: t5539 fails on ubuntu for v2.0.0-rc2

2014-05-14 Thread Jeff King
On Sat, May 10, 2014 at 10:02:59AM -0400, Jeff King wrote: On Fri, May 09, 2014 at 02:08:27PM -0700, Junio C Hamano wrote: 3. Just disable the http tests when run as root. I think I'd favor 3. But I'd like to be sure that being root is the problem. I agree with both the

Re: Watchman support for git

2014-05-14 Thread Duy Nguyen
On Wed, May 14, 2014 at 6:44 AM, David Turner dtur...@twopensource.com wrote: I'm not so happy that git now needs to link to libjansson.so and libwatchman.so. I would load libwatchman.so at runtime only when core.usewatchman is on, but this is more of personal taste. I assume you mean

Re: Watchman support for git

2014-05-14 Thread Duy Nguyen
One more thing I think we can solve with watchman is the racy timestamp issue (see 29e4d36 and 407c8eb). Basically if a file is updated within a second (and the system only supports timestamp granuarity down to a second) then git can't know if a file is changed by comparing stat data, so it

Re: [PATCH 0/4] remote-hg: more improvements

2014-05-14 Thread Philippe Vaucher
Basically you have to write in a manner if a seedy stranger gave me that code on a street corner, I would have no problem checking it in. In practice, the shortcuts offering themselves through civil behavior and mutual trust get a lot more work done. My point was more that it's very hard to

Re: [PATCH 0/4] remote-hg: more improvements

2014-05-14 Thread David Kastrup
Philippe Vaucher philippe.vauc...@gmail.com writes: Basically you have to write in a manner if a seedy stranger gave me that code on a street corner, I would have no problem checking it in. In practice, the shortcuts offering themselves through civil behavior and mutual trust get a lot more

Re: [PATCH v2 01/17] contrib: remove outdated README

2014-05-14 Thread Philippe Vaucher
I have had patches and contributions rejected in the past, sometimes rudely. Same has happened to many others, if you contribute long enough, it is pretty much guaranteed that it will happen to you. Maintainer is wrong, or you are wrong, or someone is just having a bad day. This is not

Re: [GUILT v2 16/29] Fix backslash handling when creating names of imported patches.

2014-05-14 Thread Jeff Sipek
On Wed, May 14, 2014 at 10:56:18AM +0200, Per Cederqvist wrote: On Wed, May 14, 2014 at 12:09 AM, Jeff Sipek jef...@josefsipek.net wrote: On Tue, May 13, 2014 at 10:30:52PM +0200, Per Cederqvist wrote: The 'echo %s' construct sometimes processes escape sequences. (This %s? Should this

Re: [GUILT v2 25/29] guilt push now fails when there are no more patches to push.

2014-05-14 Thread Jeff Sipek
On Wed, May 14, 2014 at 11:27:19AM +0200, Per Cederqvist wrote: On Tue, May 13, 2014 at 11:41 PM, Jeff Sipek jef...@josefsipek.net wrote: On Tue, May 13, 2014 at 10:31:01PM +0200, Per Cederqvist wrote: This makes it easier to script operations on the entire queue, for example run the test

Re: [PATCH 0/4] remote-hg: more improvements

2014-05-14 Thread Philippe Vaucher
My point was more that it's very hard to produce high quality commits without social interaction with others explaining what you missed, stuffs you overlooked, etc. You are overgeneralizing. You are assuming that it's easier for everybody to interact with humans rather than the Tao of

Re: [PATCH 0/4] remote-hg: more improvements

2014-05-14 Thread David Kastrup
Philippe Vaucher philippe.vauc...@gmail.com writes: I'm sorry that my words aren't clear enough for you to infer the point I'm trying to make. Let's try something simpler: what I was saying is that bad behavior will get you into trouble when contributing (and thus it's important to behave

Re: [PATCH v6 02/42] refs.c: allow passing NULL to ref_transaction_free

2014-05-14 Thread Ronnie Sahlberg
Thanks. I changed the commit message. On Tue, May 13, 2014 at 3:44 PM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: Allow ref_transaction_free to be called with NULL and in extension allow ref_transaction_rollback to be called for a NULL transaction. In extension = as a

Re: [PATCH v6 03/42] refs.c: add a strbuf argument to ref_transaction_commit for error logging

2014-05-14 Thread Ronnie Sahlberg
Thanks. Comment added and whitespace fixed. On Tue, May 13, 2014 at 4:10 PM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: Add a strbuf argument to _commit so that we can pass an error string back to the caller. So that we can do error logging from the caller instead of

Re: [PATCH v6 04/42] refs.c: make ref_update_reject_duplicates take a strbuf argument for errors

2014-05-14 Thread Ronnie Sahlberg
Thanks. I updated the commit message to highlight that this means the error string can now be passed all the way back to the caller. On Tue, May 13, 2014 at 5:04 PM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: Make ref_update_reject_duplicates return any error that occurs

Please pull the patch series use the $( ... ) construct for command substitution

2014-05-14 Thread Elia Pinto
The following changes since commit 6308767f0bb58116cb405e1f4f77f5dfc1589920: Merge branch 'fc/prompt-zsh-read-from-file' (2014-05-13 11:53:14 -0700) are available in the git repository at: https://github.com/devzero2000/git-core.git ep/shell-command-substitution-v4 for you to fetch

[PATCH] grep -I: do not bother to read known-binary files

2014-05-14 Thread Stepan Kasal
From: Johannes Schindelin johannes.schinde...@gmx.de Date: Mon, 8 Nov 2010 16:10:43 +0100 Incidentally, this makes grep -I respect the binary attribute (actually, the -text attribute, but binary implies that). Since the attributes are not thread-safe, we now need to switch off threading if -I

[PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

2014-05-14 Thread Stepan Kasal
From: Johannes Schindelin johannes.schinde...@gmx.de Date: Tue, 8 Feb 2011 00:17:24 -0600 Signed-off-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Stepan Kasal ka...@ucw.cz --- Hi, this patch has been in msysgit for 3 1/4 years. Stepan builtin/grep.c | 3 +++ 1 file

Re: [GUILT v2 28/29] Added guilt.reusebranch configuration option.

2014-05-14 Thread Jeff Sipek
On Tue, May 13, 2014 at 10:31:04PM +0200, Per Cederqvist wrote: When the option is true (the default), Guilt does not create a new Git branch when patches are applied. This way, you can switch between Guilt 0.35 and the current version of Guilt with no issues. At a future time, maybe a year

Re: [PATCH 0/4] remote-hg: more improvements

2014-05-14 Thread Philippe Vaucher
I'm sorry that my words aren't clear enough for you to infer the point I'm trying to make. Let's try something simpler: what I was saying is that bad behavior will get you into trouble when contributing (and thus it's important to behave nicely), where Felipe usualy says bad behavior is

Re: [PATCH] contrib: remote-helpers: add move warnings (v2.0)

2014-05-14 Thread Ronnie Sahlberg
On Tue, May 13, 2014 at 4:37 PM, Felipe Contreras felipe.contre...@gmail.com wrote: Ronnie Sahlberg wrote: Could you please calm down and adjust your behavior. This constant hostility and rudeness makes the mailing list very unpleasant. I explaind that to him multiple times. In the mail I

Re: [GUILT v2 08/29] Added more test cases for guilt new: empty patches.

2014-05-14 Thread Jeff Sipek
On Tue, May 13, 2014 at 10:30:44PM +0200, Per Cederqvist wrote: Test that empty patches are handled correctly, both with and without the guilt.diffstat configuration option. Signed-off-by: Per Cederqvist ced...@opera.com --- regression/t-020.out | 250

Re: Please pull the patch series use the $( ... ) construct for command substitution

2014-05-14 Thread Matthieu Moy
Elia Pinto gitter.spi...@gmail.com writes: The following changes since commit 6308767f0bb58116cb405e1f4f77f5dfc1589920: Merge branch 'fc/prompt-zsh-read-from-file' (2014-05-13 11:53:14 -0700) are available in the git repository at: https://github.com/devzero2000/git-core.git

Re: t5539 fails on ubuntu for v2.0.0-rc2

2014-05-14 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Sat, May 10, 2014 at 10:02:59AM -0400, Jeff King wrote: On Fri, May 09, 2014 at 02:08:27PM -0700, Junio C Hamano wrote: 3. Just disable the http tests when run as root. I think I'd favor 3. But I'd like to be sure that being root is the

Re: [PATCH] grep -I: do not bother to read known-binary files

2014-05-14 Thread Junio C Hamano
Stepan Kasal ka...@ucw.cz writes: From: Johannes Schindelin johannes.schinde...@gmx.de Date: Mon, 8 Nov 2010 16:10:43 +0100 Incidentally, this makes grep -I respect the binary attribute (actually, the -text attribute, but binary implies that). Since the attributes are not thread-safe, we

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

2014-05-14 Thread Junio C Hamano
Stepan Kasal ka...@ucw.cz writes: From: Johannes Schindelin johannes.schinde...@gmx.de Date: Tue, 8 Feb 2011 00:17:24 -0600 Signed-off-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Stepan Kasal ka...@ucw.cz --- Hi, this patch has been in msysgit for 3 1/4 years.

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

2014-05-14 Thread Matthieu Moy
Junio C Hamano gits...@pobox.com writes: Stepan Kasal ka...@ucw.cz writes: From: Johannes Schindelin johannes.schinde...@gmx.de Date: Tue, 8 Feb 2011 00:17:24 -0600 Signed-off-by: Johannes Schindelin johannes.schinde...@gmx.de Signed-off-by: Stepan Kasal ka...@ucw.cz --- Hi, this patch

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

2014-05-14 Thread Jonathan Nieder
Hi, Junio C Hamano wrote: Stepan Kasal ka...@ucw.cz writes: --- a/builtin/grep.c +++ b/builtin/grep.c @@ -897,6 +897,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix) if (len 4 is_dir_sep(pager[len - 5])) pager += len - 4; +

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

2014-05-14 Thread Stepan Kasal
Hello, On Wed, May 14, 2014 at 11:26:54AM -0700, Jonathan Nieder wrote: But as is, it's an improvement, so (except that -i should be replaced by -I) it seems like a good change. indeed, -I would match the semantics of git-grep -i . Stepan -- To unsubscribe from this list: send the line

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

2014-05-14 Thread Junio C Hamano
Jonathan Nieder jrnie...@gmail.com writes: + if (opt.ignore_case !strcmp(less, pager)) + string_list_append(path_list, -i); I have a feeling that this goes against the recent trend of not mucking with the expectation of the users on their pagers, if I recall

[PATCH/RFC] Gitweb: Convert UTF-8 encoded file names

2014-05-14 Thread Michael Wagner
Perl has an internal encoding used to store text strings. Currently, trying to view files with UTF-8 encoded names results in an error (either 404 - Cannot find file [blob_plain] or XML Parsing Error [blob]). Converting these UTF-8 encoded file names into Perl's internal format resolves these

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

2014-05-14 Thread Jeff King
On Wed, May 14, 2014 at 11:26:54AM -0700, Jonathan Nieder wrote: git grep has other options that affect interpretation of the pattern which this patch does not help with: * -v / --ignore-match: probably should disable this feature of -O. * -E / --extended-regexp * -P / --perl-regexp *

Re: [PATCH] contrib: remote-helpers: add move warnings (v2.0)

2014-05-14 Thread Junio C Hamano
Marius Storm-Olsen msto...@gmail.com writes: On 5/13/2014 5:47 PM, Felipe Contreras wrote: I was going to do more than pointing to commits, I was going to provide the fixes with test cases and a detailed explanation. But then you made your decision. I believe the regression in question,

Re: [GIT GUI PATCH] git-gui: use vcompare when comparing the git version

2014-05-14 Thread Junio C Hamano
Jens Lehmann jens.lehm...@web.de writes: Junio, I believe this issue needs to be fixed before 2.0 final. Otherwise git gui will not work inside submodules anymore due to the major version number change from 1 to 2. I'd like to hear Pat's opinion on this; even though I think my patch is less

Re: t5539 fails on ubuntu for v2.0.0-rc2

2014-05-14 Thread Jeff King
On Wed, May 14, 2014 at 10:11:11AM -0700, Junio C Hamano wrote: A bit more disturbing is that I did not get the impression that we know the exact reason why these http tests, especially the getwpuid call, fail for Fabio when run as root. And if my impression is correct, then do not run tests

Re: [PATCH] contrib: remote-helpers: add move warnings (v2.0)

2014-05-14 Thread Felipe Contreras
Ronnie Sahlberg wrote: On Tue, May 13, 2014 at 4:37 PM, Felipe Contreras felipe.contre...@gmail.com wrote: But if I have to adjust for saying that (which was true), what do you say to Junio for saying this? (which was not) I know I shouldn't but I will respond anyway. The problem is

Re: [PATCH] grep -I: do not bother to read known-binary files

2014-05-14 Thread Jeff King
On Wed, May 14, 2014 at 05:44:19PM +0200, Stepan Kasal wrote: From: Johannes Schindelin johannes.schinde...@gmx.de Date: Mon, 8 Nov 2010 16:10:43 +0100 Incidentally, this makes grep -I respect the binary attribute (actually, the -text attribute, but binary implies that). Since the

Re: [PATCH] grep -I: do not bother to read known-binary files

2014-05-14 Thread Jeff King
On Wed, May 14, 2014 at 10:52:28AM -0700, Junio C Hamano wrote: I do not think checking 'text' is the right way to do this. The attribute controls the eof normalization, and people sometimes want to keep CRLF terminated files in the repository no matter what the platform is (an example I

Re: [PATCH v2 01/17] contrib: remove outdated README

2014-05-14 Thread Felipe Contreras
Philippe Vaucher wrote: I have had patches and contributions rejected in the past, sometimes rudely. Same has happened to many others, if you contribute long enough, it is pretty much guaranteed that it will happen to you. Maintainer is wrong, or you are wrong, or someone is just having a

Re: [PATCH] contrib: remote-helpers: add move warnings (v2.0)

2014-05-14 Thread Felipe Contreras
Junio C Hamano wrote: So at this point, I would have to say that the users of remote-hg is taken hostage by its author. The users of remote-hg are being affected negatively *because* of your decisions. You have the power to help them by answering a simple question. Yet you refuse to do that.

Re: [PATCH v2 01/17] contrib: remove outdated README

2014-05-14 Thread Martin Langhoff
On Wed, May 14, 2014 at 3:35 PM, Felipe Contreras felipe.contre...@gmail.com wrote: You are not paying attention at all. Junio may have been trying to be polite and not tell you directly that attitude was a factor. Whatever. He is the maintainer. Of all the folks in this list, he gets to call

Re: [PATCH] contrib: remote-helpers: add move warnings (v2.0)

2014-05-14 Thread Junio C Hamano
Felipe Contreras felipe.contre...@gmail.com writes: Junio C Hamano wrote: So at this point, I would have to say that the users of remote-hg is taken hostage by its author. The users of remote-hg are being affected negatively *because* of your decisions. You have the power to help them by

Re: [PATCH v2 01/17] contrib: remove outdated README

2014-05-14 Thread Jeff King
On Wed, May 14, 2014 at 02:35:08PM -0500, Felipe Contreras wrote: Prior to his decision there were no complaints about my manners since I returned. It was his *TECHNICAL* decision that triggered this. There have been several complaints about your behavior since you returned[1,2,3,4], in

Re: [PATCH 0/4] remote-hg: more improvements

2014-05-14 Thread Felipe Contreras
Philippe Vaucher wrote: I'm sorry that my words aren't clear enough for you to infer the point I'm trying to make. Let's try something simpler: what I was saying is that bad behavior will get you into trouble when contributing (and thus it's important to behave nicely), where Felipe usualy

Re: [GUILT v2 08/29] Added more test cases for guilt new: empty patches.

2014-05-14 Thread Per Cederqvist
On Wed, May 14, 2014 at 7:10 PM, Jeff Sipek jef...@josefsipek.net wrote: On Tue, May 13, 2014 at 10:30:44PM +0200, Per Cederqvist wrote: Test that empty patches are handled correctly, both with and without the guilt.diffstat configuration option. Signed-off-by: Per Cederqvist ced...@opera.com

Re: [PATCH 0/4] remote-hg: more improvements

2014-05-14 Thread David Kastrup
Felipe Contreras felipe.contre...@gmail.com writes: Philippe Vaucher wrote: [...] Do you feel Felipe is in control of what you label bad behavior? Do you feel you are in control over how you react to his behavior? I feel that Felipe cannot control this (or decided not to), I am

Re: [PATCH v2 01/17] contrib: remove outdated README

2014-05-14 Thread Junio C Hamano
Felipe Contreras felipe.contre...@gmail.com writes: Philippe Vaucher wrote: I have had patches and contributions rejected in the past, sometimes rudely. Same has happened to many others, if you contribute long enough, it is pretty much guaranteed that it will happen to you. Maintainer is

Re: [PATCH] contrib: remote-helpers: add move warnings (v2.0)

2014-05-14 Thread Felipe Contreras
Junio C Hamano wrote: Felipe Contreras felipe.contre...@gmail.com writes: Junio C Hamano wrote: So at this point, I would have to say that the users of remote-hg is taken hostage by its author. The users of remote-hg are being affected negatively *because* of your decisions. You

Re: [PATCH] grep -I: do not bother to read known-binary files

2014-05-14 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Wed, May 14, 2014 at 05:44:19PM +0200, Stepan Kasal wrote: From: Johannes Schindelin johannes.schinde...@gmx.de Date: Mon, 8 Nov 2010 16:10:43 +0100 Incidentally, this makes grep -I respect the binary attribute (actually, the -text attribute, but binary

[PATCH v7 10/42] refs.c: ref_transaction_delete to check for error and return status

2014-05-14 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. Signed-off-by: Ronnie Sahlberg

[PATCH v7 15/42] fast-import.c: change update_branch to use ref transactions

2014-05-14 Thread Ronnie Sahlberg
Change update_branch() to use ref transactions for updates. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- fast-import.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/fast-import.c b/fast-import.c index 6707a66..79d219b 100644 ---

[PATCH v7 17/42] refs.c: change update_ref to use a transaction

2014-05-14 Thread Ronnie Sahlberg
Change the update_ref helper function to use a ref transaction internally. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c index 64e3d53..55aa5a9 100644 --- a/refs.c +++

[PATCH v7 19/42] refs.c: ref_transaction_commit should not free the transaction

2014-05-14 Thread Ronnie Sahlberg
Change ref_transaction_commit so that it does not free the transaction. Instead require that a caller will end a transaction by either calling ref_transaction_rollback or ref_transaction_free. By having the transaction object remaining valid after _commit returns allows us to write much nicer

[PATCH v7 16/42] branch.c: use ref transaction for all ref updates

2014-05-14 Thread Ronnie Sahlberg
Change create_branch to use a ref transaction when creating the new branch. ref_transaction_create will check that the ref does not already exist and fail otherwise meaning that we no longer need to keep a lock on the ref during the setup_tracking. This simplifies the code since we can now do the

[PATCH v7 36/42] refs.c: pack all refs before we start to rename a ref

2014-05-14 Thread Ronnie Sahlberg
This means that most loose refs will no longer be present after the rename which triggered a test failure since it assumes the file for an unrelated ref would still be present after the rename. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c| 3 +++ t/t3200-branch.sh |

[PATCH v7 38/42] refs.c: call lock_ref_sha1_basic directly from commit

2014-05-14 Thread Ronnie Sahlberg
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 --- refs.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/refs.c b/refs.c index 6556417..a376dd6

[PATCH v7 37/42] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-05-14 Thread Ronnie Sahlberg
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 leaves lock_any_ref_for_updates as a no-op wrapper which could be removed. But this wrapper is also called from an external

[PATCH v7 31/42] refs.c: remove lock_ref_sha1

2014-05-14 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. Signed-off-by: Ronnie Sahlberg

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

2014-05-14 Thread Ronnie Sahlberg
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 transaction. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- branch.c

[PATCH v7 35/42] refs.c: pass NULL as *flags to read_ref_full

2014-05-14 Thread Ronnie Sahlberg
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 --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs.c b/refs.c

[PATCH v7 32/42] refs.c: make prune_ref use a transaction to delete the ref

2014-05-14 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. Signed-off-by: Ronnie

[PATCH v7 42/42] refs.c: remove forward declaration of write_ref_sha1

2014-05-14 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/refs.c b/refs.c index 8e12386..aed700b 100644 --- a/refs.c +++ b/refs.c @@ -260,8 +260,6 @@ struct ref_entry { }; static void read_loose_refs(const char *dirname, struct ref_dir

[PATCH v7 23/42] receive-pack.c: use a reference transaction for updating the refs

2014-05-14 Thread Ronnie Sahlberg
Wrap all the ref updates inside a transaction to make the update atomic. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/receive-pack.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index

[PATCH v7 33/42] refs.c: make delete_ref use a transaction

2014-05-14 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. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 31 ++- 1 file changed, 10

[PATCH v7 22/42] fetch.c: use a single ref transaction for all ref updates

2014-05-14 Thread Ronnie Sahlberg
Change store_updated_refs to use a single ref transaction for all refs that are updated during the fetch. This makes the fetch more atomic when update failures occur. Since ref update failures will now no longer occur in the code path for updating a single ref in s_update_ref, we no longer have

[PATCH v7 21/42] fetch.c: change s_update_ref to use a ref transaction

2014-05-14 Thread Ronnie Sahlberg
Change s_update_ref to use a ref transaction for the ref update. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/fetch.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index a93c893..b41d7b7 100644 ---

[PATCH v7 28/42] refs.c: add transaction.status and track OPEN/CLOSED/ERROR

2014-05-14 Thread Ronnie Sahlberg
Track the status of a transaction in a new status field. Check the field for sanity, i.e. that status 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 | 37 + 1

[PATCH v7 14/42] sequencer.c: use ref transactions for all ref updates

2014-05-14 Thread Ronnie Sahlberg
Change to use ref transactions for all updates to refs. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- sequencer.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/sequencer.c b/sequencer.c index 0a80c58..9282a12 100644 --- a/sequencer.c +++

[PATCH v7 30/42] refs.c: remove the update_ref_write function

2014-05-14 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. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 35 +-- 1 file changed, 9

[PATCH v7 29/42] refs.c: remove the update_ref_lock function

2014-05-14 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. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 30 ++ 1 file changed, 6

[PATCH v7 41/42] refs.c: make rename_ref use a transaction

2014-05-14 Thread Ronnie Sahlberg
Change rename_ref to use a single transaction to perform the ref rename. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 73 ++ 1 file changed, 20 insertions(+), 53 deletions(-) diff --git a/refs.c b/refs.c index

[PATCH v7 25/42] walker.c: use ref transaction for ref updates

2014-05-14 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. This changes the

[PATCH v7 27/42] refs.c: make lock_ref_sha1 static

2014-05-14 Thread Ronnie Sahlberg
No external callers reference lock_ref_sha1 any more so lets declare it static. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 2 +- refs.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/refs.c b/refs.c index 0e88197..b7fa79b 100644 --- a/refs.c +++

[PATCH v7 40/42] refs.c: pass a skip list to name_conflict_fn

2014-05-14 Thread Ronnie Sahlberg
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, guarantees that m is a packed refs and there is no loose ref for m 2, the transaction

[PATCH v7 39/42] refs.c: add a new flag for transaction delete for refs we know are packed only

2014-05-14 Thread Ronnie Sahlberg
Add a new flag REF_ISPACKONLY that we can use in ref_transaction_delete. This flag indicates that the ref does not exist as a loose ref andf only as a packed ref. If this is the case we then change the commit code so that we skip taking out a lock file and we skip calling delete_ref_loose. Check

[PATCH v7 26/42] refs.c: make write_ref_sha1 static

2014-05-14 Thread Ronnie Sahlberg
No external users call write_ref_sha1 any more so lets declare it static. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 4 +++- refs.h | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c index 4673cf4..0e88197 100644 --- a/refs.c +++ b/refs.c

[PATCH v7 24/42] fast-import.c: use a ref transaction when dumping tags

2014-05-14 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- fast-import.c | 17 - 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/fast-import.c b/fast-import.c index 3e356da..5587cf6 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1736,15 +1736,22 @@ static void

[PATCH v7 08/42] refs.c: change ref_transaction_update() to do error checking and return status

2014-05-14 Thread Ronnie Sahlberg
Update ref_transaction_update() do some basic error checking and return non-zero on error. Update all callers to check ref_transaction_update() for error. There are currently no conditions in _update that will return error but there will be in the future. Also check for BUGs during update and

[PATCH v7 07/42] refs.c: remove the onerr argument to ref_transaction_commit

2014-05-14 Thread Ronnie Sahlberg
Since all callers now use QUIET_ON_ERR we no longer need to provide an onerr argument any more. Remove the onerr argument from the ref_transaction_commit signature. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/update-ref.c | 3 +-- refs.c | 22

Re: Please pull the patch series use the $( ... ) construct for command substitution

2014-05-14 Thread Eric Sunshine
On Wed, May 14, 2014 at 1:14 PM, Matthieu Moy matthieu@grenoble-inp.fr wrote: Elia Pinto gitter.spi...@gmail.com writes: The following changes since commit 6308767f0bb58116cb405e1f4f77f5dfc1589920: Merge branch 'fc/prompt-zsh-read-from-file' (2014-05-13 11:53:14 -0700) are available in

[PATCH v7 11/42] tag.c: use ref transactions when doing updates

2014-05-14 Thread Ronnie Sahlberg
Change tag.c to use ref transactions for all ref updates. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/tag.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/builtin/tag.c b/builtin/tag.c index c6e8a71..bf2a5c3 100644 --- a/builtin/tag.c +++

[PATCH v7 09/42] refs.c: change ref_transaction_create to do error checking and return status

2014-05-14 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. Signed-off-by: Ronnie Sahlberg

[PATCH v7 00/42] Use ref transactions for all ref updates

2014-05-14 Thread Ronnie Sahlberg
This patch series can also be found at https://github.com/rsahlberg/git/tree/ref-transactions This patch series is based on next and expands on the transaction API. It converts all ref updates, inside refs.c as well as external, to use the transaction API for updates. This makes most of the ref

[PATCH v7 06/42] refs.c: make update_ref_write update a strbuf on failure

2014-05-14 Thread Ronnie Sahlberg
Change update_ref_write to also update an error strbuf on failure. This makes the error available to ref_transaction_commit callers if the transaction failed due to update_ref_sha1/write_ref_sha1 failures. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 9 ++--- 1 file

[PATCH v7 01/42] refs.c: constify the sha arguments for ref_transaction_create|delete|update

2014-05-14 Thread Ronnie Sahlberg
ref_transaction_create|delete|update has no need to modify the sha1 arguments passed to it so it should use const unsigned char* instead of unsigned char*. Some functions, such as fast_forward_to(), already have its old/new sha1 arguments as consts. This function will at some point need to use

[PATCH v7 12/42] replace.c: use the ref transaction functions for updates

2014-05-14 Thread Ronnie Sahlberg
Update replace.c to use ref transactions for updates. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/replace.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/builtin/replace.c b/builtin/replace.c index 3da1bae..11dc2e1 100644 ---

[PATCH v7 13/42] commit.c: use ref transactions for updates

2014-05-14 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. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/commit.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-)

[PATCH v7 03/42] refs.c: add a strbuf argument to ref_transaction_commit for error logging

2014-05-14 Thread Ronnie Sahlberg
Add a strbuf argument to _commit so that we can pass an error string back to the caller. So that we can do error logging from the caller instead of from _commit. Longer term plan is to first convert all callers to use onerr==QUIET_ON_ERR and craft any log messages from the callers themselves and

[PATCH v7 02/42] refs.c: allow passing NULL to ref_transaction_free

2014-05-14 Thread Ronnie Sahlberg
Allow ref_transaction_free to be called with NULL and as a result allow ref_transaction_rollback to be called for a NULL transaction. This allows us to write code that will if ( (!transaction || ref_transaction_update(...)) || (ref_transaction_commit(...) !(transaction = NULL))

[PATCH v7 18/42] refs.c: free the transaction before returning when number of updates is 0

2014-05-14 Thread Ronnie Sahlberg
We have to free the transaction before returning in the early check for 'return early if number of updates == 0' or else the following code would create a memory leak with the transaction never being freed : t = ref_transaction_begin() ref_transaction_commit(t) Signed-off-by: Ronnie

  1   2   >