[PATCH 5/5] connect.c: replace signal() with sigaction()

2014-05-27 Thread Jeremiah Mahler
>From signal(2) The behavior of signal() varies across UNIX versions, and has also var‐ ied historically across different versions of Linux. Avoid its use: use sigaction(2) instead. See Portability below. Replaced signal() with sigaction() in connect.c Signed-off-by: Jeremiah Mahler

[PATCH 1/5] progress.c: replace signal() with sigaction()

2014-05-27 Thread Jeremiah Mahler
>From signal(2) The behavior of signal() varies across UNIX versions, and has also var‐ ied historically across different versions of Linux. Avoid its use: use sigaction(2) instead. See Portability below. Replaced signal() with sigaction() in progress.c Signed-off-by: Jeremiah Mahler

[PATCH 2/5] daemon.c run_service(): replace signal() with sigaction()

2014-05-27 Thread Jeremiah Mahler
>From signal(2) The behavior of signal() varies across UNIX versions, and has also var‐ ied historically across different versions of Linux. Avoid its use: use sigaction(2) instead. See Portability below. Replaced signal() with sigaction() in daemon.c run_service() Signed-off-by: Jere

[PATCH 4/5] daemon.c service_loop(): replace signal() with sigaction()

2014-05-27 Thread Jeremiah Mahler
>From signal(2) The behavior of signal() varies across UNIX versions, and has also var‐ ied historically across different versions of Linux. Avoid its use: use sigaction(2) instead. See Portability below. Replaced signal() with sigaction() in daemon.c service_loop() Signed-off-by: Jer

[PATCH 3/5] daemon.c child_handler(): replace signal() with sigaction()

2014-05-27 Thread Jeremiah Mahler
>From signal(2) The behavior of signal() varies across UNIX versions, and has also var‐ ied historically across different versions of Linux. Avoid its use: use sigaction(2) instead. See Portability below. Replaced signal() with sigaction() in daemon.c child_handler() Signed-off-by: Je

[PATCH 0/5] replace signal() with sigaction()

2014-05-27 Thread Jeremiah Mahler
>From signal(2) The behavior of signal() varies across UNIX versions, and has also var‐ ied historically across different versions of Linux. Avoid its use: use sigaction(2) instead. See Portability below. This patch set replaces calls to signal() with sigaction() in all files except si

Re: [PATCH 01/15] builtin/add.c: rearrange xcalloc arguments

2014-05-27 Thread Brian Gesiak
On Wed, May 28, 2014 at 7:41 AM, Junio C Hamano wrote: > I do not think it is worth doing this change starting from maint, so > I've dropped this one and a few others that did not apply to master > and queued the remainder to 'pu'. Thank you! I'll keep this in mind when choosing what to branch of

Re: [PATCH 01/15] builtin/add.c: rearrange xcalloc arguments

2014-05-27 Thread Jeremiah Mahler
On Tue, May 27, 2014 at 05:35:29PM -0400, Eric Sunshine wrote: > On Tue, May 27, 2014 at 7:32 AM, Brian Gesiak wrote: > > Oomph, how embarrassing. Thanks for pointing that out! > > Etiquette on this list is to avoid top-posting [1]. > > [1]: https://lkml.org/lkml/2005/1/11/111 > A: Because it

Hello

2014-05-27 Thread Steven Carter
We are a large Company and we offer flexibleLoans andFunding for all projects For more details please contact us. Regards, Steven -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.or

[PATCH] sideband.c: Get rid of ANSI sequences for non-terminal shell

2014-05-27 Thread Naumov, Michael (North Sydney)
Some git tools such as GitExtensions for Windows use environment variable TERM=msys which causes the weird ANSI sequence shown for the messages returned from server-side hooks We add those ANSI sequences to help format sideband data on the user's terminal. However, GitExtensions is not using a t

[PATCH v3] wording fixes in the user manual and glossary

2014-05-27 Thread Jeremiah Mahler
Re-worded the section on "Updating a repository with git fetch" in the user manual. Various other minor fixes in the manual and glossary. Signed-off-by: Jeremiah Mahler --- Notes: This revision includes suggestions from Chris Packham, Ben Aveling and Junio C Hamano [1]. [1]: ht

[BUG] git diff --(src|dst)-prefix=// causes spurious "(new|deleted) file mode"

2014-05-27 Thread Noam Postavsky
% git init Initialized empty Git repository in /home/npostavs/tmp/scratch/.git/ % echo foo > x % git add x % git commit -m x [master (root-commit) 41be1f2] x 1 file changed, 1 insertion(+) create mode 100644 x % echo bar > x % git diff | head -3 diff --git i/x w/x index 257cc56..5716ca5 100644 -

Re: [PATCH 00/15] Rearrange xcalloc arguments

2014-05-27 Thread Jeff King
On Mon, May 26, 2014 at 04:37:41PM -0700, Jeremiah Mahler wrote: > > xcalloc takes two arguments: the number of elements and their size. > > The vast majority of the Git codebase passes these arguments in the > > correct order, but there are some exceptions. This patch series > > corrects those ex

Re: [PATCH v11 13/41] refs.c: change ref_transaction_create to do error checking and return status

2014-05-27 Thread Jonathan Nieder
Hi, Ronnie Sahlberg wrote: > --- a/refs.h > +++ b/refs.h > @@ -215,6 +215,15 @@ enum action_on_err { > }; > > /* > + * Transaction functions that take an err argument will append an error > + * string to this buffer if there was a failure. > + * This string is not cleared on each call and may

Re: [PATCH v11 10/41] update-ref.c: log transaction error from the update_ref

2014-05-27 Thread Jonathan Nieder
Hi, Comments from http://marc.info/?l=git&m=140079653930751&w=2: Ronnie Sahlberg wrote: > [Subject: update-ref.c: log transaction error from the update_ref] The above description suggests that this is going to add new logging, or in other words that update_ref was being silent about transaction

Re: [PATCH v11 08/41] refs.c: add an err argument to delete_ref_loose

2014-05-27 Thread Jonathan Nieder
Hi, Comments from http://marc.info/?l=git&m=140079653930751&w=2: Ronnie Sahlberg wrote: [...] > --- a/refs.c > +++ b/refs.c > @@ -2491,17 +2491,43 @@ static int repack_without_ref(const char *refname) > return repack_without_refs(&refname, 1, NULL); > } > > -static int delete_ref_loose(

Re: [PATCH v11 06/41] refs.c: add an err argument to repack_without_refs

2014-05-27 Thread Jonathan Nieder
Hi, Comments from http://marc.info/?l=git&m=140079653930751&w=2: Ronnie Sahlberg wrote: > --- a/cache.h > +++ b/cache.h > @@ -559,6 +559,8 @@ struct lock_file { > #define LOCK_DIE_ON_ERROR 1 > #define LOCK_NODEREF 2 > extern int unable_to_lock_error(const char *path, int err); > +extern void

Re: [PATCH] config: respect '~' and '~user' in mailmap.file

2014-05-27 Thread Øystein Walle
Jeff King peff.net> writes: > > Makes sense. Curious if there was a reason we did not use it in the > first place, I looked at the history. The reason is that mailmap.file > was added in d551a48 (2009-02-08) and git_config_pathname came months > later in 395de25 (2009-11-17). Retro-fitting it no

Re: [PATCH v11 02/41] refs.c: ref_transaction_commit should not free the transaction

2014-05-27 Thread Jonathan Nieder
Ronnie Sahlberg wrote: > Signed-off-by: Ronnie Sahlberg > --- > builtin/update-ref.c | 1 + > refs.c | 1 - > refs.h | 5 ++--- > 3 files changed, 3 insertions(+), 4 deletions(-) Reviewed-by: Jonathan Nieder -- To unsubscribe from this list: send the line "unsubscri

Re: [PATCH v3 4/5] commit test: test_set_editor in each test

2014-05-27 Thread Eric Sunshine
On Mon, May 26, 2014 at 2:56 PM, Caleb Thompson wrote: > t/t7507-commit-verbose.sh was using a global test_set_editor call to > build its environment. > > Rather than building global state with test_set_editor at the beginning > of the file, move test_set_editor calls into each test. Rather than

RFC: optionally reject case-clone branch names

2014-05-27 Thread David Turner
At present, it is possible to have two branches which are the same but for case. This works great on the case-sensitive filesystems, but not so well on case-insensitive filesystems. It is fairly typical to have case-insensitive clients (Macs, say) with a case-sensitive server (GNU/Linux). Shou

Re: [PATCH v3 3/5] commit test: Use write_script

2014-05-27 Thread Junio C Hamano
Eric Sunshine writes: >> -cat >check-for-diff <> -#!$SHELL_PATH >> -exec grep '^diff --git' "\$1" >> +write_script check-for-diff <<-EOF >> + exec grep '^diff --git' "\$1" > > Food for thought: > > The original code used < evaluated at script creation time, and took special care to escape $

Re: [PATCH 01/15] builtin/add.c: rearrange xcalloc arguments

2014-05-27 Thread Junio C Hamano
Eric Sunshine writes: > If you do re-roll, perhaps consider simplifying the commit messages. > The patch itself states concisely and precisely what is being changed; > the lengthy prose description doesn't really add anything (and makes > more work for you and the reader of the message). It might

Re: [PATCH v3 3/5] commit test: Use write_script

2014-05-27 Thread Eric Sunshine
On Mon, May 26, 2014 at 2:56 PM, Caleb Thompson wrote: > Use write_script from t/test-lib-functions instead of cat, shebang, and > chmod. > > Signed-off-by: Caleb Thompson > --- > t/t7507-commit-verbose.sh | 6 ++ > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/t/t7507-com

Re: [PATCH] contrib: add convert-grafts-to-replace-refs.sh

2014-05-27 Thread Junio C Hamano
Eric Sunshine writes: >> +echo "Success! All the grafts in '$GRAFTS_FILE' have been converted to >> replace refs!" >> +echo "You should now move away or delete the grafts file: '$GRAFTS_FILE'" > > Rather than merely giving advice, would it make sees for the script > rename the file (adding .bak

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

2014-05-27 Thread Pasha Bolokhov
I've sent out version [PATCH v4] with most of the things addressed. That one hasn't been reviewed by anyone yet On Tue, May 27, 2014 at 11:04 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> On Sat, May 24, 2014 at 12:33 AM, Pasha Bolokhov >> wrote: >>> When an explicit '--git-dir' option p

Re: [PATCH 01/15] builtin/add.c: rearrange xcalloc arguments

2014-05-27 Thread Eric Sunshine
On Tue, May 27, 2014 at 7:32 AM, Brian Gesiak wrote: > Oomph, how embarrassing. Thanks for pointing that out! Etiquette on this list is to avoid top-posting [1]. [1]: https://lkml.org/lkml/2005/1/11/111 > Would it be better if I rerolled the patches? Junio may or may not make small fixes himse

Re: [PATCH] contrib: add convert-grafts-to-replace-refs.sh

2014-05-27 Thread Eric Sunshine
On Tuesday, May 27, 2014, Christian Couder wrote: > > This script adds into contrib/ an example script to convert > grafts from an existing grafts file into replace refs using > the new --graft option of "git replace". > > While at it let's mention this new script in the > "git replace" documentat

[PATCH v11 07/41] refs.c: make ref_update_reject_duplicates take a strbuf argument for errors

2014-05-27 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 v11 10/41] update-ref.c: log transaction error from the update_ref

2014-05-27 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 v11 06/41] refs.c: add an err argument to repack_without_refs

2014-05-27 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. Add a new function unable_to_loc

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

2014-05-27 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 v11 21/41] fast-import.c: change update_branch to use ref transactions

2014-05-27 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..4a7b196 100644 --- a/fast-import.c +++ b/fast-

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

2014-05-27 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 v11 22/41] branch.c: use ref transaction for all ref updates

2014-05-27 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 up

[PATCH v11 30/41] refs.c: remove lock_ref_sha1

2014-05-27 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 Sig

[PATCH v11 26/41] walker.c: use ref transaction for ref updates

2014-05-27 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 v11 31/41] refs.c: make prune_ref use a transaction to delete the ref

2014-05-27 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 v11 35/41] refs.c: pack all refs before we start to rename a ref

2014-05-27 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. We want to do this to make it easier to handle atomic renames in rename_ref for the case 'git branch -m

[PATCH v11 19/41] commit.c: use ref transactions for updates

2014-05-27 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 | 24 +++- 1 file changed, 11 insertions(+), 13 dele

[PATCH v11 28/41] refs.c: remove the update_ref_lock function

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

[PATCH v11 27/41] refs.c: make lock_ref_sha1 static

2014-05-27 Thread Ronnie Sahlberg
No external callers reference lock_ref_sha1 any more so lets declare it static. Reviewed-by: Jonathan Nieder 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 fd8f3cf..01d8ac4 100644 --- a/refs.c

[PATCH v11 36/41] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-05-27 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 v11 39/41] refs.c: propagate any errno==ENOTDIR from _commit back to the callers

2014-05-27 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 the

[PATCH v11 17/41] tag.c: use ref transactions when doing updates

2014-05-27 Thread Ronnie Sahlberg
Change tag.c to use ref transactions for all ref updates. Reviewed-by: Jonathan Nieder Signed-off-by: Ronnie Sahlberg --- builtin/tag.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builtin/tag.c b/builtin/tag.c index c6e8a71..c9bfc9a 100644 --- a/builtin/t

[PATCH v11 18/41] replace.c: use the ref transaction functions for updates

2014-05-27 Thread Ronnie Sahlberg
Update replace.c to use ref transactions for updates. Reviewed-by: Jonathan Nieder Signed-off-by: Ronnie Sahlberg --- builtin/replace.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/builtin/replace.c b/builtin/replace.c index 3da1bae..f24d814 100644 --- a/b

[PATCH v11 38/41] refs.c: pass a skip list to name_conflict_fn

2014-05-27 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 v11 15/41] refs.c: make ref_transaction_begin take an err argument

2014-05-27 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 hypothe

[PATCH v11 20/41] sequencer.c: use ref transactions for all ref updates

2014-05-27 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..fd8acaf 100644 --- a/sequencer.c +++ b/sequencer.c @@ -272

[PATCH v11 16/41] refs.c: add transaction.status and track OPEN/CLOSED/ERROR

2014-05-27 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 | 42 +- 1 file changed, 41

[PATCH v11 25/41] fast-import.c: use a ref transaction when dumping tags

2014-05-27 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 4a7b196..3db5b3d 100644 --- a/fast-import.c +++ b/fast-import.c @@ -1735,15 +1735,22 @@ static void dump_tags(void) {

[PATCH v11 40/41] fetch.c: change s_update_ref to use a ref transaction

2014-05-27 Thread Ronnie Sahlberg
Change s_update_ref to use a ref transaction for the ref update. Signed-off-by: Ronnie Sahlberg --- builtin/fetch.c | 22 ++ 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index faa1233..c46ccd9 100644 --- a/builtin/fetch.c ++

[PATCH v11 14/41] refs.c: update ref_transaction_delete to check for error and return status

2014-05-27 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 v11 09/41] refs.c: make update_ref_write update a strbuf on failure

2014-05-27 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 v11 11/41] refs.c: remove the onerr argument to ref_transaction_commit

2014-05-27 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 v11 24/41] receive-pack.c: use a reference transaction for updating the refs

2014-05-27 Thread Ronnie Sahlberg
Wrap all the ref updates inside a transaction. Signed-off-by: Ronnie Sahlberg --- builtin/receive-pack.c | 43 ++- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index c323081..c88dc03 100644

[PATCH v11 32/41] refs.c: make delete_ref use a transaction

2014-05-27 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 | 34 +- 1 file changed, 13 insertions(+), 21 deletio

[PATCH v11 12/41] refs.c: change ref_transaction_update() to do error checking and return status

2014-05-27 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 v11 33/41] refs.c: pass the ref log message to _create/delete/update instead of _commit

2014-05-27 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 v11 13/41] refs.c: change ref_transaction_create to do error checking and return status

2014-05-27 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 v11 41/41] refs.c: make write_ref_sha1 static

2014-05-27 Thread Ronnie Sahlberg
No external users call write_ref_sha1 any more so lets declare it static. Signed-off-by: Ronnie Sahlberg --- refs.c | 6 +- refs.h | 3 --- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c index c108007..2b51547 100644 --- a/refs.c +++ b/refs.c @@ -2622,6 +2622,

[PATCH v11 08/41] refs.c: add an err argument to delete_ref_loose

2014-05-27 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 v11 37/41] refs.c: call lock_ref_sha1_basic directly from commit

2014-05-27 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 Signed-off-by: Ronnie Sahlberg --- refs.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/refs.c b/refs.c index 2952871..2

[PATCH v11 23/41] refs.c: change update_ref to use a transaction

2014-05-27 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 9992da4..fd8f3cf 100644 --- a/refs.c +++ b/refs.c @@ -3474,11

[PATCH v11 01/41] refs.c: remove ref_transaction_rollback

2014-05-27 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 Signed

[PATCH v11 34/41] refs.c: pass NULL as *flags to read_ref_full

2014-05-27 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 Signed-off-by: Ronnie Sahlberg --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs.c

[PATCH v11 02/41] refs.c: ref_transaction_commit should not free the transaction

2014-05-27 Thread Ronnie Sahlberg
Signed-off-by: Ronnie Sahlberg --- 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 index 405267f..1fd7a89 100644 --- a/builtin/update-ref.c +++ b/buil

[PATCH v11 29/41] refs.c: remove the update_ref_write function

2014-05-27 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 v11 04/41] refs.c: allow passing NULL to ref_transaction_free

2014-05-27 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. Re

[PATCH v11 00/41] Use ref transactions

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

Re: [PATCH] t9138-git-svn-authors-prog.sh fixups

2014-05-27 Thread Jeremiah Mahler
Junio, On Tue, May 27, 2014 at 12:43:06PM -0700, Junio C Hamano wrote: > Jeremiah Mahler writes: > ... > > diff --git a/t/t9138-git-svn-authors-prog.sh > > b/t/t9138-git-svn-authors-prog.sh > > index 83cc5fc..d54c37a 100755 > > --- a/t/t9138-git-svn-authors-prog.sh > > +++ b/t/t9138-git-svn-aut

Re: [PATCH v2] wording fixes in the user manual and glossary

2014-05-27 Thread Junio C Hamano
Jeremiah Mahler writes: > Various minor wording fixes throughout the user manual > and glossary. > > The section on "Updating a repository with git fetch" was > substantially re-worded to try and better explain `git fetch`. > > Signed-off-by: Jeremiah Mahler > --- > > Notes: > From the feedb

Re: [PATCH] t9138-git-svn-authors-prog.sh fixups

2014-05-27 Thread Junio C Hamano
Jeremiah Mahler writes: > Several fixups of the t9138-git-svn-authors-prog.sh test script to > follow current recommendations in t/README. > > - Fixed a Perl script with a full "#!/usr/bin/perl" shebang > to use write_script() and $PERL_PATH as per t/README. > > - Placed svn-authors data

Re: [PATCH v10 25/44] receive-pack.c: use a reference transaction for updating the refs

2014-05-27 Thread Ronnie Sahlberg
On Fri, May 23, 2014 at 2:02 PM, Michael Haggerty wrote: > On 05/23/2014 06:14 PM, Ronnie Sahlberg wrote: >> On Fri, May 23, 2014 at 6:49 AM, Michael Haggerty >> wrote: >>> [...] >>> When I combine these two lines of thought, it suggests to me that we >>> could do a better job of supporting *bot

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

2014-05-27 Thread Ronnie Sahlberg
On Sat, May 17, 2014 at 5:40 AM, Michael Haggerty wrote: > On 05/16/2014 07:36 PM, Ronnie Sahlberg wrote: >> 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

Re: [PATCH v10 11/12] Documentation: add documentation for 'git interpret-trailers'

2014-05-27 Thread Junio C Hamano
Christian Couder writes: > From: Michael Haggerty > ... > An option like --input-separator might be enough to support this. > >> For me this means: >> >> * Enumerating a list of allowed separators (e.g., [:=#]) > > Junio suggested in a message that users might use different separators > like '%

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

2014-05-27 Thread Ronnie Sahlberg
On Sat, May 17, 2014 at 7:56 AM, Michael Haggerty wrote: > On 05/16/2014 07:37 PM, Ronnie Sahlberg wrote: >> 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 f

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

2014-05-27 Thread Ronnie Sahlberg
On Thu, May 22, 2014 at 4:08 PM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: > >> This patch series can also be found at >> https://github.com/rsahlberg/git/tree/ref-transactions > > Continuing with the review of 65a1cb7b (2014-05-22 12:08): > > 11/40 change ref_transaction_update() to do err

Re: [PATCH v1 0/3] Add --graft option to git replace

2014-05-27 Thread Christian Couder
From: Junio C Hamano Subject: Re: [PATCH v1 0/3] Add --graft option to git replace Date: Fri, 23 May 2014 09:59:05 -0700 > Christian Couder writes: > >> Here is a small patch series to implement: >> >> git replace [-f] --graft [...] >> >> The changes since the RFC/PATCH are the following:

Re: [PATCH/RFC] clean: add a flag to back up cleaned files

2014-05-27 Thread Jeff King
On Tue, May 27, 2014 at 08:12:52PM +0200, Erik Faye-Lund wrote: > > I've definitely considered doing something like this before (and for > > "git reset --hard"). My biggest concern would be poor performance in > > some cases. But since it's optional, and one can presumably override it > > with --n

Re: [RFC 3/3] tests: Add 'rebase -i commits that overwrite untracked files'

2014-05-27 Thread Junio C Hamano
Fabian Ruch writes: > If a todo list will cherry-pick a commit that adds some file and the > working tree already contains a file with the same name, the rebase > sequence for that todo list will be interrupted and the cherry-picked > commit will be lost after the rebasing process is resumed. > >

Re: [RFC 1/3] sequencer: Signal failed ff as an aborted, not a conflicted merge

2014-05-27 Thread Junio C Hamano
Fabian Ruch writes: > `do_pick_commit` handles three situations if it is not fast-forwarding. > In order for `do_pick_commit` to identify the situation, it examines the > return value of the selected merge command. > > 1. return value 0 stands for a clean merge > 2. 1 is passed in case of a faile

Re: [PATCH v8 42/44] refs.c: pass a skip list to name_conflict_fn

2014-05-27 Thread Ronnie Sahlberg
On Thu, May 22, 2014 at 12:27 PM, Jonathan Nieder wrote: > Ronnie Sahlberg wrote: > >> --- a/refs.c >> +++ b/refs.c >> @@ -798,11 +798,19 @@ struct name_conflict_cb { >> const char *refname; >> const char *oldrefname; >> const char *conflicting_refname; >> + const char **skip

Re: [RFC 2/3] rebase -i: Reschedule tasks that failed before the index was touched

2014-05-27 Thread Phil Hord
Hi Fabian, Thanks for looking into this. On 05/27/2014 07:56 AM, Michael Haggerty wrote: >> +reschedule_last_action () { >> +tail -n 1 "$done" | cat - "$todo" >"$todo".new >> +sed -e \$d <"$done" >"$done".new >> +mv -f "$todo".new "$todo" >> +mv -f "$done".new "$done" >> +} >> + >

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

2014-05-27 Thread Junio C Hamano
Michael Haggerty writes: > This suggests to me that our current structure is best modeled as two > independent reference back ends, with a third implementation of the same > reference API whose job it is to compose the first two. In pseudocode, > ... That is an interesting view. How does reflo

Re: [PATCH/RFC] clean: add a flag to back up cleaned files

2014-05-27 Thread Erik Faye-Lund
On Tue, May 27, 2014 at 6:37 PM, Jeff King wrote: > On Tue, May 27, 2014 at 04:17:34PM +0200, Erik Faye-Lund wrote: > >> The combination of "git clean" and fat fingers can some times cause >> data-loss, which can be frustrating. >> >> So let's add a flag that imports the files to be deleted into t

Re: commit: support commit.verbose and --no-verbose

2014-05-27 Thread Junio C Hamano
Jeremiah Mahler writes: > On Fri, May 23, 2014 at 04:22:22PM -0500, Caleb Thompson wrote: >> This patch allows people to set `commit.verbose` to implicitly send >> `--verbose` > ... >> >> +cat >check-for-no-diff <> +#!$SHELL_PATH >> +exec grep -v '^diff --git' "\$1" >> +EOF >> +chmod +x check-

Re: [PATCH] gc --auto: do not lock refs in the background

2014-05-27 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > 9f673f9 (gc: config option for running --auto in background - > 2014-02-08) puts "gc --auto" in background to reduce user's wait > time. Part of the garbage collecting is pack-refs and pruning > reflogs. These require locking some refs and may abort other processes

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

2014-05-27 Thread Junio C Hamano
Duy Nguyen writes: > On Sat, May 24, 2014 at 12:33 AM, Pasha Bolokhov > wrote: >> When an explicit '--git-dir' option points to a directory inside >> the work tree, git treats it as if it were any other directory. >> In particular, 'git status' lists it as untracked, while 'git add -A' >> stages

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

2014-05-27 Thread Pasha Bolokhov
>> Add GIT_DIR to the list of excludes in setup_standard_excludes(), >> while checking that GIT_DIR is not just '.git', in which case it >> would be ignored by default, and that GIT_DIR is inside GIT_WORK_TREE >> > gives git-grep.txt and git-ls-files.txt. I don't know if we need to > add something

Re: [PATCH 1/2] remote: defer repacking packed-refs when deleting refs

2014-05-27 Thread Junio C Hamano
Jens Lindström writes: >> Puzzled > > There is one reason why one would want to call delete_ref() even if > the ref itself was already fully deleted by repack_without_refs() > (because it was only packed) and that is that delete_ref() also > removes the ref log, if there is one. Ahh, ok, no

Git chokes on large file

2014-05-27 Thread Dale R. Worley
I've discovered a problem using Git. It's not clear to me what the "correct" behavior should be, but it seems to me that Git is failing in an undesirable way. The problem arises when trying to handle a very large file. For example: $ git --version git version 1.8.3.1 $ mkdir $$

Re: [PATCH] sideband.c: Get rid of ANSI sequence for non-terminal shell

2014-05-27 Thread Jeff King
On Tue, May 27, 2014 at 01:27:12PM +1000, Michael Naumov wrote: > From ae8d04fdbd71cf322e67903826544d5431f2866d Mon Sep 17 00:00:00 2001 > From: Michael Naumov > Date: Tue, 27 May 2014 12:45:06 +1000 > Subject: [PATCH] sideband.c: Get rid of ANSI sequence for non-terminal shell You can drop thes

Re: [PATCH/RFC] clean: add a flag to back up cleaned files

2014-05-27 Thread Jeff King
On Tue, May 27, 2014 at 04:17:34PM +0200, Erik Faye-Lund wrote: > The combination of "git clean" and fat fingers can some times cause > data-loss, which can be frustrating. > > So let's add a flag that imports the files to be deleted into the > object-database, in a way similar to what git-stash

Re: [PATCH] config: respect '~' and '~user' in mailmap.file

2014-05-27 Thread Jeff King
On Tue, May 27, 2014 at 10:45:58AM +0200, Øystein Walle wrote: > git_config_string() does not handle '~' and '~user' as part of the > value. Using git_config_pathname() fixes this. Makes sense. Curious if there was a reason we did not use it in the first place, I looked at the history. The reason

[PATCH] gitweb: Harden UTF-8 handling in generated links

2014-05-27 Thread Jakub Narębski
W dniu 2014-05-15 21:28, Jakub Narębski pisze: > 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: >> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl >> index a9f57d6..f1414e1 100755 >> --- a/gitweb/g

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

2014-05-27 Thread Jakub Narębski
W dniu 2014-05-16 19:05, Junio C Hamano pisze: > Jakub Narębski writes: > >>> Correct, but is "where does it appear" the question we are >>> primarily interested in, wrt this breakage and its fix? >> >> That of course depends on how we want to test gitweb output. >> The simplest solution, compari

[PATCH/RFC] clean: add a flag to back up cleaned files

2014-05-27 Thread Erik Faye-Lund
The combination of "git clean" and fat fingers can some times cause data-loss, which can be frustrating. So let's add a flag that imports the files to be deleted into the object-database, in a way similar to what git-stash does. Maintain a reflog of the previously backed up clean-runs. Signed-off

Help with subtree pull / push

2014-05-27 Thread nicofari64
Hi I am new to git, trying to see if I can use it at my work place to replace Starteam. There is only one Starteam feature that I miss, comparing it to git: shared files. Most projects, here, use lot of shared files, and Starteam handle these pretty easily. You just check in (commit + push in git t

Re: [RFC/PATCH 1/2] config: Add cache for config value querying

2014-05-27 Thread Tanay Abhra
Hi, On 05/26/2014 01:02 PM, Torsten Bögershausen wrote: >> Add an internal cache with the all variable value pairs read from the usual > "cache": The word "cache" is in Git often used for "index" Okay, point noted. I thought about choosing between "hashmap" and "cache" and chose the later. > "va

  1   2   >