Re: [PATCH v6] Add an explicit GIT_DIR to the list of excludes

2014-06-12 Thread Johannes Sixt
Am 12.06.2014 01:28, schrieb Pasha Bolokhov: +test_expect_success setup ' + mkdir repo-inside/ + ( + cd repo-inside/ + for f in a b c d + do + echo DATA $f || exit 1 + done + mkdir dir1 dir1/meta

Re: [PATCH v2 01/19] add strbuf_set operations

2014-06-12 Thread Jeremiah Mahler
On Wed, Jun 11, 2014 at 04:42:56AM -0400, Eric Sunshine wrote: On Mon, Jun 9, 2014 at 6:19 PM, Jeremiah Mahler jmmah...@gmail.com wrote: Currently, the data in a strbuf is modified using add operations. To set the buffer to some data a reset must be performed before an add.

Re: [PATCH v2 00/19] add strbuf_set operations

2014-06-12 Thread Jeremiah Mahler
Eric, On Wed, Jun 11, 2014 at 04:09:17AM -0400, Eric Sunshine wrote: On Mon, Jun 9, 2014 at 6:19 PM, Jeremiah Mahler jmmah...@gmail.com wrote: Version 2 of the patch set to add strbuf_set operations. Includes suggestions from Eric Sunshine [1]: [...snip...] ... Food for thought:

Re: [PATCH v2 01/19] add strbuf_set operations

2014-06-12 Thread Jeremiah Mahler
Michael, On Wed, Jun 11, 2014 at 02:05:35PM +0200, Michael Haggerty wrote: On 06/10/2014 12:19 AM, Jeremiah Mahler wrote: Currently, the data in a strbuf is modified using add operations. To set the buffer to some data a reset must be performed before an add. ... diff --git a/strbuf.c

[PATCH v3 0/2] add strbuf_set operations

2014-06-12 Thread Jeremiah Mahler
Addition of strbuf_set operations, version 3. Includes suggestions from Eric Sunshine [1]: - Revise log message to better argue why this patch is worthwhile. - Avoid documentation redundancy: Setting buffer, Replace buffer. - Remove unnecessary changes which didn't have a significant

[PATCH v3 1/2] add strbuf_set operations

2014-06-12 Thread Jeremiah Mahler
A common use case with strubfs is to set the buffer to a new value. This must be done in two steps: a reset followed by an add. strbuf_reset(buf); strbuf_add(buf, new_buf, len); In cases where the buffer is being built up in steps, these operations make sense and correctly convey what is

[PATCH v3 2/2] builtin/remote: improve readability via strbuf_set()

2014-06-12 Thread Jeremiah Mahler
builtin/remote.c has many cases where a strbuf was being set to a new value. Improve its readability by using strbuf_set() operations instead of reset + add. Signed-off-by: Jeremiah Mahler jmmah...@gmail.com --- builtin/remote.c | 63 +--- 1

Re: [PATCH v3 1/2] add strbuf_set operations

2014-06-12 Thread Thomas Braun
Am 12.06.2014 09:29, schrieb Jeremiah Mahler: A common use case with strubfs is to set the buffer to a new value. This must be done in two steps: a reset followed by an add. strbuf_reset(buf); strbuf_add(buf, new_buf, len); In cases where the buffer is being built up in steps, these

Re: [PATCH v3 2/2] builtin/remote: improve readability via strbuf_set()

2014-06-12 Thread Eric Sunshine
On Thu, Jun 12, 2014 at 3:29 AM, Jeremiah Mahler jmmah...@gmail.com wrote: builtin/remote.c has many cases where a strbuf was being set to a new value. Improve its readability by using strbuf_set() operations instead of reset + add. Signed-off-by: Jeremiah Mahler jmmah...@gmail.com ---

Re: [PATCH v3 1/2] add strbuf_set operations

2014-06-12 Thread Jeremiah Mahler
Thomas, On Thu, Jun 12, 2014 at 10:11:36AM +0200, Thomas Braun wrote: Am 12.06.2014 09:29, schrieb Jeremiah Mahler: A common use case with strubfs is to set the buffer to a new value. This must be done in two steps: a reset followed by an add. strbuf_reset(buf); strbuf_add(buf,

Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config

2014-06-12 Thread Jeremiah Mahler
On Wed, Jun 11, 2014 at 01:24:36PM -0500, ca...@calebthompson.io wrote: Some of the tests in t/t7507-commit-verbose.sh were still using git-config to set configuration. Change them to use the test_config helper. Signed-off-by: Caleb Thompson ca...@calebthompson.io ---

Re: [PATCH v2 01/19] add strbuf_set operations

2014-06-12 Thread Michael Haggerty
On 06/12/2014 09:10 AM, Jeremiah Mahler wrote: On Wed, Jun 11, 2014 at 02:05:35PM +0200, Michael Haggerty wrote: [...] If there were a function like strbuf_grow_to(sb, len): void strbuf_grow_to(struct strbuf *sb, size_t len) { int new_buf = !sb-alloc; if

Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config

2014-06-12 Thread Caleb Thompson
I assume that you're running it against master? I rebased the branch yesterday, but I'll give it another shot. Obviously I didn't use git-am, but I can try that. Caleb Thompson On Thu, Jun 12, 2014 at 01:41:52AM -0700, Jeremiah Mahler wrote: On Wed, Jun 11, 2014 at 01:24:36PM -0500,

Re: [PATCH v4 4/4] commit: support commit.verbose and --no-verbose

2014-06-12 Thread Caleb Thompson
Another update to also use quotes around the check-for-no-diff script body. If I don't get any more feedback in the next few hours I'll send another full version of the patch. Caleb Thompson 8 Add a new configuration variable commit.verbose to

Git for Windows 1.9.4

2014-06-12 Thread Thomas Braun
Hi, the Git for Windows team just released version 1.9.4 of the Windows-specific installers. It can be downloaded from the usual place [1]. New Features * Comes with Git 1.9.4 plus Windows-specific patches Bugfixes * Upgrade openssl to 0.9.8za [2] * Config option to disable side-band-64k for

Re: Relative submodule URLs, and forks that haven't forked the submodule

2014-06-12 Thread Fredrik Gustafsson
So let me see if I understand you correctly. On Wed, Jun 11, 2014 at 12:15:39PM +0200, Charles Brossollet wrote: Hi, I'm banging my head on this problem: I have a central repo cloned by SSH, and a fork on the same server. The central remote is origin, and the fork is chbrosso-wip. $

Re: Relative submodule URLs, and forks that haven't forked the submodule

2014-06-12 Thread Charles Brossollet
Thanks for taking time to understand, let me make it more clear Le 12 juin 2014 à 17:25, Fredrik Gustafsson iv...@iveqy.com a écrit : So let me see if I understand you correctly. On Wed, Jun 11, 2014 at 12:15:39PM +0200, Charles Brossollet wrote: Hi, I'm banging my head on this

[PATCH RFC] git-am: support any number of signatures

2014-06-12 Thread Michael S. Tsirkin
I'm using different signature tags for git am depending on the patch, project and other factors. Sometimes I add multiple tags as well, e.g. QEMU wants both Reviewed-by and Signed-off-by tags. This patch makes it easy to do so: 1. new parameter am.signoff can be used any number of

[PATCH] l10n: de.po: fix typo

2014-06-12 Thread Ralf Thielow
Signed-off-by: Ralf Thielow ralf.thie...@gmail.com --- po/de.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/de.po b/po/de.po index b777ef4..d7bc424 100644 --- a/po/de.po +++ b/po/de.po @@ -3503,7 +3503,7 @@ msgstr Gewechselt zu umgesetzten Branch '%s'\n #:

Re: What's cooking in git.git (Jun 2014, #03; Tue, 10)

2014-06-12 Thread Christian Couder
On Wed, Jun 11, 2014 at 12:19 AM, Junio C Hamano gits...@pobox.com wrote: * cc/interpret-trailers (2014-05-28) 11 commits - Documentation: add documentation for 'git interpret-trailers' - trailer: add tests for commands in config file - trailer: execute command from 'trailer.name.command'

Re: [PATCH] Fix t0001: test git init when run via an alias

2014-06-12 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes: On Wed, Jun 11, 2014 at 1:48 AM, Junio C Hamano gits...@pobox.com wrote: Nguyễn Thái Ngọc Duy pclo...@gmail.com writes: Commit 4ad8332 (t0001: test git init when run via an alias - 2010-11-26) noted breakages when running init via alias. The problem is

[PATCH v16 03/48] refs.c: constify the sha arguments for ref_transaction_create|delete|update

2014-06-12 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 v16 04/48] refs.c: allow passing NULL to ref_transaction_free

2014-06-12 Thread Ronnie Sahlberg
Allow ref_transaction_free(NULL) as a no-op. This makes ref_transaction_free 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 has been committed or rolled back already.

[PATCH v16 15/48] refs.c: make ref_update_reject_duplicates take a strbuf argument for errors

2014-06-12 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 v16 10/48] refs.c: verify_lock should set errno to something meaningful

2014-06-12 Thread Ronnie Sahlberg
Making errno when returning from verify_lock() meaningful, which should almost but not completely fix * a bug in git fetch's s_update_ref, which trusts the result of an errno == ENOTDIR check to detect D/F conflicts ENOTDIR makes sense as a sign that a file was in the way of a directory we

[PATCH v16 06/48] lockfile.c: add a new public function unable_to_lock_message

2014-06-12 Thread Ronnie Sahlberg
Introducing a new unable_to_lock_message helper, which has nicer semantics than unable_to_lock_error and cleans up lockfile.c a little. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- cache.h| 2 ++ lockfile.c | 22 -- 2 files changed, 14 insertions(+), 10

[PATCH v16 12/48] refs.c: commit_packed_refs to return a meaningful errno on failure

2014-06-12 Thread Ronnie Sahlberg
Making errno when returning from commit_packed_refs() meaningful, which should fix * a bug in git clone where it prints strerror(errno) based on errno, despite errno possibly being zero and potentially having been clobbered by that point * the same kind of bug in git pack-refs and

[PATCH v16 18/48] update-ref: use err argument to get error from ref_transaction_commit

2014-06-12 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 jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/update-ref.c | 10 +- 1 file changed, 5

[PATCH v16 16/48] refs.c: add an err argument to delete_ref_loose

2014-06-12 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

[PATCH v16 07/48] lockfile.c: make lock_file return a meaningful errno on failurei

2014-06-12 Thread Ronnie Sahlberg
Making errno when returning from lock_file() meaningful, which should fix * an existing almost-bug in lock_ref_sha1_basic where it assumes errno==ENOENT is meaningful and could waste some work on retries * an existing bug in repack_without_refs where it prints strerror(errno) and picks

[PATCH v16 01/48] refs.c: remove ref_transaction_rollback

2014-06-12 Thread Ronnie Sahlberg
We do not yet need both a rollback and a free function for transactions. Remove ref_transaction_rollback and use ref_transaction_free instead. At a later stage we may reintroduce a rollback function if we want to start adding reusable transactions and similar. Reviewed-by: Jonathan Nieder

[PATCH v16 47/48] fetch.c: change s_update_ref to use a ref transaction

2014-06-12 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 | 33 +++-- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index faa1233..52f1ebc

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

2014-06-12 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. If lock_ref_sha1_basic fails the check_refname_format test, set errno to EINVAL before returning NULL. This to guarantee that we

[PATCH v16 39/48] refs.c: make prune_ref use a transaction to delete the ref

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

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

2014-06-12 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. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 2 +- 1 file changed, 1

[PATCH v16 45/48] refs.c: pass a skip list to name_conflict_fn

2014-06-12 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 v16 37/48] refs.c: remove the update_ref_write function

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

[PATCH v16 48/48] refs.c: make write_ref_sha1 static

2014-06-12 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 | 10 -- refs.h | 3 --- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/refs.c b/refs.c index 8917832..31d7616 100644 --- a/refs.c +++

[PATCH v16 38/48] refs.c: remove lock_ref_sha1

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

[PATCH v16 40/48] refs.c: make delete_ref use a transaction

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

[PATCH v16 13/48] refs.c: make resolve_ref_unsafe set errno to something meaningful on error

2014-06-12 Thread Ronnie Sahlberg
Making errno when returning from resolve_ref_unsafe() meaningful, which should fix * a bug in lock_ref_sha1_basic, where it assumes EISDIR means it failed due to a directory being in the way Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- cache.h | 2 +- refs.c | 19

[PATCH v16 21/48] refs.c: change ref_transaction_create to do error checking and return status

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

[PATCH v16 31/48] refs.c: change update_ref to use a transaction

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

[PATCH v16 30/48] branch.c: use ref transaction for all ref updates

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

[PATCH v16 19/48] refs.c: remove the onerr argument to ref_transaction_commit

2014-06-12 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 v16 29/48] fast-import.c: change update_branch to use ref transactions

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

[PATCH v16 44/48] refs.c: call lock_ref_sha1_basic directly from commit

2014-06-12 Thread Ronnie Sahlberg
Skip using the lock_any_ref_for_update wrapper and call lock_ref_sha1_basic directly from the commit function. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff

[PATCH v16 46/48] refs.c: propagate any errno==ENOTDIR from _commit back to the callers

2014-06-12 Thread Ronnie Sahlberg
In _commit, ENOTDIR can happen in the call to lock_ref_sha1_basic, either when we lstat the new refname and it returns ENOTDIR or if the name checking function reports that the same type of conflict happened. In both cases it means that we can not create the new ref due to a name conflict. For

Re: [PATCH v2 0/17] store length of commit-buffer

2014-06-12 Thread Junio C Hamano
Jeff King p...@peff.net writes: On Tue, Jun 10, 2014 at 05:35:09PM -0400, Jeff King wrote: Here's a re-roll of the commit-slab series. It fixes the issues pointed out by Eric and Christian (thanks, both). Side note: I marked this as v2, but forgot to do so in each individual patch (I write

[PATCH v16 36/48] refs.c: remove the update_ref_lock function

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

[PATCH v16 25/48] tag.c: use ref transactions when doing updates

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

[PATCH v16 22/48] refs.c: update ref_transaction_delete to check for error and return status

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

[PATCH v16 32/48] receive-pack.c: use a reference transaction for updating the refs

2014-06-12 Thread Ronnie Sahlberg
Wrap all the ref updates inside a transaction. Free commands when we are finished with them instead of leaking. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/receive-pack.c | 74 +++--- 1 file changed, 52 insertions(+), 22 deletions(-)

[PATCH v16 24/48] refs.c: add transaction.status and track OPEN/CLOSED/ERROR

2014-06-12 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 | 40 +++- 1

[PATCH v16 41/48] refs.c: pass the ref log message to _create/delete/update instead of _commit

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

[PATCH v16 17/48] refs.c: make update_ref_write update a strbuf on failure

2014-06-12 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 v16 34/48] walker.c: use ref transaction for ref updates

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

[PATCH v16 27/48] commit.c: use ref transactions for updates

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

[PATCH v16 14/48] refs.c: log_ref_write should try to return meaningful errno

2014-06-12 Thread Ronnie Sahlberg
Making errno from write_ref_sha1() meaningful, which should fix * a bug in git checkout -b where it prints strerror(errno)  despite errno possibly being zero or clobbered * a bug in git fetch's s_update_ref, which trusts the result of an  errno == ENOTDIR check to detect D/F conflicts

[PATCH v16 35/48] refs.c: make lock_ref_sha1 static

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

[PATCH v16 28/48] sequencer.c: use ref transactions for all ref updates

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

[PATCH v16 20/48] refs.c: change ref_transaction_update() to do error checking and return status

2014-06-12 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

[PATCH v16 05/48] refs.c: add a strbuf argument to ref_transaction_commit for error logging

2014-06-12 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 v16 09/48] refs.c: make sure log_ref_setup returns a meaningful errno

2014-06-12 Thread Ronnie Sahlberg
Making errno when returning from log_ref_setup() meaningful, Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 29 - refs.h | 4 +++- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/refs.c b/refs.c index b4b05bd..6f85bd8 100644 ---

[PATCH v16 00/48] Use ref transactions

2014-06-12 Thread Ronnie Sahlberg
Final Final version. 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

[PATCH v16 26/48] replace.c: use the ref transaction functions for updates

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

[PATCH v16 11/48] refs.c: make remove_empty_directories alwasy set errno to something sane

2014-06-12 Thread Ronnie Sahlberg
Making errno when returning from remove_empty_directories() more obviously meaningful, which should provide some peace of mind for people auditing lock_ref_sha1_basic. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff

[PATCH v16 33/48] fast-import.c: use a ref transaction when dumping tags

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

[PATCH v16 23/48] refs.c: make ref_transaction_begin take an err argument

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

[PATCH v16 02/48] refs.c: ref_transaction_commit should not free the transaction

2014-06-12 Thread Ronnie Sahlberg
Reviewed-by: Jonathan Nieder jrnie...@gmail.com Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- builtin/update-ref.c | 1 + refs.c | 1 - refs.h | 5 ++--- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/builtin/update-ref.c b/builtin/update-ref.c

[PATCH v16 08/48] refs.c: add an err argument to repack_without_refs

2014-06-12 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 this function. Signed-off-by: Ronnie Sahlberg sahlb...@google.com

Re: [PATCH] l10n: de.po: fix typo

2014-06-12 Thread Stefan Beller
On 12.06.2014 18:12, Ralf Thielow wrote: Signed-off-by: Ralf Thielow ralf.thie...@gmail.com --- po/de.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/po/de.po b/po/de.po index b777ef4..d7bc424 100644 --- a/po/de.po +++ b/po/de.po @@ -3503,7 +3503,7 @@ msgstr

Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config

2014-06-12 Thread Jeremiah Mahler
Caleb, On Thu, Jun 12, 2014 at 08:51:31AM -0500, Caleb Thompson wrote: I assume that you're running it against master? I rebased the branch yesterday, but I'll give it another shot. Obviously I didn't use git-am, but I can try that. Caleb Thompson On Thu, Jun 12, 2014 at 01:41:52AM

Re: [git] Re: Relative submodule URLs, and forks that haven't forked the submodule

2014-06-12 Thread W. Trevor King
On Thu, Jun 12, 2014 at 06:05:10PM +0200, Charles Brossollet wrote: The two problems I'm pointing are: 1. After checkout of a branch that tracks /user/main repo, call git init submodule motors. Git registers it in .git/config with URL /user/sub, while it should be /central/sub

Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config

2014-06-12 Thread Jeremiah Mahler
On Thu, Jun 12, 2014 at 11:04:59AM -0700, Jeremiah Mahler wrote: Caleb, ... Thanks for checking. Unfortunately the problem persists for me. It seems to be related to there not being a space at the left most part of the patch. It is just a tab with no space. So 'git am' has a problem

Re: [PATCH 15/17] commit-slab: provide a static initializer

2014-06-12 Thread Junio C Hamano
Jeff King p...@peff.net writes: Callers currently must use init_foo_slab() at runtime before accessing a slab. For global slabs, it's much nicer if we can initialize them in BSS, so that each user does not have to add code to check-and-initialize. Signed-off-by: Jeff King p...@peff.net ---

[PATCH] l10n: de.po: improve message when switching branches

2014-06-12 Thread Ralf Thielow
Suggested-by: Stefan Beller stefanbel...@gmail.com Signed-off-by: Ralf Thielow ralf.thie...@gmail.com --- Am 12. Juni 2014 19:59 schrieb Stefan Beller stefanbel...@gmail.com: On 12.06.2014 18:12, Ralf Thielow wrote: Signed-off-by: Ralf Thielow ralf.thie...@gmail.com #, c-format msgid

Re: [PATCH 08/17] provide a helper to free commit buffer

2014-06-12 Thread Junio C Hamano
Jeff King p...@peff.net writes: This converts two lines into one at each caller. But more importantly, it abstracts the concept of freeing the buffer, which will make it easier to change later. Note that we also need to provide a detach mechanism for the weird case in fsck which passes the

Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config

2014-06-12 Thread Caleb Thompson
Jeremiah, On Thu, Jun 12, 2014 at 11:04:59AM -0700, Jeremiah Mahler wrote: Thanks for checking. Unfortunately the problem persists for me. It seems to be related to there not being a space at the left most part of the patch. It is just a tab with no space. So 'git am' has a problem

Re: [PATCH v5 00/11] add performance tracing facility

2014-06-12 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes: Here's v5 of the performance tracing patch series, now including a bunch of cleanups and adding timestamp, file and line to all trace output. I'm particularly interested in feedback for the output format. As file names have different lengths,

Re: [PATCH v2] completion: Handle '!f() { ... }; f' aliases

2014-06-12 Thread Steffen Prohaska
On Jun 10, 2014, at 7:27 AM, Junio C Hamano gits...@pobox.com wrote: Steffen Prohaska proha...@zib.de writes: I tend to prefer writing it like so instead: sh -c '...' - so that I won't clobber f (or any other name). I wonder if you can help users of this other pattern as well.

Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config

2014-06-12 Thread Jeremiah Mahler
Caleb, On Thu, Jun 12, 2014 at 01:23:41PM -0500, Caleb Thompson wrote: Jeremiah, On Thu, Jun 12, 2014 at 11:04:59AM -0700, Jeremiah Mahler wrote: ... How are you preparing your patches. 'git format-patch' with a 'git send-email'? I'm so glad you asked, because I've just been

[PATCH v2] completion: Handle '!f() { ... }; f' and !sh -c '...' aliases

2014-06-12 Thread Steffen Prohaska
'!f() { ... }; f' and !sh -c '' are recommended patterns for declaring more complex aliases (see git wiki [1]). This commit teaches the completion to handle them. When determining which completion to use for an alias, an opening brace or single quote is now skipped, and the search for a git

Re: [PATCH v3 1/2] add strbuf_set operations

2014-06-12 Thread Junio C Hamano
Jeremiah Mahler jmmah...@gmail.com writes: A common use case with strubfs is to set the buffer to a new value. This must be done in two steps: a reset followed by an add. strbuf_reset(buf); strbuf_add(buf, new_buf, len); In cases where the buffer is being built up in steps, these

Re: [PATCH v3 1/2] add strbuf_set operations

2014-06-12 Thread Junio C Hamano
Jeremiah Mahler jmmah...@gmail.com writes: Thomas, On Thu, Jun 12, 2014 at 10:11:36AM +0200, Thomas Braun wrote: Am 12.06.2014 09:29, schrieb Jeremiah Mahler: A common use case with strubfs is to set the buffer to a new value. strubfs??? This must be done in two steps: a reset followed

Re: [PATCH RFC] git-am: support any number of signatures

2014-06-12 Thread Junio C Hamano
Michael S. Tsirkin m...@redhat.com writes: I'm using different signature tags for git am depending on the patch, project and other factors. Sometimes I add multiple tags as well, e.g. QEMU wants both Reviewed-by and Signed-off-by tags. This patch makes it easy to do so: 1. new parameter

Re: [PATCH 1/5] hashmap: add enum for hashmap free_entries option

2014-06-12 Thread Junio C Hamano
Karsten Blees karsten.bl...@gmail.com writes: Am 10.06.2014 12:17, schrieb Heiko Voigt: The intention of Jonathans critique here[1] was that you do not see what this parameter does on the callsite. I.e.: hashmap_free(map, 1); compared to hashmap_free(map,

Re: [PATCH v4 1/4] commit test: Use test_config instead of git-config

2014-06-12 Thread Caleb Thompson
Jeremiah, That looks great. Since I'm not seeing any more feedback on the code for this set of patches, I'll go ahead and send up another set. Thank you for those pointers. Caleb Thompson On Thu, Jun 12, 2014 at 11:46:37AM -0700, Jeremiah Mahler wrote: Caleb, On Thu, Jun 12, 2014 at

Re: [PATCH RFC] git-am: support any number of signatures

2014-06-12 Thread René Scharfe
Am 12.06.2014 18:12, schrieb Michael S. Tsirkin: @@ -136,7 +136,7 @@ fall_back_3way () { eval $cmd GIT_INDEX_FILE=$dotest/patch-merge-tmp-index \ git write-tree $dotest/patch-merge-base+ || -cannot_fallback $(gettext Repository lacks necessary blobs to fall back on 3-way

Re: [PATCH v3 1/2] add strbuf_set operations

2014-06-12 Thread Jeremiah Mahler
Junio, Comments below... On Thu, Jun 12, 2014 at 11:50:41AM -0700, Junio C Hamano wrote: Jeremiah Mahler jmmah...@gmail.com writes: A common use case with strubfs is to set the buffer to a new value. This must be done in two steps: a reset followed by an add. strbuf_reset(buf);

Re: [PATCH v3 1/2] add strbuf_set operations

2014-06-12 Thread Jeremiah Mahler
Junio, On Thu, Jun 12, 2014 at 11:51:19AM -0700, Junio C Hamano wrote: Jeremiah Mahler jmmah...@gmail.com writes: Thomas, On Thu, Jun 12, 2014 at 10:11:36AM +0200, Thomas Braun wrote: Am 12.06.2014 09:29, schrieb Jeremiah Mahler: A common use case with strubfs is to set the buffer

[PATCH v5 0/4] commit: Add commit.verbose configuration

2014-06-12 Thread Caleb Thompson
This patch allows people to set commit.verbose to implicitly send --verbose to git-commit. This version incorporates changes suggested by Eric Sunshine, Duy Nguyen, and Jeremiah Mahler. It introduces several cleanup patches to t/t7505-commit-verbose.sh to bring it closer to the current state of

[PATCH v5 1/4] commit test: Use test_config instead of git-config

2014-06-12 Thread Caleb Thompson
Some of the tests in t/t7507-commit-verbose.sh were still using git-config to set configuration. Change them to use the test_config helper. Signed-off-by: Caleb Thompson ca...@calebthompson.io --- t/t7507-commit-verbose.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v5 2/4] commit test: Use write_script

2014-06-12 Thread Caleb Thompson
Use write_script from t/test-lib-functions.sh instead of cat, shebang, and chmod. This protects us from potential shell meta-characters in the name of our trash directory, which would be interpreted if we set $EDITOR directly. Signed-off-by: Caleb Thompson ca...@calebthompson.io ---

[PATCH v5 3/4] commit test: test_set_editor in each test

2014-06-12 Thread Caleb Thompson
t/t7507-commit-verbose.sh was using a global test_set_editor call to build its environment. Improve robustness against global state changes by having only tests which intend to use the $EDITOR to check for presence of a diff in the editor set up the test-editor to use check-for-diff rather than

Re: [PATCH v4 0/1] receive-pack: optionally deny case clone refs

2014-06-12 Thread Junio C Hamano
David Turner dtur...@twopensource.com writes: This issue bit us again recently. In talking with some colleagues, I realized that the previous version of this patch, in addition to being potentially slow, was incomplete. Specifically, it didn't handle the case of refs/heads/case/one vs

Re: [PATCH 15/17] commit-slab: provide a static initializer

2014-06-12 Thread Jeff King
On Thu, Jun 12, 2014 at 11:15:49AM -0700, Junio C Hamano wrote: Why do we need an initialiser at this point (in other words, how have other existing slab users coped without having one)? I think they call init_*_slab() when the slab is needed/used the first time (e.g. it is not even worth

[PATCH v5 4/4] commit: Add commit.verbose configuration

2014-06-12 Thread Caleb Thompson
Add a new configuration variable commit.verbose to implicitly pass --verbose to git-commit. Ensure that --no-verbose to git-commit negates that setting. Signed-off-by: Caleb Thompson ca...@calebthompson.io --- Documentation/config.txt | 5 + Documentation/git-commit.txt

Re: [PATCH 08/17] provide a helper to free commit buffer

2014-06-12 Thread Jeff King
On Thu, Jun 12, 2014 at 11:22:31AM -0700, Junio C Hamano wrote: Note that we also need to provide a detach mechanism for the weird case in fsck which passes the buffer back to be freed. I find that last sentence a bit of white lie ;-). The sole caller of detach is in index-pack, and

Re: [PATCH v5 0/4] commit: Add commit.verbose configuration

2014-06-12 Thread Jeremiah Mahler
On Thu, Jun 12, 2014 at 02:38:58PM -0500, Caleb Thompson wrote: This patch allows people to set commit.verbose to implicitly send --verbose to git-commit. This version incorporates changes suggested by Eric Sunshine, Duy Nguyen, and Jeremiah Mahler. It introduces several cleanup patches

  1   2   >