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

2014-05-15 Thread David Kastrup
Felipe Contreras felipe.contre...@gmail.com writes: David Kastrup wrote: Shouting your God is an imaginary shithead every time you see Mark There's no point in discussing with an unconstructive person as you. So go to a constructive person you call your friend and show him one of your calm

RE: [PATCH] transport-helper: add trailing --

2014-05-15 Thread Felipe Contreras
Stepan Kasal wrote: From: Sverre Rabbelier srabbel...@gmail.com Date: Sat, 28 Aug 2010 20:49:01 -0500 [PT: ensure we add an additional element to the argv array] Signed-off-by: Stepan Kasal ka...@ucw.cz --- Hi, this patch was present in msysgit from Mar 2012. Do you like it?

RE: [PATCH/RFC] Always auto-gc after calling a fast-import transport

2014-05-15 Thread Felipe Contreras
Stepan Kasal wrote: From: Johannes Schindelin johannes.schinde...@gmx.de Date: Mon, 9 Apr 2012 13:04:35 -0500 After importing anything with fast-import, we should always let the garbage collector do its job, since the objects are written to disk inefficiently. I'm not sure how slow `git gc

[no subject]

2014-05-15 Thread Christian Organization
We are Christian organization, we give loan or financial help to those in need, contact us at marieloanlend...@gmail.com -- 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: [GUILT v2 28/29] Added guilt.reusebranch configuration option.

2014-05-15 Thread Per Cederqvist
On Wed, May 14, 2014 at 5:53 PM, Jeff Sipek jef...@josefsipek.net wrote: 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

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

2014-05-15 Thread Matthieu Moy
Eric Sunshine sunsh...@sunshineco.com writes: On Wed, May 14, 2014 at 1:14 PM, Matthieu Moy I do not understand the use of the \ in front of the ` in the original code. The second argument of test_expect_success is double-quoted, so a bare `...` would be evaluated before

[RFC/PATCH 0/6] build argv_array into run-command

2014-05-15 Thread Jeff King
The memory ownership of the argv array of a struct child_process can be tricky. The child_process does not own the memory, but it must remain valid until finish_command runs. That's easy for cases where we call start_command and finish_command in the same function: you can use a local array

[PATCH 1/6] run-command: store an optional argv_array

2014-05-15 Thread Jeff King
All child_process structs need to point to an argv. For flexibility, we do not mandate the use of a dynamic argv_array. However, because the child_process does not own the memory, this can make memory management with a separate argv_array difficult. For example, if a function calls start_command

[PATCH 2/6] run_column_filter: use argv_array

2014-05-15 Thread Jeff King
We currently set up the argv array by hand in a fixed-size stack-local array. Using an argv array is more readable, as it handles buffer allocation us (not to mention makes it obvious we do not overflow the array). However, there's a more subtle benefit, too. We leave the function having run

[PATCH 5/6] get_exporter: use argv_array

2014-05-15 Thread Jeff King
This simplifies the code and avoids a fixed array size that we might accidentally overflow. It also prevents a leak after finish_command is run, by using the argv_array that run-command manages for us. Signed-off-by: Jeff King p...@peff.net --- transport-helper.c | 26 ++

[PATCH 3/6] git_connect: use argv_array

2014-05-15 Thread Jeff King
This avoids magic numbers when we allocate fixed-size argv arrays, and makes it more obvious that we are not overflowing. It is also the first step to fixing a memory leak. When git_connect returns a child_process struct, the argv array in the struct is dynamically allocated, but the individual

[PATCH 4/6] get_helper: use run-command's internal argv_array

2014-05-15 Thread Jeff King
The get_helper functions dynamically allocates an argv_array, feeds it to start_command, and then returns. We then have to later clean up the memory manually after calling finish_command. We can make this simpler by just using run-command's internal argv_array, which handles cleanup for us. This

[PATCH 6/6] get_importer: use run-command's internal argv_array

2014-05-15 Thread Jeff King
This saves a few lines and lets us avoid having to clean up the memory manually when the command finishes. Signed-off-by: Jeff King p...@peff.net --- transport-helper.c | 9 +++-- 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/transport-helper.c b/transport-helper.c index

[PATCH 7/6] argv-array: drop detach code

2014-05-15 Thread Jeff King
The argv_array_detach function (and associated free() function) was really only useful for transferring ownership of the memory to a struct child_process. Now that we have an internal argv_array in that struct, there are no callers left. Signed-off-by: Jeff King p...@peff.net --- This is a bonus

[PATCH] open_sha1_file: report most interesting errno

2014-05-15 Thread Jeff King
When we try to open a loose object file, we first attempt to open in the local object database, and then try any alternates. This means that the errno value when we return will be from the last place we looked (and due to the way the code is structured, simply ENOENT if we do not have have any

Re: [PATCH] transport-helper: add trailing --

2014-05-15 Thread Jeff King
On Thu, May 15, 2014 at 07:32:14AM +0200, Stepan Kasal wrote: From: Sverre Rabbelier srabbel...@gmail.com Date: Sat, 28 Aug 2010 20:49:01 -0500 [PT: ensure we add an additional element to the argv array] Signed-off-by: Stepan Kasal ka...@ucw.cz --- Hi, this patch was present in

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

2014-05-15 Thread Peter Krefting
Michael Wagner: Decoding the UTF-8 encoded file name (again with an additional print statement): $ REQUEST_METHOD=GET QUERY_STRING='p=notes.git;a=blob_plain;f=work/G%C3%83%C2%BCtekriterien.txt;hb=HEAD' ./gitweb.cgi work/Gütekriterien.txt Content-disposition: inline;

Re: [PATCH] transport-helper: add trailing --

2014-05-15 Thread Stepan Kasal
Hi Peff, On Thu, May 15, 2014 at 05:00:13AM -0400, Jeff King wrote: I just posted a series that addresses those leaks and converts this site. I do not want to hold your patch hostage to my series, [...] no problem, let's return to it later. Stepan -- To unsubscribe from this list: send the

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

2014-05-15 Thread Jakub Narębski
On Thu, May 15, 2014 at 7:08 AM, Michael Wagner accou...@mwagner.org wrote: On Thu, May 15, 2014 at 12:25:45AM +0200, Jakub Narębski wrote: On Wed, May 14, 2014 at 11:57 PM, Junio C Hamano gits...@pobox.com wrote: Michael Wagner accou...@mwagner.org writes: Perl has an internal encoding used

[PATCH 09/10] git-rebase--interactive.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 03/10] contrib/examples/git-commit.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 07/10] git-bisect.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 01/10] check_bindir: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 04/10] contrib/examples/git-merge.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 05/10] contrib/examples/git-repack.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 02/10] contrib/examples/git-clone.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 08/10] git-mergetool.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 10/10] git-submodule.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 06/10] contrib/examples/git-resolve.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

Re: [PATCH 10/10] git-submodule.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
I am very sorry : the comment is wrong. I will repost shortly. Best regards 2014-05-15 16:17 GMT+02:00 Elia Pinto gitter.spi...@gmail.com: Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow:

[PATCH 01/10] check_bindir: don't use the -a or -o option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 05/10] contrib/examples/git-repack.sh: don't use the -a or -o option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 08/10] git-mergetool.sh: don't use the -a or -o option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 04/10] contrib/examples/git-merge.sh: don't use the -a or -o option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 03/10] contrib/examples/git-commit.sh: don't use the -a or -o option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 06/10] contrib/examples/git-resolve.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 09/10] git-rebase--interactive.sh: don't use the -a or -o option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 10/10] git-submodule.sh: don't use the -a or -o option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 02/10] contrib/examples/git-clone.sh: don't use the -a or -o option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

[PATCH 07/10] git-bisect.sh: don't use the -a or -o option with the test command

2014-05-15 Thread Elia Pinto
Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be written as: test $1 test $2 But note that, in test, -a

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

2014-05-15 Thread Jeff Sipek
On Thu, May 15, 2014 at 09:37:05AM +0200, Per Cederqvist wrote: On Wed, May 14, 2014 at 5:53 PM, Jeff Sipek jef...@josefsipek.net wrote: On Tue, May 13, 2014 at 10:31:04PM +0200, Per Cederqvist wrote: ... + +for i in `seq 5`; do + if [ $i -ge 5 ]; then + shouldfail guilt

Re: [PATCH v6 05/42] update-ref.c: log transaction error from the update_ref

2014-05-15 Thread Ronnie Sahlberg
On Wed, May 14, 2014 at 3:08 PM, Jonathan Nieder jrnie...@gmail.com wrote: Hi, Ronnie Sahlberg wrote: --- a/builtin/update-ref.c +++ b/builtin/update-ref.c @@ -342,6 +342,7 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix) [...] @@ -359,17 +360,16 @@ int

Kedves felhasználók e-mailben;

2014-05-15 Thread administrator WebMail
-- Kedves felhasználók e-mailben; Túllépte 23432 box set Web Service / Admin, és akkor nem lesz probléma a küldő és fogadhat e-maileket, amíg újra ellenőrizni. Kérjük, frissítse kattintva linkre, és töltse ki az adatokat, hogy ellenőrizze a számla Kérjük, kövesse az alábbi linkre, és majd

Re: [PATCH 10/10] git-submodule.sh: don't use the -a or -b option with the test command

2014-05-15 Thread Jonathan Nieder
Elia Pinto wrote: Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: [... many lines snipped ...] This is a very long description, and it doesn't leave me excited by the change. Is there some

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

2014-05-15 Thread Ronnie Sahlberg
On Wed, May 14, 2014 at 4:40 PM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: Update ref_transaction_update() do some basic error checking and return true on error. Update all callers to check ref_transaction_update() for error. There are currently no conditions in

[PATCH] bzr per-file comments in git-remote-bzr

2014-05-15 Thread Sergei Golubchik
From 7fd7360ef5b4f453ceb8e32b18f73f9fbcaa95b7 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik vuv...@gmail.com Date: Thu, 15 May 2014 17:50:16 +0200 Subject: [PATCH] git-remote-bzr: support bzr per-file comments Bazaar supports per-file comments in revisions - using bzr-gtk one can write a global

Re: [PATCH 01/10] check_bindir: don't use the -a or -o option with the test command

2014-05-15 Thread Matthieu Moy
Elia Pinto gitter.spi...@gmail.com writes: $ test -z $x -a a = b bash: test: too many arguments because it groups test -n = -a and is left with a = b. I guess you meant -z, not -n. -- Matthieu Moy http://www-verimag.imag.fr/~moy/ -- To unsubscribe from this list: send the line

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

2014-05-15 Thread Ronnie Sahlberg
On Wed, May 14, 2014 at 5:04 PM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: Do basic error checking in ref_transaction_create() and make it return status. Update all callers to check the result of ref_transaction_create() There are currently no conditions in _create that

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

2014-05-15 Thread Ronnie Sahlberg
On Wed, May 14, 2014 at 5:19 PM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: Change ref_transaction_delete() to do basic error checking and return status. Update all callers to check the return for ref_transaction_delete() There are currently no conditions in _delete that

Re: [PATCH v3] git-show: fix 'git show -s' to not add extra terminator after merge commit

2014-05-15 Thread Junio C Hamano
Thanks, will replace the topic. -- 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] run_diff_files: do not look at uninitialized stat data

2014-05-15 Thread Junio C Hamano
Jeff King p...@peff.net writes: Thanks for a thorough bug report. I was able to reproduce it. The ... -- 8 -- Subject: run_diff_files: do not look at uninitialized stat data ... We can fix both by splitting the CE_VALID and regular code paths, and making sure only to look at the stat

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

2014-05-15 Thread Ronnie Sahlberg
On Wed, May 14, 2014 at 5:27 PM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: --- a/builtin/tag.c +++ b/builtin/tag.c @@ -701,11 +702,12 @@ int cmd_tag(int argc, const char **argv, const char *prefix) if (annotate) create_tag(object, tag, buf, opt,

Re: [RFC/PATCH 0/6] build argv_array into run-command

2014-05-15 Thread Junio C Hamano
Jeff King p...@peff.net writes: The memory ownership of the argv array of a struct child_process can be tricky. The child_process does not own the memory, but it must remain valid until finish_command runs. That's easy for cases where we call start_command and finish_command in the same

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

2014-05-15 Thread Ronnie Sahlberg
On Wed, May 14, 2014 at 5:30 PM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: [...] +++ b/builtin/replace.c [...] @@ -157,11 +158,12 @@ static int replace_object(const char *object_ref, const char *replace_ref, else if (!force) die(replace ref '%s'

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

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: Instead of the suggestions above, would you accept an alternative approach where I would add an err argument to ref_transaction_begin() instead? For a hypothetical mysql backend, this could then do something like : [...] fatal: refs/heads/master: cannot update the

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

2014-05-15 Thread Ronnie Sahlberg
On Wed, May 14, 2014 at 6:11 PM, Jonathan Nieder jrnie...@gmail.com wrote: Ronnie Sahlberg wrote: [...] +++ b/builtin/commit.c @@ -1541,11 +1541,12 @@ int cmd_commit(int argc, const char **argv, const char *prefix) [...] @@ -1667,16 +1668,6 @@ int cmd_commit(int argc, const char **argv,

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

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: On Wed, May 14, 2014 at 5:04 PM, Jonathan Nieder jrnie...@gmail.com wrote: If it were ever triggered, the message error: some bad thing fatal: failed transaction create for refs/heads/master looks overly verbose and unclear. Something like

Re: [PATCH] open_sha1_file: report most interesting errno

2014-05-15 Thread Junio C Hamano
Jeff King p...@peff.net writes: When we try to open a loose object file, we first attempt to open in the local object database, and then try any alternates. This means that the errno value when we return will be from the last place we looked (and due to the way the code is structured, simply

Re: [PATCH 01/10] check_bindir: don't use the -a or -o option with the test command

2014-05-15 Thread Junio C Hamano
Elia Pinto gitter.spi...@gmail.com writes: Even though POSIX.1 lists -a/-o as options to test, they are marked Obsolescent XSI. Scripts using these expressions should be converted as follow: test $1 -a $2 should be written as: test $1 test $2 Likewise test $1 -o $2 should be

regression: request-pull with signed tag lacks tags/ in master

2014-05-15 Thread Michael S. Tsirkin
looks like pull requests with signed git got broken in git master: [mst@robin qemu]$ /usr/bin/git --version git version 1.8.3.1 [mst@robin qemu]$ git --version git version 2.0.0.rc1.18.gac53fc6.dirty [mst@robin qemu]$ [mst@robin qemu]$ /usr/bin/git request-pull origin/master

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

2014-05-15 Thread Junio C Hamano
Peter Krefting pe...@softwolves.pp.se writes: What is happening is that whatever is generating the URI us UTF-8-encoding the string twice (i.e., it generates a string with the proper C3 BC in it, and then interprets it as iso-8859-1 data and runs that through a UTF-8 encoder again, yielding

[PATCH v8 04/44] refs.c: add an err argument to repack_without_refs

2014-05-15 Thread Ronnie Sahlberg
Update repack_without_refs to take an err argument and update it if there is a failure. Pass the err variable from ref_transaction_commit to this function so that callers can print a meaningful error message if _commit fails due to a problem in repack_without_refs. Signed-off-by: Ronnie Sahlberg

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

2014-05-15 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 v8 25/44] receive-pack.c: use a reference transaction for updating the refs

2014-05-15 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 v8 20/44] refs.c: free the transaction before returning when number of updates is 0

2014-05-15 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

[PATCH v8 22/44] fetch.c: clear errno before calling functions that might set it

2014-05-15 Thread Ronnie Sahlberg
In s_update_ref there are two calls that when they fail we return an error based on the errno value. In particular we want to return a specific error if ENOTDIR happened. Both these functions do have failure modes where they may return an error without updating errno, in which case a previous and

[PATCH v8 24/44] fetch.c: use a single ref transaction for all ref updates

2014-05-15 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 v8 17/44] fast-import.c: change update_branch to use ref transactions

2014-05-15 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 v8 28/44] refs.c: make write_ref_sha1 static

2014-05-15 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 82a8d4e..e5729ad 100644 --- a/refs.c +++ b/refs.c

[PATCH v8 26/44] fast-import.c: use a ref transaction when dumping tags

2014-05-15 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 v8 11/44] refs.c: change ref_transaction_create to do error checking and return status

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

[PATCH v8 31/44] refs.c: remove the update_ref_lock function

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

[PATCH v8 16/44] sequencer.c: use ref transactions for all ref updates

2014-05-15 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 v8 21/44] refs.c: ref_transaction_commit should not free the transaction

2014-05-15 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 v8 29/44] refs.c: make lock_ref_sha1 static

2014-05-15 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 e5729ad..600f9b3 100644 --- a/refs.c +++

[PATCH v8 44/44] refs.c: remove forward declaration of write_ref_sha1

2014-05-15 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 336df40..ed93b75 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 v8 03/44] refs.c: add a strbuf argument to ref_transaction_commit for error logging

2014-05-15 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 v8 43/44] refs.c: make rename_ref use a transaction

2014-05-15 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 v8 34/44] refs.c: make prune_ref use a transaction to delete the ref

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

[PATCH v8 41/44] refs.c: add a new flag for transaction delete for refs we know are packed only

2014-05-15 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 v8 40/44] refs.c: call lock_ref_sha1_basic directly from commit

2014-05-15 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 53fdbd1..69ad51d

[PATCH v8 37/44] refs.c: pass NULL as *flags to read_ref_full

2014-05-15 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 v8 42/44] refs.c: pass a skip list to name_conflict_fn

2014-05-15 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 v8 38/44] refs.c: pack all refs before we start to rename a ref

2014-05-15 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 v8 35/44] refs.c: make delete_ref use a transaction

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

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

2014-05-15 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 v8 14/44] replace.c: use the ref transaction functions for updates

2014-05-15 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..ee34d5d 100644 ---

[PATCH v8 33/44] refs.c: remove lock_ref_sha1

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

[PATCH v8 05/44] refs.c: make ref_update_reject_duplicates take a strbuf argument for errors

2014-05-15 Thread Ronnie Sahlberg
Make ref_update_reject_duplicates return any error that occurs through a new strbuf argument. This means that when a transaction commit fails in this function we will now be able to pass a helpful error message back to the caller. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by:

[PATCH v8 09/44] refs.c: remove the onerr argument to ref_transaction_commit

2014-05-15 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. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/update-ref.c | 3

[PATCH v8 15/44] commit.c: use ref transactions for updates

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

[PATCH v8 18/44] branch.c: use ref transaction for all ref updates

2014-05-15 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 v8 30/44] refs.c: add transaction.status and track OPEN/CLOSED/ERROR

2014-05-15 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 | 31 ++- 1 file

[PATCH v8 13/44] tag.c: use ref transactions when doing updates

2014-05-15 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 v8 23/44] fetch.c: change s_update_ref to use a ref transaction

2014-05-15 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 v8 10/44] refs.c: change ref_transaction_update() to do error checking and return status

2014-05-15 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 v8 12/44] refs.c: ref_transaction_delete to check for error and return status

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

[PATCH v8 07/44] refs.c: make update_ref_write update a strbuf on failure

2014-05-15 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. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg

[PATCH v8 00/44] Use ref transactions for all ref updates

2014-05-15 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 v8 27/44] walker.c: use ref transaction for ref updates

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

  1   2   3   >