[PATCH v2] format-patch --signature-file

2014-05-15 Thread Jeremiah Mahler
Added feature that allows a signature file to be used with format-patch. $ git format-patch --signature-file ~/.signature -1 Now signatures with newlines and other special characters can be easily included. Signed-off-by: Jeremiah Mahler --- Documentation/git-format-patch.txt | 7 +++ b

[PATCH v2] format-patch --signature-file

2014-05-15 Thread Jeremiah Mahler
On Tue, May 13, 2014 at 09:07:12AM -0700, Jonathan Nieder wrote: > Hi, > > Jeremiah Mahler wrote: > > > # from a string > > $ git format-patch --signature "from a string" origin > > > > # or from a file > > $ git format-patch --signature ~/.signature origin > > Interesting. But... what

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

2014-05-15 Thread Junio C Hamano
Jakub Narębski writes: > On Thu, May 15, 2014 at 9:38 PM, Junio C Hamano wrote: >> Jakub Narębski writes: >> >>> Writing test for this would not be easy, and require some HTML >>> parser (WWW::Mechanize, Web::Scraper, HTML::Query, pQuery, >>> ... or low level HTML::TreeBuilder, or other low lev

Re: [PATCH v8 21/44] refs.c: ref_transaction_commit should not free the transaction

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > 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. Can I always use ref_transaction_rollback instead of ref_transaction_free?

Re: [GUILT v2 15/29] Produce legal patch names in guilt-import-commit.

2014-05-15 Thread Jeff Sipek
On Tue, May 13, 2014 at 10:30:51PM +0200, Per Cederqvist wrote: > Try harder to create patch names that adhere to the rules in > git-check-ref-format(1) when deriving a patch name from the commit > message. Verify that the derived name using "git check-ref-format", > and as a final fallback simply

[PATCH v9 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. Add an err argument that will be updated on

[PATCH v9 32/44] refs.c: remove the update_ref_write function

2014-05-15 Thread Ronnie Sahlberg
Since we only call update_ref_write from a single place and we only call it with onerr==QUIET_ON_ERR we can just as well get rid of it and just call write_ref_sha1 directly. Signed-off-by: Ronnie Sahlberg --- refs.c | 35 +-- 1 file changed, 9 insertions(+), 26 de

[PATCH v9 19/44] refs.c: change update_ref to use a transaction

2014-05-15 Thread Ronnie Sahlberg
Change the update_ref helper function to use a ref transaction internally. Signed-off-by: Ronnie Sahlberg --- refs.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c index 7276b9f..5e82695 100644 --- a/refs.c +++ b/refs.c @@ -3447,11

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

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

[PATCH v9 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. Reviewed-by: Jonathan Nieder Signed-off-by: Ronnie Sahlberg --- builtin/commit.c | 23 ++- 1 file changed, 10 insertions(+), 13 delet

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

[PATCH v9 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. Add an err argument that will be updated

[PATCH v9 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 --- refs.c | 31 ++- 1 file changed, 30 insertions(

[PATCH v9 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 Signed-off-by: Ronnie Sahlberg --- refs.c | 9 ++--- 1 f

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

[PATCH v9 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 --- refs.c | 2 +- refs.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/refs.c b/refs.c index 6151c3c..733dfb3 100644 --- a/refs.c +++ b/refs.c @@ -2126,7 +2126

[PATCH v9 08/44] update-ref.c: log transaction error from the update_ref

2014-05-15 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. Reviewed-by: Jonathan Nieder Signed-off-by: Ronnie Sahlberg --- builtin/update-ref.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --

[PATCH v9 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 --- 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..5534138 100

[PATCH v9 02/44] refs.c: allow passing NULL to ref_transaction_free

2014-05-15 Thread Ronnie Sahlberg
Allow ref_transaction_free(NULL) and hence ref_transaction_rollback(NULL) as no-ops. This makes ref_transaction_rollback easier to use and more similar to plain 'free'. In particular, it lets us rollback unconditionally as part of cleanup code after setting 'transaction = NULL' if a transaction ha

[PATCH v9 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 --- builtin/tag.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/builtin/tag.c b/builtin/tag.c index c6e8a71..b05f9a5 100644 --- a/builtin/tag.c +++ b/builtin/tag.c @@ -54

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

2014-05-15 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- refs.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/refs.c b/refs.c index 7ea3f42..8e30511 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 *dir); -static int w

[PATCH v9 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 Signed-off-by: Ronnie Sahlberg ---

[PATCH v9 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 --- builtin/fetch.c | 17 + 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index a93c893..c9b5954 100644 --- a/builtin/fetch.c +++ b/bu

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

[PATCH v9 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 --- builtin/replace.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/builtin/replace.c b/builtin/replace.c index 3da1bae..e8932cd 100644 --- a/builtin/replace.c +++ b/builtin/

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

2014-05-15 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 6b186ce..6ef5cec 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1735,15 +1735,22 @@ static void dump_tags(void) {

[PATCH v9 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 --- refs.c | 4 +++- refs.h | 3 --- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c index 016206b..6151c3c 100644 --- a/refs.c +++ b/refs.c @@ -251,6 +251,8 @@

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

[PATCH v9 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 --- refs.c | 73 ++ 1 file changed, 20 insertions(+), 53 deletions(-) diff --git a/refs.c b/refs.c index c471811..7ea3f42 10064

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

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

[PATCH v9 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 --- sequencer.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/sequencer.c b/sequencer.c index 0a80c58..e6b3bbc 100644 --- a/sequencer.c +++ b/sequencer.c @@ -272

[PATCH v9 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 t

[PATCH v9 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 --- fast-import.c | 25 +++-- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/fast-import.c b/fast-import.c index 6707a66..bac799c 100644 --- a/fast-import.c +++ b/fast-

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

[PATCH v9 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 --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 5369a39..e25345

Re: [PATCH v8 19/44] refs.c: change update_ref to use a transaction

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > Change the update_ref helper function to use a ref transaction internally. > > Signed-off-by: Ronnie Sahlberg > --- > refs.c | 25 + > 1 file changed, 21 insertions(+), 4 deletions(-) > > diff --git a/refs.c b/refs.c > index 6e5e940..0476892 100

[PATCH v9 06/44] refs.c: add an err argument to delete_ref_loose

2014-05-15 Thread Ronnie Sahlberg
Add an err argument to delete_loose_ref so that we can pass a descriptive error string back to the caller. Pass the err argument from transaction commit to this function so that transaction users will have a nice error string if the transaction failed due to delete_loose_ref. Add a new function un

[PATCH v9 39/44] refs.c: move the check for valid refname to lock_ref_sha1_basic

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

[PATCH v9 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 code

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

[PATCH v9 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. Add an err argument that will be updated

[PATCH v9 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 --- refs.c| 3 +++ t/t3200-branch.sh | 2 +- 2 files change

[PATCH v9 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 --- branch.c | 4 ++-- bu

[PATCH v9 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 v9 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 Signed-off-by: Ronnie Sahlberg --- builtin/update-ref.c | 3 +-- refs.c | 22 +++--

[PATCH v9 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 --- refs.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/refs.c b/refs.c index baa620f..87113af 100644 --- a/refs.c +++

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

[PATCH v9 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

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

2014-05-15 Thread Ronnie Sahlberg
On Thu, May 15, 2014 at 11:38 AM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: >> --- a/refs.c >> +++ b/refs.c >> @@ -2427,12 +2427,12 @@ static int curate_packed_ref_fn(struct ref_entry >> *entry, void *cb_data) >> return 0; >> } >> >> -static int repack_without_refs(const char **refna

Re: [GUILT v2 14/29] Use "git check-ref-format" to validate patch names.

2014-05-15 Thread Jeff Sipek
On Tue, May 13, 2014 at 10:30:50PM +0200, Per Cederqvist wrote: > The valid_patchname now lets "git check-ref-format" do its job instead > of trying (and failing) to implement the same rules. See > git-check-ref-format(1) for a list of the rules. > > Refer to the git-check-ref-format(1) man page

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

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > 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 th

[PATCH] remote-helpers: point at their upstream repositories

2014-05-15 Thread Junio C Hamano
Two announcements for their version 0.2 on the list archive are not quite enough to advertise them to their users. Signed-off-by: Junio C Hamano --- * I am inclined to queue this for 2.0, and we would also need an update to the release notes as well. I am undecided about the revert I sen

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

2014-05-15 Thread Junio C Hamano
Felipe Contreras writes: > 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 >>

Re: [GUILT v2 13/29] Check that "guilt header '.*'" fails.

2014-05-15 Thread Jeff Sipek
Signed-off-by: Josef 'Jeff' Sipek On Tue, May 13, 2014 at 10:30:49PM +0200, Per Cederqvist wrote: > Signed-off-by: Per Cederqvist > --- > regression/t-028.out | 7 +++ > regression/t-028.sh | 4 > 2 files changed, 11 insertions(+) > > diff --git a/regression/t-028.out b/regression/t-

Re: [GUILT v2 12/29] "guilt header": more robust header selection.

2014-05-15 Thread Jeff Sipek
On Tue, May 13, 2014 at 10:30:48PM +0200, Per Cederqvist wrote: > If you run something like "guilt header '.*'" the command would crash, > because the grep comand that tries to ensure that the patch exist > would detect a match, but the later code expected the match to be > exact. > > Fixed by com

Re: [PATCH v8 14/44] replace.c: use the ref transaction functions for updates

2014-05-15 Thread Ronnie Sahlberg
On Thu, May 15, 2014 at 2:18 PM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: > >> --- a/builtin/replace.c >> +++ b/builtin/replace.c > [...] >> @@ -156,11 +157,12 @@ static int replace_object_sha1(const char *object_ref, >> else if (!force) >> die("replace ref '%s' already

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

2014-05-15 Thread Ronnie Sahlberg
On Thu, May 15, 2014 at 2:11 PM, Jonathan Nieder 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, pre

Re: [PATCH v8 17/44] fast-import.c: change update_branch to use ref transactions

2014-05-15 Thread Ronnie Sahlberg
On Thu, May 15, 2014 at 2:47 PM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: > >> --- a/fast-import.c >> +++ b/fast-import.c >> @@ -1679,39 +1679,45 @@ found_entry: >> static int update_branch(struct branch *b) >> { >> static const char *msg = "fast-import"; >> - struct ref_lock *l

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

2014-05-15 Thread Junio C Hamano
"Michael S. Tsirkin" writes: >> My reading of the earlier parts of the series is that Linus wanted >> us never dwim "for-upstream" to "tags/for-upstream" or any other ref >> that happens to point at the same commit as for-upstream you have. >> The changes done for that purpose covered various cas

Re: [PATCH v8 10/44] refs.c: change ref_transaction_update() to do error checking and return status

2014-05-15 Thread Ronnie Sahlberg
On Thu, May 15, 2014 at 12:34 PM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: > >> 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

Re: [PATCH v8 11/44] refs.c: change ref_transaction_create to do error checking and return status

2014-05-15 Thread Ronnie Sahlberg
On Thu, May 15, 2014 at 12:44 PM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: > >> Do basic error checking in ref_transaction_create() and make it return >> non-zero on error. > > Same thoughts as _update(). Basic idea is good but would be nice to > have a 'struct strbuf *err' parameter. Don

Re: [PATCH v8 12/44] refs.c: ref_transaction_delete to check for error and return status

2014-05-15 Thread Ronnie Sahlberg
On Thu, May 15, 2014 at 12:51 PM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: > >> Change ref_transaction_delete() to do basic error checking and return >> non-zero of error. > > Likewise: a 'struct strbuf *err' would make nicer error messages > possible. Done. -- To unsubscribe from this lis

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

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > --- a/sequencer.c > +++ b/sequencer.c > @@ -272,23 +272,31 @@ static int fast_forward_to(const unsigned char *to, > const unsigned char *from, [...] > + error(_("HEAD: Could not fast-forward: %s\n"), err.buf); As with 'git commit', since err.buf already menti

Re: [PATCH v8 17/44] fast-import.c: change update_branch to use ref transactions

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > --- a/fast-import.c > +++ b/fast-import.c > @@ -1679,39 +1679,45 @@ found_entry: > static int update_branch(struct branch *b) > { > static const char *msg = "fast-import"; > - struct ref_lock *lock; > + struct ref_transaction *transaction; > unsigned

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

2014-05-15 Thread Michael S. Tsirkin
On Thu, May 15, 2014 at 12:13:18PM -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > > "Michael S. Tsirkin" writes: > > > >> 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

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

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > 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. Once ref_transaction_begin() and ref_transaction_update() set err, this will always have a reasonable message to print in die(

Re: [PATCH v8 14/44] replace.c: use the ref transaction functions for updates

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > --- a/builtin/replace.c > +++ b/builtin/replace.c [...] > @@ -156,11 +157,12 @@ static int replace_object_sha1(const char *object_ref, > else if (!force) > die("replace ref '%s' already exists", ref); > > - lock = lock_any_ref_for_update(ref, prev

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

2014-05-15 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/RFC] Gitweb: Convert UTF-8 encoded file names

2014-05-15 Thread Jakub Narębski
On Thu, May 15, 2014 at 9:38 PM, Junio C Hamano wrote: > Jakub Narębski writes: > >> Writing test for this would not be easy, and require some HTML >> parser (WWW::Mechanize, Web::Scraper, HTML::Query, pQuery, >> ... or low level HTML::TreeBuilder, or other low level parser). > > Hmph. Is it mor

Re: [PATCH v8 06/44] refs.c: add an err argument ro delete_loose_ref

2014-05-15 Thread Ronnie Sahlberg
On Thu, May 15, 2014 at 12:04 PM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: > >> [Subject: refs.c: add an err argument ro delete_loose_ref] > > s/ro/to/ > s/delete_loose_ref/delete_ref_loose/ > >> --- a/refs.c >> +++ b/refs.c >> @@ -2484,17 +2484,22 @@ static int repack_without_ref(const cha

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

2014-05-15 Thread Junio C Hamano
Johannes Schindelin writes: >> Jonathan Nieder 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 t

Re: [git-users] worlds slowest git repo- what to do?

2014-05-15 Thread Sam Vilain
On 05/15/2014 12:06 PM, Philip Oakley wrote: > From: "John Fisher" >> I assert based on one piece of evidence ( a post from a facebook dev) >> that I now have the worlds biggest and slowest git >> repository, and I am not a happy guy. I used to have the worlds >> biggest CVS repository, but CVS ca

Re: [PATCH v8 12/44] refs.c: ref_transaction_delete to check for error and return status

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > Change ref_transaction_delete() to do basic error checking and return > non-zero of error. Likewise: a 'struct strbuf *err' would make nicer error messages possible. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vg

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

2014-05-15 Thread Junio C Hamano
Jakub Narębski writes: > Writing test for this would not be easy, and require some HTML > parser (WWW::Mechanize, Web::Scraper, HTML::Query, pQuery, > ... or low level HTML::TreeBuilder, or other low level parser). Hmph. Is it more than just looking for a specific run of %xx we would expect to

Re: [PATCH v8 11/44] refs.c: change ref_transaction_create to do error checking and return status

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > Do basic error checking in ref_transaction_create() and make it return > non-zero on error. Same thoughts as _update(). Basic idea is good but would be nice to have a 'struct strbuf *err' parameter. Thanks, Jonathan -- To unsubscribe from this list: send the line "unsub

Re: Watchman support for git

2014-05-15 Thread David Turner
On Wed, 2014-05-14 at 17:36 +0700, Duy Nguyen wrote: > >> With that in > >> mind, I think you don't need to keep a fs cache on disk at all. All > >> you need to store (in the index) is the clock value from watchman. > >> After we parse the index, we perform a "since" query to get path names > >> (

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

2014-05-15 Thread Jakub Narębski
On Thu, May 15, 2014 at 9:28 PM, Jakub Narębski wrote: > On Thu, May 15, 2014 at 8:48 PM, Michael Wagner wrote: [...] >> The subroutine "git tree" generates the tree view. It stores the output >> of "git ls-tree -z ..." in an array named "@entries". Printing the content >> of this array yields th

Re: [PATCH v8 10/44] refs.c: change ref_transaction_update() to do error checking and return status

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > 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. Probably w

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

2014-05-15 Thread Jakub Narębski
On Thu, May 15, 2014 at 8:48 PM, Michael Wagner wrote: > On Thu, May 15, 2014 at 10:04:24AM +0100, Peter Krefting wrote: >> 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_pla

Re: [PATCH v8 08/44] update-ref.c: log transaction error from the update_ref

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > 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 All error paths in _commit add to the error string now, so the only effect should be to add the m

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

2014-05-15 Thread Jeff King
On Thu, May 15, 2014 at 07:42:00PM +0200, Johannes Schindelin wrote: > > Hrm. Is this patch still necessary? In the time since this patch was > > written, we did 0826579 (grep: load file data after checking > > binary-ness, 2012-02-02) > > I have no time to test this but I trust that you made sur

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

2014-05-15 Thread Jeff King
On Thu, May 15, 2014 at 07:46:49PM +0200, Johannes Schindelin wrote: > > We've already found the lines of interest to the user. It would be nice > > if we could somehow point the pager at them by number, rather than > > repeating the (slightly incompatible) search. > > FWIW it is exactly that typ

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

2014-05-15 Thread Junio C Hamano
Junio C Hamano writes: > "Michael S. Tsirkin" writes: > >> 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]$

Re: [PATCH] open_sha1_file: report "most interesting" errno

2014-05-15 Thread Jeff King
On Thu, May 15, 2014 at 10:02:06AM -0700, Junio C Hamano wrote: > > $ chmod 0 .git/objects/??/* > > $ git rev-list --all > > fatal: loose object b2d6fab18b92d49eac46dc3c5a0bcafabda20131 (stored in > > .git/objects/b2/d6fab18b92d49eac46dc3c5a0bcafabda20131) is corrupt > > H.

Re: [git-users] worlds slowest git repo- what to do?

2014-05-15 Thread Philip Oakley
From: "John Fisher" I assert based on one piece of evidence ( a post from a facebook dev) that I now have the worlds biggest and slowest git repository, and I am not a happy guy. I used to have the worlds biggest CVS repository, but CVS can't handle multi-G sized files. So I moved the repo to g

Re: [PATCH v8 06/44] refs.c: add an err argument ro delete_loose_ref

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > [Subject: refs.c: add an err argument ro delete_loose_ref] s/ro/to/ s/delete_loose_ref/delete_ref_loose/ > --- a/refs.c > +++ b/refs.c > @@ -2484,17 +2484,22 @@ static int repack_without_ref(const char *refname) > return repack_without_refs(&refname, 1, NULL); > }

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

2014-05-15 Thread Johannes Schindelin
Hi, On Thu, 15 May 2014, Jonathan Nieder wrote: > Johannes Schindelin wrote: > > On Wed, 14 May 2014, Junio C Hamano wrote: > > >> Spot on. The change, especially with "-I", makes sense. > > > > Except that it was not tested with -I. If you change it that way and it > > stops working on Windows

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

2014-05-15 Thread Junio C Hamano
Jonathan Nieder writes: > Ronnie Sahlberg wrote: > >> This patch series is based on next and expands on the transaction API. > > Thanks. Will pick up in v8 where I left off with v6. > > Applies with just one minor conflict on top of a merge of > mh/ref-transaction, rs/ref-update-check-errors-ear

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

2014-05-15 Thread Junio C Hamano
"Michael S. Tsirkin" writes: > 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 re

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

2014-05-15 Thread Michael Wagner
On Thu, May 15, 2014 at 10:04:24AM +0100, Peter Krefting wrote: > 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' > > ./gitwe

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

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > --- a/refs.c > +++ b/refs.c > @@ -2427,12 +2427,12 @@ static int curate_packed_ref_fn(struct ref_entry > *entry, void *cb_data) > return 0; > } > > -static int repack_without_refs(const char **refnames, int n) > +static int repack_without_refs(const char **refname

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

2014-05-15 Thread Johannes Schindelin
Hi, On Thu, 15 May 2014, 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] IIRC we had problems with refs vs file names. Ciao, Johannes -- To unsubscribe from this list: send the line "unsubscri

Re: [PATCH v8 02/44] refs.c: allow passing NULL to ref_transaction_free

2014-05-15 Thread Ronnie Sahlberg
Thanks. I used your improved text in the commit message. On Thu, May 15, 2014 at 11:15 AM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: > >> 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 allo

Re: [PATCH v8 02/44] refs.c: allow passing NULL to ref_transaction_free

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > 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_

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

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > 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*. Obviously good. Reviewed-by: Jonathan Nieder -- To unsubscribe from this list: send the line "unsubscribe git"

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

2014-05-15 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > This patch series is based on next and expands on the transaction API. Thanks. Will pick up in v8 where I left off with v6. Applies with just one minor conflict on top of a merge of mh/ref-transaction, rs/ref-update-check-errors-early, and rs/reflog-exists. Here's an i

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

2014-05-15 Thread Jonathan Nieder
Johannes Schindelin wrote: > On Wed, 14 May 2014, Jeff King wrote: >> We've already found the lines of interest to the user. It would be nice >> if we could somehow point the pager at them by number, rather than >> repeating the (slightly incompatible) search. > > FWIW it is exactly that type of "

  1   2   3   >