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

2014-05-14 Thread Felipe Contreras
Stepan Kasal wrote: > From: Sverre Rabbelier > 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 > --- > > Hi, > this patch was present in msysgit from Mar 2012. > Do you like it? Adding an extra '--' would

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

2014-05-14 Thread David Kastrup
Felipe Contreras 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 rational mails and as

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

2014-05-14 Thread Stepan Kasal
From: Johannes Schindelin 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. This brings down an initial import of http://selenic.com/hg from about 230 megabyt

[PATCH] transport-helper: add trailing --

2014-05-14 Thread Stepan Kasal
From: Sverre Rabbelier 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 --- Hi, this patch was present in msysgit from Mar 2012. Do you like it? I'm sorry, there is no author signoff; is the patch small enough? Ste

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

2014-05-14 Thread Michael Wagner
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 wrote: > > Michael Wagner writes: > > > >> Perl has an internal encoding used to store text strings. Currently, > >> trying to > >> view files with UTF-8 encoded names results in an

Kedves felhasználók e-mailben;

2014-05-14 Thread (webmail update 2014)
-- 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 másol

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

2014-05-14 Thread Jonathan Nieder
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, const char > *prefix) > strbuf_release(&author_ident); > free_c

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

2014-05-14 Thread Jonathan Nieder
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' already exists", ref); > > - lock = lock_any_ref_for_update(ref, p

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

2014-05-14 Thread Jonathan Nieder
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, prev, object); > > - lock = lock_any_ref_for_update(ref.buf, pr

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

2014-05-14 Thread Jonathan Nieder
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 will return error but there > will be in the future. > > Signed-off-by: R

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

2014-05-14 Thread Jonathan Nieder
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 will return error but there > will be in the future. Same concerns as wi

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

2014-05-14 Thread Felipe Contreras
Martin Langhoff wrote: > On Wed, May 14, 2014 at 7:28 PM, Felipe Contreras > wrote: > > Do we no longer have to be afraid of that? WHY? All the responses from > > the contrib cleanup patches seem to suggest that pretty much *everyone* > > The responses also been clear in that you are toxic. You

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

2014-05-14 Thread Martin Langhoff
On Wed, May 14, 2014 at 7:28 PM, Felipe Contreras wrote: > Do we no longer have to be afraid of that? WHY? All the responses from > the contrib cleanup patches seem to suggest that pretty much *everyone* The responses also been clear in that you are toxic. You've hijacked this mailing list on a p

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

2014-05-14 Thread Jonathan Nieder
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 _update that will return error but there > will be in the future. > > Signed-off-

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

2014-05-14 Thread Felipe Contreras
Junio C Hamano wrote: > Felipe Contreras writes: > > Junio never explained his *TECHNICAL* reason, and Michael Haggerty > > simply said "there are good technical arguments for and against > > moving git-remote-hg out of contrib", that was all his explanation for > > the *TECHNICAL* reason. > I am

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

2014-05-14 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > 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. Nice, and obviously correct. Reviewed-by: Jonathan Nieder -- To unsubscribe from this list: send the

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

2014-05-14 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > 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 -- To unsubscribe from this list

Re: [PATCH v2] contrib/subtree bugfix: Can't `add` annotated tag

2014-05-14 Thread James Denholm
Junio C Hamano wrote: > To me, it looks like all that is necessary is to accept your patch > but with a three-byte tightening to detect such a pathological case > and signal an error, which is what " &&", which I added to your new > line that sets revp=$(peel_committish ...), is about. > > This pa

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

2014-05-14 Thread Felipe Contreras
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. I've made my point, you are just talking nonsense. Every rational person on this list knows that if I wanted to, I could be much more of

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

2014-05-14 Thread Junio C Hamano
David Kastrup writes: >>> I'm not entirely convinced of that: there is something akin to drop-dead >>> gorgeous code: code that is so well done that it would not matter with >>> regard to its maintenance whether or not its author dropped dead because >>> it's both done well as well as documented

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

2014-05-14 Thread David Kastrup
Junio C Hamano writes: > David Kastrup writes: > >> Philippe Vaucher 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 >>>

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

2014-05-14 Thread Jakub Narębski
On Wed, May 14, 2014 at 11:57 PM, Junio C Hamano wrote: > Michael Wagner writes: > >> 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 Erro

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

2014-05-14 Thread Junio C Hamano
David Kastrup writes: > Philippe Vaucher 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* f

[PATCH 04/31] refs.c: add a new update_type field to ref_update

2014-05-14 Thread Ronnie Sahlberg
Add a field that describes what type of update this refers to. For now the only type is UPDATE_SHA1 but we will soon add more types. Signed-off-by: Ronnie Sahlberg --- refs.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index 6785fa6..018062d 10

[PATCH 10/31] reflog.c: use a reflog transaction when writing during expire

2014-05-14 Thread Ronnie Sahlberg
Use a transaction when doing the updates of the reflog during expire_reflog. Signed-off-by: Ronnie Sahlberg --- builtin/reflog.c | 54 ++ refs.c | 4 ++-- 2 files changed, 24 insertions(+), 34 deletions(-) diff --git a/builtin/reflo

[PATCH 03/31] refs.c: rename the transaction functions

2014-05-14 Thread Ronnie Sahlberg
Rename the transaction functions. Remove the leading ref_ from the names and append _sha1 to the names for functions that create/delete/update sha1 refs. Signed-off-by: Ronnie Sahlberg --- branch.c | 10 +++--- builtin/commit.c | 14 builtin/fetch.c| 10 +++--

[PATCH 02/31] refs.c: make ref_transaction_delete a wrapper for ref_transaction_update

2014-05-14 Thread Ronnie Sahlberg
We want to allow to delete a ref even if it only exists as a packed ref so we must tweak the REF_ISPACKONLY test in _update so it only applies to the non-delete case. Signed-off-by: Ronnie Sahlberg --- refs.c | 17 ++--- refs.h | 2 +- 2 files changed, 7 insertions(+), 12 deletions(

[PATCH 06/31] refs.c: add a transaction function to append a reflog entry

2014-05-14 Thread Ronnie Sahlberg
Define a new transaction update type, UPDATE_LOG, and a new function transaction_update_reflog. This function will lock the reflog and append an entry to it during transaction commit. Signed-off-by: Ronnie Sahlberg Conflicts: refs.h --- refs.c | 107 +

[PATCH 00/31] Finish implementing ref and reflog transactions

2014-05-14 Thread Ronnie Sahlberg
This patch series is available also from https://github.com/rsahlberg/git/tree/ref-transactions-next and is based on https://github.com/rsahlberg/git/tree/ref-transactions This is a preview of the direction for the transaction work and finished converting also reflog handling to transactions. This

[PATCH 07/31] refs.c: add a flag to allow reflog updates to truncate the log

2014-05-14 Thread Ronnie Sahlberg
Add a flag that allows us to truncate the reflog before we write the update. Signed-off-by: Ronnie Sahlberg --- refs.c | 12 ++-- refs.h | 4 +++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/refs.c b/refs.c index d8a1568..a8b583a 100644 --- a/refs.c +++ b/refs.c @@ -

[PATCH 11/31] refs.c: null terminate the string in copy_msg

2014-05-14 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- refs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/refs.c b/refs.c index 5a5f9df..58bbf1b 100644 --- a/refs.c +++ b/refs.c @@ -2707,6 +2707,7 @@ static int copy_msg(char *buf, const char *msg) while (buf < cp && isspace(cp[-1])) c

[PATCH 24/31] refs.c: make unlock_ref static

2014-05-14 Thread Ronnie Sahlberg
We no longer need to export unlock_ref. Make the function static. Signed-off-by: Ronnie Sahlberg --- refs.c | 20 ++-- refs.h | 3 --- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/refs.c b/refs.c index 17feec5..6933036 100644 --- a/refs.c +++ b/refs.c @@ -193

[PATCH 13/31] refs.c: update the list of deleted refs during _update instead of _commit

2014-05-14 Thread Ronnie Sahlberg
When deleting refs during a transaction, update the list of the refs to be deleted already during _update instead of waiting until the _commit stage. Signed-off-by: Ronnie Sahlberg --- refs.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/refs.c b/refs.c ind

[PATCH 25/31] refs.c: make close_ref static

2014-05-14 Thread Ronnie Sahlberg
We no longer need to export close_ref. Make the function static. Signed-off-by: Ronnie Sahlberg --- refs.c | 2 +- refs.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/refs.c b/refs.c index 6933036..a430b22 100644 --- a/refs.c +++ b/refs.c @@ -2668,7 +2668,7 @@ int renam

[PATCH 20/31] refs.c: check for lock conflicts already in _update

2014-05-14 Thread Ronnie Sahlberg
Check for lock conflicts in _update and flag the transaction as errored instead of waiting until _commit for doing these checks. If there was a lock failure we check if this was due to a previous update in the same transaction or not. This so that we can preserve the current error messages on lock

[PATCH 17/31] refs.c: make _update_reflog take an error argument

2014-05-14 Thread Ronnie Sahlberg
Add a strbug argument to the update reflog transaction call so we can return an error string back to the caller on failure. Signed-off-by: Ronnie Sahlberg --- builtin/reflog.c | 6 -- refs.c | 3 ++- refs.h | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff -

[PATCH 12/31] refs.c: track the refnames we are deleting in the transaction structure

2014-05-14 Thread Ronnie Sahlberg
Track the names of the refs we are deleting in the ref_transaction structure instead of building an array of names during _commit. Signed-off-by: Ronnie Sahlberg --- refs.c | 35 +++ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/refs.c b/refs.c i

[PATCH 21/31] refs.c allow multiple updates of the same ref in a transaction

2014-05-14 Thread Ronnie Sahlberg
Allow multiple updates of a ref in the same transaction as long as each update has have_old and old_sha1 matches the new_sha1 of the previous update. Add a test that verifies that a valid sequence such as create ref a update ref b a update ref c b works and a test that an invalid sequence su

[PATCH 09/31] refs.c: allow multiple reflog updates during a single transaction

2014-05-14 Thread Ronnie Sahlberg
Allow to make multiple reflog updates to the same ref during a transaction. This means we only need to lock the reflog once, during the first update that touches the reflog, and that all further updates can just write the reflog entry since the reflog is already locked. This allows us to write cod

[PATCH 26/31] refs.c: make commit_ref static

2014-05-14 Thread Ronnie Sahlberg
We no longer need to export commit_ref. Make the function static. Signed-off-by: Ronnie Sahlberg --- refs.c | 2 +- refs.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/refs.c b/refs.c index a430b22..0cb4ae8 100644 --- a/refs.c +++ b/refs.c @@ -2676,7 +2676,7 @@ static i

[PATCH 19/31] tests: move tests for -z update/delete/verify to after the ref is created

2014-05-14 Thread Ronnie Sahlberg
The tests for stdin -z fails for update/delete/verify are of the form update refs/heads/a $m $m $m and rely on the fact that when parsed we will first parse everything except the trailing $m. And once that command has completed it will start parsing the next command, find the trailing $m from befor

[PATCH 14/31] refs.c: return error instead of dying when locking fails during transaction

2014-05-14 Thread Ronnie Sahlberg
Change lock_ref_sha1_basic to return an error instead of dying when we fail to lock a file during a transaction. Signed-off-by: Ronnie Sahlberg --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 3249576..8212d77 100644 --- a/refs.c +++ b/refs.c @

[PATCH 23/31] reflog.c: use the existing transaction to also lock and update the ref

2014-05-14 Thread Ronnie Sahlberg
reflog.c has a transaction for updating the reflog. Use this transaction also for locking the ref itself and updating the ref instead of locking the file directly and writing to it. This now completely eliminates the refs and reflog implementation from reflog.c. Signed-off-by: Ronnie Sahlberg ---

[PATCH 16/31] refs.c: add an error argument to create/delete/update just like commit

2014-05-14 Thread Ronnie Sahlberg
Update the signatures for transaction create/delete/update and add a strbuf err argument we can use to pass an error back to the caller. We will need this later once we start moving checks from _commit to _update. Change all callers that would die() on _commit failures to handle _update failures si

[PATCH 01/31] refs.c make ref_transaction_create a wrapper to ref_transaction_update

2014-05-14 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- refs.c | 13 +++-- refs.h | 7 --- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/refs.c b/refs.c index aed700b..fe195dd 100644 --- a/refs.c +++ b/refs.c @@ -3354,17 +3354,10 @@ int ref_transaction_create(struct ref_transaction *tr

[PATCH 22/31] refs.c: release all remaining locks during transaction_free

2014-05-14 Thread Ronnie Sahlberg
If there are remaining locks held when we free a transaction, make sure that we release them instead of relying on the atexit magic to release them for us. Otherwise, if we perform two transactions on the same ref and the first transaction is aborted then the second transaction will fail to lock th

[PATCH 08/31] refs.c: only write reflog update if msg is non-NULL

2014-05-14 Thread Ronnie Sahlberg
When performing a reflog transaction update, only write to the reflog iff msg is non-NULL. This can then be combined with REFLOG_TRUNCATE to perform an update that only truncates but does not write. Signed-off-by: Ronnie Sahlberg --- refs.c | 8 +--- refs.h | 1 + 2 files changed, 6 insertio

[PATCH 30/31] refs.c: move ref_update and other definitions to earlier in the file

2014-05-14 Thread Ronnie Sahlberg
Move the struct ref_update definition and some enums to earlier in the file. This does not change any actual code or definitions but just moves them to a different place in the code since we will soon reference some of these from the rename_ref function. Signed-off-by: Ronnie Sahlberg Conflicts:

[PATCH 15/31] refs.c: lock the ref during _update instead of during _commit

2014-05-14 Thread Ronnie Sahlberg
Try to lock the ref during the transaction update instead of later during the commit phase. This allows us to do things such as : t = transaction_begin() transaction_update_sha1(t, ref, ...) /* locking ref */ ... do stuff while we know that ref is locked ... transaction_commit(t) Signed-off-by:

[PATCH 31/31] refs.c: use the transaction to manage the reflog in rename_refs

2014-05-14 Thread Ronnie Sahlberg
We have a transaction in rename_ref to managing the ref during the rename. Use this transaction to manage the changes to the reflog too. This now means that rename_ref is almost completely agnostic about how refs storage is implemented and should be easier to migrate if/when we allow a different st

[PATCH 27/31] refs.c: remove the function lock_any_ref_for_update

2014-05-14 Thread Ronnie Sahlberg
We no longer need the function lock_any_ref_for_update so lets remove it. Signed-off-by: Ronnie Sahlberg --- refs.c | 7 --- refs.h | 4 2 files changed, 11 deletions(-) diff --git a/refs.c b/refs.c index 0cb4ae8..918cda3 100644 --- a/refs.c +++ b/refs.c @@ -2167,13 +2167,6 @@ static s

[PATCH 18/31] refs.c: return immediately from _commit if the transaction has an error

2014-05-14 Thread Ronnie Sahlberg
If a previous transaction operation has failed and flagged a transaction as having an error, then return immediately from commit and indicate failure. Once we move checks from _commit to _update, _update will already have updated the error string so the caller will know what failed. Thus we don't n

[PATCH 05/31] refs.c: add a function to append a reflog entry to a fd

2014-05-14 Thread Ronnie Sahlberg
Break out the code to create the string and writing it to the file descriptor from log_ref_write and into a dedicated function log_ref_write_fd. For now this is only used from log_ref_write but later on we will call this function from reflog transactions too which means that we will end up with onl

[PATCH 28/31] refs.c: make struct ref_lock private to refs.c

2014-05-14 Thread Ronnie Sahlberg
We no longer need to expose the ref_lock structure to any external callers. Make it private to refs.c. Signed-off-by: Ronnie Sahlberg --- refs.c | 9 + refs.h | 9 - 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/refs.c b/refs.c index 918cda3..8129b20 100644 --- a

[PATCH 29/31] refs.c: allow passing raw git_committer_info as email to _update_reflog

2014-05-14 Thread Ronnie Sahlberg
In many places in the code we do not have access to the individual fields in the committer data. Instead we might only have access to prebaked data such as what is returned by git_committer_info() containing a string that consists of email, timestamp, zone etc. This makes it inconvenient to use tr

[PATCH] run_diff_files: do not look at uninitialized stat data

2014-05-14 Thread Jeff King
On Sun, May 11, 2014 at 02:20:57PM -0500, Elliott Cable wrote: > So, I've spent some time in the #git channel on Freenode chatting > about this, and we couldn't figure it out. I can't reproduce it in a > newly-made repository, but it's reproducible with the repository I've > been working in. > >

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

2014-05-14 Thread Max Kirillov
When git show -s is called for merge commit it prints extra newline after any merge commit. This differs from output for commits with one parent. Fix it by more thorough checking that diff output is disabled. The code in question exists since commit 3969cf7db1. The additional newline is really nee

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

2014-05-14 Thread David Kastrup
Felipe Contreras writes: > David Kastrup wrote: >> Felipe Contreras 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 t

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

2014-05-14 Thread Jonathan Nieder
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 cmd_update_ref(int argc, const char **argv, const > char *prefix) [...] >

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

2014-05-14 Thread Junio C Hamano
Michael Wagner writes: > 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

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

2014-05-14 Thread Felipe Contreras
David Kastrup wrote: > Felipe Contreras 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 deci

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

2014-05-14 Thread Junio C Hamano
Junio C Hamano writes: > Jens Lehmann 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

Re: [PATCH v2] contrib/subtree bugfix: Can't `add` annotated tag

2014-05-14 Thread Junio C Hamano
James Denholm writes: > On Tue, May 13, 2014 at 04:12:56PM -0700, Junio C Hamano wrote: >> James Denholm writes: >> >> > I'm not sure that can actually happen - peel_committish is essentially >> > implemented as `rev-parse $arg^0` (though with a bit of bling, of >> > course), and to my understa

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

2014-05-14 Thread Felipe Contreras
Jeff King wrote: > 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

Re: [PATCH v2] contrib/subtree bugfix: Can't `add` annotated tag

2014-05-14 Thread James Denholm
On Tue, May 13, 2014 at 04:12:56PM -0700, Junio C Hamano wrote: > James Denholm writes: > > > I'm not sure that can actually happen - peel_committish is essentially > > implemented as `rev-parse $arg^0` (though with a bit of bling, of > > course), and to my understanding FETCH_HEAD will always pa

[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 Sahlberg

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

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

[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 --- refs.c | 9 ++--- 1 file changed, 6 insertions(+),

[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 ref

[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 --- 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 --- a/builtin/replace.c +++ b/builtin/

[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 f

[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 20/42] fetch.c: clear errno before calling functions that might set it

2014-05-14 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 u

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

2014-05-14 Thread Ronnie Sahlberg
Call ref_transaction_commit with QUIET_ON_ERR and use the strbuf that is returned to print a log message if/after the transaction fails. Signed-off-by: Ronnie Sahlberg --- builtin/update-ref.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/update-ref.c b/b

[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 --- bu

[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 u

[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 --- builtin/commit.c | 23 ++- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/builtin/

[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 die(

[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 --- builtin/update-ref.c | 3 +-- refs.c | 22 +++--- refs.h

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 wrote: > Elia Pinto 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.c

[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 --- 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 +++ b/builtin/tag.c @@ -54

[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 --- 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 +++ b/refs.c @@ -2126,7 +2126

[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 w

[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 fo

[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 --- 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 @@ -251,6 +251,8 @@

[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 --- 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 dump_tags(void) {

[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 lockin

[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 --- refs.c | 30 ++ 1 file changed, 6 insertions(+), 24 deletions(-)

[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 --- refs.c | 73 ++ 1 file changed, 20 insertions(+), 53 deletions(-) diff --git a/refs.c b/refs.c index 7569f4e..8e12386 10064

[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 --- 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 --- a/builtin/fetch.c +++ b/bu

[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 --- refs.c | 37 + 1 file changed, 33 inser

[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 --- 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 +++ b/sequencer.c @@ -272

[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 --- refs.c | 35 +-- 1 file changed, 9 insertions(+), 26 de

[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 --- 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 c323081..d580176 100

[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 --- refs.c | 31 ++- 1 file changed, 10 insertions(+), 21 deletions(

[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 as

[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 --- branch.c | 6 +++---

[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 --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 9ac9f38..cb1442

[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

  1   2   >