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

2014-05-15 Thread Jonathan Nieder
(). Reviewed-by: Jonathan Nieder jrnie...@gmail.com -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

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 char

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 mentions

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

2014-05-15 Thread Jonathan Nieder
); errno is not guaranteed valid here. The usual die(%s, err.buf); should do the trick. With the changes mentioned above (commit message typofix, die() message), Reviewed-by: Jonathan Nieder jrnie...@gmail.com Thanks. -- To unsubscribe from this list: send the line

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 sahlb...@google.com --- refs.c | 25 + 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/refs.c b/refs.c index

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? It

Re: [PATCH 1/2] config: be strict on core.commentChar

2014-05-16 Thread Jonathan Nieder
Nguyễn Thái Ngọc Duy wrote: --- a/config.c +++ b/config.c @@ -826,8 +826,12 @@ static int git_default_core_config(const char *var, const char *value) if (!strcmp(var, core.commentchar)) { const char *comment; int ret = git_config_string(comment, var,

Re: [PATCH 2/2] commit: allow core.commentChar=auto for character auto selection

2014-05-16 Thread Jonathan Nieder
Nguyễn Thái Ngọc Duy wrote: core.commentChar starts with '#' as in default but if it's already in the prepared message, find another one among a small subset. This should stop surprises because git strips some lines unexpectedly. Probably worth mentioning this only kicks in if someone

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

2014-05-16 Thread Jonathan Nieder
(cc-ing peff, who may remember this STORE_REF_ERROR_DF_CONFLICT case from long ago) 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

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

2014-05-16 Thread Jonathan Nieder
Ronnie Sahlberg wrote: This patch series can also be found at https://github.com/rsahlberg/git/tree/ref-transactions I think the rerolls are coming too fast. I've been using your repository on github to check if I should not send any particular comment because you've already fixed it, so the

Re: [PATCH v8 23/44] fetch.c: change s_update_ref to use a ref transaction

2014-05-16 Thread Jonathan Nieder
(+cc: peff for STORE_REF_ERROR_DF_CONFLICT expertise) Ronnie Sahlberg wrote: --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -375,7 +375,7 @@ static int s_update_ref(const char *action, [...] + transaction = ref_transaction_begin(); + if (!transaction || +

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

2014-05-16 Thread Jonathan Nieder
Ronnie Sahlberg wrote: 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. Fun. [...] --- a/builtin/fetch.c +++ b/builtin/fetch.c [...] @@ -373,27 +374,13 @@ static int

Re: [PATCH v8 23/44] fetch.c: change s_update_ref to use a ref transaction

2014-05-16 Thread Jonathan Nieder
Ronnie Sahlberg wrote: --- a/builtin/fetch.c +++ b/builtin/fetch.c [...] @@ -384,15 +384,16 @@ static int s_update_ref(const char *action, snprintf(msg, sizeof(msg), %s: %s, rla, action); errno = 0; - lock = lock_any_ref_for_update(ref-name, -

Re: [PATCH/RFC] send-pack.c: Allow to disable side-band-64k

2014-05-19 Thread Jonathan Nieder
Hi, Thomas Braun wrote: pushing over the dump git protocol with a windows git client. I've never heard of the dump git protocol. Do you mean the git protocol that's used with git:// URLs? [...] Alternative approaches considered but deemed too invasive: - Rewrite read/write wrappers in

Re: [PATCH 00/19] convert test -a/-o to and || patch series

2014-05-20 Thread Jonathan Nieder
Hi, Elia Pinto wrote: These patch series convert test -a/-o to and ||. Should this come with a new check in t/check-non-portable-shell.pl so we don't regress in the future? Elia Pinto (19): [...] check_bindir|2 +- contrib/examples/git-clone.sh |2 +-

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

2014-05-20 Thread Jonathan Nieder
Ronnie Sahlberg wrote: Wrap all the ref updates inside a transaction to make the update atomic. Interesting. [...] --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -46,6 +46,8 @@ static void *head_name_to_free; static int sent_capabilities; static int shallow_update;

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

2014-05-20 Thread Jonathan Nieder
Ronnie Sahlberg wrote: [Subject: fast-import.c: use a ref transaction when dumping tags] This seems like an odd thing to do: either it would make sense to have a single transaction for all imported refs so all fail or succeed together, or there would be separate transactions for each ref. That

Re: [PATCH/RFC] t0000-*.sh: Fix the GIT_SKIP_TESTS sub-tests

2014-05-20 Thread Jonathan Nieder
Ramsay Jones wrote: --- a/t/t-basic.sh +++ b/t/t-basic.sh @@ -296,8 +296,9 @@ test_expect_success 'test --verbose-only' ' ' test_expect_success 'GIT_SKIP_TESTS' - GIT_SKIP_TESTS='git.2' \ - run_sub_test_lib_test git-skip-tests-basic \ +

Re: [PATCH/RFC] t0000-*.sh: Fix the GIT_SKIP_TESTS sub-tests

2014-05-20 Thread Jonathan Nieder
Hi, Ramsay Jones wrote: On 20/05/14 22:40, Jonathan Nieder wrote: What should happen if I have set GIT_SKIP_TESTS explicitly to run only some of the tests in t-basic? A quick test (with the above patch applied) shows that it works as I would expect: $ GIT_SKIP_TESTS=t.1[2-6

Re: [PATCH v8 27/44] walker.c: use ref transaction for ref updates

2014-05-20 Thread Jonathan Nieder
Ronnie Sahlberg wrote: This changes the locking slightly for walker_fetch. Previously the code would lock all refs before writing them but now we do not lock the refs until the commit stage. There is thus a very short window where changes could be done locally during the fetch which would be

Re: [PATCH v8 28/44] refs.c: make write_ref_sha1 static

2014-05-20 Thread Jonathan Nieder
Ronnie Sahlberg wrote: No external users call write_ref_sha1 any more so lets declare it static. Yay! [...] +++ b/refs.c @@ -251,6 +251,8 @@ struct ref_entry { [...] static void read_loose_refs(const char *dirname, struct ref_dir *dir); +static int write_ref_sha1(struct ref_lock *lock, +

Re: [PATCH v8 29/44] refs.c: make lock_ref_sha1 static

2014-05-20 Thread Jonathan Nieder
Ronnie Sahlberg wrote: No external callers reference lock_ref_sha1 any more so lets declare it static. Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 2 +- refs.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) Reviewed-by: Jonathan Nieder jrnie...@gmail.com

Re: [PATCH v8 30/44] refs.c: add transaction.status and track OPEN/CLOSED/ERROR

2014-05-21 Thread Jonathan Nieder
Ronnie Sahlberg wrote: --- a/refs.c +++ b/refs.c @@ -3308,6 +3308,12 @@ struct ref_update { const char refname[FLEX_ARRAY]; }; +enum ref_transaction_status { + REF_TRANSACTION_OPEN = 0, + REF_TRANSACTION_CLOSED = 1, + REF_TRANSACTION_ERROR = 2, What is the

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

2014-05-21 Thread Jonathan Nieder
Ronnie Sahlberg wrote: Signed-off-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 30 ++ 1 file changed, 6 insertions(+), 24 deletions(-) Reviewed-by: Jonathan Nieder jrnie...@gmail.com -- To unsubscribe from this list: send the line unsubscribe git

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

2014-05-21 Thread Jonathan Nieder
Ronnie Sahlberg wrote: +++ b/refs.c [...] @@ -3518,14 +3499,16 @@ int ref_transaction_commit(struct ref_transaction *transaction, struct ref_update *update = updates[i]; if (!is_null_sha1(update-new_sha1)) { - ret = update_ref_write(msg,

Re: [PATCH] builtin/log.c: fix minor memory leak

2014-08-07 Thread Jonathan Nieder
many commits. Luckily this one is only used in make_cover_letter to create a cover letter describing the single branch on the command line, making it is a small, one-time leak. Less noise from static and dynamic analysis tools is still worthwhile, so for what it's worth, Reviewed-by: Jonathan

Re: possibly a spurious conflict in a three way merge

2014-08-07 Thread Jonathan Nieder
Hi, meanlo...@gmail.com wrote: 2. commit test.txt to master: line1 line1 3. branch and checkout branch1 4. make and commit the following change to branch1: #line1 #line2 5. checkout master 6. make and commit the following change to master: line1 #line2 7. merge branch1, git sees a

[PATCH] Update hard-coded header dependencies

2014-08-08 Thread Jonathan Nieder
The fall-back rules used when compilers don't support the -MMD switch to generate makefile rules based on #includes have been out of date since v1.7.12.1~22^2~8 (move git_version_string into version.c, 2012-06-02). Checked with 'make CHECK_HEADER_DEPENDENCIES=yes'. Signed-off-by: Jonathan Nieder

Re: [PATCH] mailsplit.c: remove dead code

2014-08-12 Thread Jonathan Nieder
is introduced, and in the meantime this is simpler and does not change behavior. Reviewed-by: Jonathan Nieder jrnie...@gmail.com Thanks. -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org

[PATCH 0/3] Re: [PATCH] unpack-tree.c: remove dead code

2014-08-12 Thread Jonathan Nieder
be else return o-gently ? -1 : reject_merge(current, o); and then all calls could be replaced in a followup patch. Sensible? Thanks, Jonathan Nieder (2): unpack-trees: use 'cuddled' style for if-else cascade checkout -m: attempt merge when deletion

[PATCH 1/3] unpack-trees: simplify 'all other failures' case

2014-08-12 Thread Jonathan Nieder
recognizable for the end user. Simplify by just using 'current'. Noticed by coverity, Id:290002 Signed-off-by: Stefan Beller stefanbel...@gmail.com Improved-by: Junio C Hamano gits...@pobox.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- unpack-trees.c | 12 ++-- 1 file changed, 2

[PATCH 2/3] unpack-trees: use 'cuddled' style for if-else cascade

2014-08-12 Thread Jonathan Nieder
empty) lines, without any loss of readability. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- unpack-trees.c | 12 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/unpack-trees.c b/unpack-trees.c index f4a9aa9..187b15b 100644 --- a/unpack-trees.c +++ b/unpack

[PATCH 3/3] checkout -m: attempt merge when deletion of path was staged

2014-08-12 Thread Jonathan Nieder
at it, inline the o-gently check into reject_merge to prevent future call sites from making the same mistake. Noticed by code inspection. The motivating case hasn't been tested. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- This is the most iffy of the three patches, mostly because I was too lazy

Re: [PATCH/RFC] git-imap-send: use libcurl for implementation

2014-08-12 Thread Jonathan Nieder
Bernhard Reiter wrote: Use libcurl's high-level API functions to implement git-imap-send instead of the previous low-level OpenSSL-based functions. Wow! This sounds lovely. Thanks for working on this. [...] Since version 7.30.0, libcurl's API has been able to communicate with IMAP

Re: Git on Mac OS X 10.4.10

2014-08-14 Thread Jonathan Nieder
Hi Markus, export NO_APPLE_COMMON_CRYPTO=yes make configure CFLAGS=-O2 ./configure --without-tcltk --prefix=/usr/global make all compiles fine on 10.4.10. Would a configure patch checking for the existence of CommonHMAC.h and, if not found, defining this variable, be acceptable? Yes,

Re: Relative submodule URLs

2014-08-18 Thread Jonathan Nieder
Hi, Robert Dailey wrote: The documentation wasn't 100% clear on this, but I'm assuming by remote origin, it says that the relative URL is relative to the actual remote *named* origin (and it is not using origin as just a general terminology). Thanks for reporting. The remote used is the

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

2014-08-20 Thread Jonathan Nieder
Hi, Ronnie Sahlberg wrote: On Wed, Aug 20, 2014 at 7:52 AM, Michael Haggerty mhag...@alum.mit.edu wrote: I'm a little worried that abandoning *all* refname checks could open us up to somehow trying to delete a reference with a name like ../../../../etc/passwd. Either such names have to be

Re: Transaction patch series overview

2014-08-20 Thread Jonathan Nieder
Hi, Ronnie Sahlberg wrote: List, please see here an overview and ordering of the ref transaction patch series. Thanks much for this. [...] rs/ref-transaction-0 [...] Has been merged into next. This is even part of master now, so if people have review comments then they can make them most

Re: [PATCH 1/2] Makefile: use find to determine static header dependencies

2014-08-21 Thread Jonathan Nieder
, in particular preparing for a moment when $(LIB_H), which is part of $(LOCALIZED_C), can be computed on the fly. We still need a dependency on GENERATED_H, to force those files to be built when regenerating git.pot. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Makefile | 2 +- 1 file

Re: Hook post-merge does not get executed in case of confilicts

2014-08-21 Thread Jonathan Nieder
Hi, Bertram Scharpf wrote: today I wrote a port-merge hook. Then I just detected that it only gets executed when the merge is immediately successful. In case there is a conflict, I have to finish the merge using the command git commit. This will not call the post-merge hook. I think the

check-ref-format: include refs/ in the argument or to strip it?

2014-08-22 Thread Jonathan Nieder
Hi, Michael Haggerty wrote[1]: Jonathan Nieder wrote: The check-ref-format documentation is pretty unclear, but the intent is that it would be used like git check-ref-format heads/master (see the surviving examples in contrib/examples/). That way, it can enforce the rule (from git

Re: check-ref-format: include refs/ in the argument or to strip it?

2014-08-22 Thread Jonathan Nieder
Junio C Hamano wrote: implication of which is that the 'at least one slash' rule was to expect things are 'refs/anything' so there will be at least one. Even back then, that anything alone had at least one slash (e.g. heads/master), but the intention was *never* that we would

Re: check-ref-format: include refs/ in the argument or to strip it?

2014-08-22 Thread Jonathan Nieder
Junio C Hamano wrote: Michael Haggerty wrote[1]: Jonathan Nieder wrote: The check-ref-format documentation is pretty unclear, but the intent is that it would be used like git check-ref-format heads/master (see the surviving examples in contrib/examples/). That way, it can enforce

Re: check-ref-format: include refs/ in the argument or to strip it?

2014-08-25 Thread Jonathan Nieder
Ronnie Sahlberg wrote: On Fri, Aug 22, 2014 at 10:46 PM, Jeff King p...@peff.net wrote: Yeah, this weird do not allow refs/foo behavior has continually confused me. Coincidentally I just noticed a case today where pack-refs treats refs/foo specially for no good reason:

Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Jonathan Nieder
Jeff King wrote: -LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H) +LOCALIZED_C = $(C_OBJ:o=c) $(GENERATED_H) Why is LIB_H dropped here? This would mean that po/git.pot stops including strings from macros and static inline functions in headers (e.g., in parse-options.h). The rest looks

Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Jonathan Nieder
-prune -o \ -name Documentation -prune -o \ -name '*.h' -print) to avoid spending time looking in other dot-directories like .svn, .hg, or .snapshot. With or without such a change, Reviewed-by: Jonathan Nieder jrnie...@gmail.com -- To unsubscribe from this list: send

Re: [PATCH 2/3] Makefile: use `find` to determine static header dependencies

2014-08-25 Thread Jonathan Nieder
Junio C Hamano wrote: Jonathan Nieder jrnie...@gmail.com writes: Tiny nit: I might use $(shell $(FIND) * \ -name . -o -name '.*' -prune -o \ -name t -prune -o \ -name Documentation -prune -o \ -name '*.h' -print

Re: Transaction patch series overview

2014-08-25 Thread Jonathan Nieder
Jonathan Nieder wrote: Ronnie Sahlberg wrote: ref-transaction-1 (2014-07-16) 20 commits - Second batch of ref transactions - refs.c: make delete_ref use a transaction - refs.c: make prune_ref use a transaction to delete the ref

Re: Transaction patch series overview

2014-08-26 Thread Jonathan Nieder
(-) [...] Jonathan Nieder jrnie...@gmail.com writes: --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -580,18 +580,18 @@ static char *update(struct command *cmd, struct shallow_info *si) [...] if (!transaction || ref_transaction_update(transaction

[PATCH 0/20] rs/ref-transaction-1 (Re: Transaction patch series overview)

2014-08-26 Thread Jonathan Nieder
Jonathan Nieder wrote: This series teaches the tag, replace, commit, cherry-pick, fast-import, checkout -b, branch, receive-pack, and http-fetch commands and all update_ref and delete_ref callers to use the ref transaction API instead of lock_ref_sha1. The main user-visible change should

[PATCH 02/20] refs.c: update ref_transaction_delete to check for error and return status

2014-08-26 Thread Jonathan Nieder
that will return error but there will be in the future. Add an err argument that will be updated on failure. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/update-ref.c | 5 +++-- refs.c | 16 +++- refs.h

[PATCH 01/20] refs.c: change ref_transaction_create to do error checking and return status

2014-08-26 Thread Jonathan Nieder
that will return error but there will be in the future. Add an err argument that will be updated on failure. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/update-ref.c | 4 +++- refs.c | 18 -- refs.h

[PATCH 03/20] refs.c: make ref_transaction_begin take an err argument

2014-08-26 Thread Jonathan Nieder
() anyway, we may add other types of backends in the future. For example, a hypothetical MySQL backend could fail in _begin with Can not connect to MySQL server. No route to host. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/update

[PATCH 04/20] refs.c: add transaction.status and track OPEN/CLOSED

2014-08-26 Thread Jonathan Nieder
sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 9cb7908..cc63056 100644 --- a/refs.c +++ b/refs.c @@ -3387,6 +3387,21 @@ struct ref_update

[PATCH 05/20] tag.c: use ref transactions when doing updates

2014-08-26 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Wed, 16 Apr 2014 15:30:41 -0700 Change tag.c to use ref transactions for all ref updates. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/tag.c | 16 ++-- 1 file changed

[PATCH 06/20] replace.c: use the ref transaction functions for updates

2014-08-26 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Wed, 16 Apr 2014 15:32:29 -0700 Update replace.c to use ref transactions for updates. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/replace.c | 14 -- 1 file changed, 8

[PATCH 07/20] commit.c: use ref transactions for updates

2014-08-26 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Wed, 16 Apr 2014 15:34:19 -0700 Change commit.c to use ref transactions for all ref updates. Make sure we pass a NULL pointer to ref_transaction_update if have_old is false. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan

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

2014-08-26 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Wed, 16 Apr 2014 15:37:45 -0700 Change to use ref transactions for all updates to refs. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- sequencer.c | 26 ++ 1 file

[PATCH 10/20] branch.c: use ref transaction for all ref updates

2014-08-26 Thread Jonathan Nieder
/write_ref_sha1 did not protect against the ref already existing. I.e. one thread could end up overwriting a branch even if the forcing flag is false. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- branch.c | 31 +-- 1 file

[PATCH 09/20] fast-import.c: change update_branch to use ref transactions

2014-08-26 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Wed, 16 Apr 2014 16:21:13 -0700 Change update_branch() to use ref transactions for updates. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- fast-import.c | 25 +++-- 1

[PATCH 11/20] refs.c: change update_ref to use a transaction

2014-08-26 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Thu, 24 Apr 2014 16:36:55 -0700 Change the update_ref helper function to use a ref transaction internally. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 29

[PATCH 12/20] receive-pack.c: use a reference transaction for updating the refs

2014-08-26 Thread Jonathan Nieder
lock the ref 'refs/heads/topic'. To foo ! [remote rejected] HEAD - topic (failed to update ref) Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/receive-pack.c | 25 - 1 file changed, 16 insertions(+), 9

[PATCH 13/20] fast-import.c: use a ref transaction when dumping tags

2014-08-26 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Mon, 28 Apr 2014 15:23:58 -0700 Signed-off-by: Ronnie Sahlberg sahlb...@google.com Reviewed-by: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- fast-import.c | 29 +++-- 1 file

[PATCH 15/20] refs.c: make lock_ref_sha1 static

2014-08-26 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Mon, 28 Apr 2014 15:38:47 -0700 No external callers reference lock_ref_sha1 any more so let's declare it static. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Reviewed-by: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Jonathan Nieder

[PATCH 14/20] walker.c: use ref transaction for ref updates

2014-08-26 Thread Jonathan Nieder
and cause the fetch to fail for are even more rare. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- walker.c | 72 1 file changed, 41 insertions(+), 31 deletions(-) diff --git

[PATCH 17/20] refs.c: remove the update_ref_write function

2014-08-26 Thread Jonathan Nieder
from 1 to -1 on failures when writing to the ref. Eventually we will want _commit to start returning more detailed error conditions than the current simple success/failure. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 34

[PATCH 16/20] refs.c: remove the update_ref_lock function

2014-08-26 Thread Jonathan Nieder
...@google.com Reviewed-by: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 30 ++ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/refs.c b/refs.c index 0dc093c..de07791 100644 --- a/refs.c +++ b/refs.c @@ -3336,24

[PATCH 18/20] refs.c: remove lock_ref_sha1

2014-08-26 Thread Jonathan Nieder
stripped off before calling lock_ref_sha1. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Reviewed-by: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 15 +-- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/refs.c

[PATCH 19/20] refs.c: make prune_ref use a transaction to delete the ref

2014-08-26 Thread Jonathan Nieder
is private to refs.c and not exposed to external callers. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 28 +--- refs.h | 13 +++-- 2 files changed, 32 insertions(+), 9 deletions(-) diff --git

[PATCH 20/20] refs.c: make delete_ref use a transaction

2014-08-26 Thread Jonathan Nieder
on failure instead of the previous 0 on success either 1 or -1 on failure. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Reviewed-by: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- Thanks for reading. refs.c | 35

Re: problem with def of inet_ntop() in git-compat-util.h as well as other places

2014-08-27 Thread Jonathan Nieder
Hi, dev wrote: CC credential-store.o git-compat-util.h, line 516: error: identifier redeclared: inet_ntop current : function(int, pointer to const void, pointer to char, unsigned long) returning pointer to const char previous: function(int, pointer to const void, pointer to

Re: [PATCH] Document LF appearing in shallow command during send-pack/receive-pack

2014-08-27 Thread Jonathan Nieder
] - shallow = PKT-LINE(shallow SP obj-id) + shallow = PKT-LINE(shallow SP obj-id LF) In git, the client sends LF and the server is happy with or without LF. JGit and libgit2 don't send 'shallow' lines. Reviewed-by: Jonathan Nieder jrnie...@gmail.com command-list

Re: problem with def of inet_ntop() in git-compat-util.h as well as other places

2014-08-27 Thread Jonathan Nieder
Hi again, dev wrote: So I guess I have to create a config.mak file from somewhere. Sorry, let's take a step back. What exact commands do you use to build, starting from a pristine extracted tarball? What output do you get back? [...] Undefined first referenced

Re: revert top most commit

2014-08-27 Thread Jonathan Nieder
Keller, Jacob E wrote: On Wed, 2014-08-27 at 21:14 +, Keller, Jacob E wrote: I am having trouble using revert. If I attempt to $ git revert sha1id where sha1id is the same as the HEAD commit, I instead get the output of what looks like git status. [...] It's actually not my

Re: [PATCH] merge, pull: stop advising 'commit -a' in case of conflict

2014-08-28 Thread Jonathan Nieder
Matthieu Moy wrote: Signed-off-by: Matthieu Moy matthieu@imag.fr [...] --- advice.c| 3 +-- git-pull.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) Thanks for taking it on. Reviewed-by: Jonathan Nieder jrnie...@gmail.com [...] It was already on my todo-list

[PATCH 01/22] refs.c: change ref_transaction_create to do error checking and return status

2014-09-02 Thread Jonathan Nieder
that will return error but there will be in the future. Add an err argument that will be updated on failure. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Reviewed-by: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/update-ref.c | 4 +++- refs.c

[PATCH 22/22] update-ref --stdin: pass transaction around explicitly

2014-09-02 Thread Jonathan Nieder
This makes it more obvious at a glance where the output of functions parsing the --stdin stream goes. No functional change intended. Signed-off-by: Jonathan Nieder jrnie...@gmail.com Reviewed-by: Michael Haggerty mhag...@alum.mit.edu --- Thanks for reading. builtin/update-ref.c | 27

Re: [RFC PATCH v2 1/2] Makefile: add check-headers target

2014-09-07 Thread Jonathan Nieder
Hi, David Aguilar wrote: --- /dev/null +++ b/check-headers.sh @@ -0,0 +1,29 @@ [...] + $@ -Wno-unused -I$subdir -c -o $header.check -x c - $header All .c files in git are supposed to start by #include-ing git-compat-util.h, cache.h, or builtin.h to set the appropriate feature test

Re: [RFC PATCH v2 2/2] headers: include dependent headers

2014-09-07 Thread Jonathan Nieder
David Aguilar wrote: Add dependent headers so that including a header does not require including additional headers. I agree with this goal, modulo the compat-util.h caveat. Thanks for working on it. [...] --- a/archive.h +++ b/archive.h @@ -1,6 +1,7 @@ #ifndef ARCHIVE_H #define

Re: [RFC PATCH v2 2/2] headers: include dependent headers

2014-09-07 Thread Jonathan Nieder
Johannes Sixt wrote: Am 07.09.2014 21:49, schrieb Jonathan Nieder: +enum object_type; Enum forward declarations are a relatively new C feature. They certainly don't exist pre-C99. Good catch. That makes diff --git i/archive.h w/archive.h index 4a791e1..b2ca5bf 100644 --- i/archive.h +++ w

Re: [PATCH] fsck: exit with non-zero status upon error from fsck_obj()

2014-09-09 Thread Jonathan Nieder
Junio C Hamano wrote: By the way, Jonathan, with dbedf8bf (t1450 (fsck): remove dangling objects, 2010-09-06) you added a 'test_might_fail git fsck' to the 1450 test that catches an object corruption. Do you remember if there was some flakiness in this test that necessitated it, or is it

[PATCH v21 0/19] rs/ref-transaction (Re: Transaction patch series overview)

2014-09-10 Thread Jonathan Nieder
Jonathan Nieder wrote: The next series from Ronnie's collection is available at https://code-review.googlesource.com/#/q/topic:ref-transaction in case someone wants a fresh series to look at. Here is the outcome of that review. It could use another set of eyes (hint, hint) but should

[PATCH 01/19] mv test: recreate mod/ directory instead of relying on stale copy

2014-09-10 Thread Jonathan Nieder
behind by the earlier ones at all (making it easier to rearrange or skip some tests in the file or to tweak 'reset --hard' behavior without breaking unrelated tests). Noticed while testing a patch that fixes the reset --hard behavior described above. Signed-off-by: Jonathan Nieder jrnie...@gmail.com

[PATCH 02/19] wrapper.c: remove/unlink_or_warn: simplify, treat ENOENT as success

2014-09-10 Thread Jonathan Nieder
if the file did not exist. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- git-compat-util.h | 7 +-- wrapper.c | 14 ++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/git-compat-util.h b/git-compat

[PATCH 03/19] wrapper.c: add a new function unlink_or_msg

2014-09-10 Thread Jonathan Nieder
Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- git-compat-util.h | 9 + wrapper.c | 14 ++ 2 files changed, 23 insertions(+) diff --git a/git-compat-util.h b/git-compat-util.h index 611e77b..5ee140c 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -307,6

[PATCH 04/19] refs.c: add an err argument to delete_ref_loose

2014-09-10 Thread Jonathan Nieder
error string if the transaction failed due to delete_loose_ref. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/refs.c b/refs.c index 7235574..5609622 100644

[PATCH 07/19] refs.c: move the check for valid refname to lock_ref_sha1_basic

2014-09-10 Thread Jonathan Nieder
of badly named refs, at which time we will need to modify lock_ref_sha1_basic once more in order to allow locking these refs for certain use cases such as rename and delete. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 7 +-- 1

[PATCH 06/19] rename_ref: don't ask read_ref_full where the ref came from

2014-09-10 Thread Jonathan Nieder
-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 99a9b86..39571f5 100644 --- a/refs.c +++ b/refs.c @@ -2671,7 +2671,7 @@ int rename_ref(const char *oldrefname, const char *newrefname, const char *logms

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

2014-09-10 Thread Jonathan Nieder
transaction. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- branch.c | 4 ++-- builtin/commit.c | 4 ++-- builtin/receive-pack.c | 5 +++-- builtin/replace.c | 5 +++-- builtin/tag.c | 4 ++-- builtin

[PATCH 08/19] refs.c: call lock_ref_sha1_basic directly from commit

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Thu, 1 May 2014 10:43:39 -0700 Skip using the lock_any_ref_for_update wrapper and call lock_ref_sha1_basic directly from the commit function. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com

[PATCH 10/19] refs.c: ref_transaction_commit: distinguish name conflicts from other errors

2014-09-10 Thread Jonathan Nieder
...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 18 -- refs.h | 5 + 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/refs.c b/refs.c index b63ab2f..86c708a 100644 --- a/refs.c +++ b/refs.c @@ -3584,9 +3584,10 @@ int ref_transaction_commit(struct

[PATCH 09/19] refs.c: pass a skip list to name_conflict_fn

2014-09-10 Thread Jonathan Nieder
will be automatically resolved by the transaction when it deletes m. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 41 - 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/refs.c b/refs.c

[PATCH 11/19] fetch.c: change s_update_ref to use a ref transaction

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Mon, 28 Apr 2014 13:49:07 -0700 Change s_update_ref to use a ref transaction for the ref update. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/fetch.c | 34

[PATCH 12/19] refs.c: make write_ref_sha1 static

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Mon, 28 Apr 2014 15:36:58 -0700 No external users call write_ref_sha1 any more so lets declare it static. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 10 -- refs.h | 3

[PATCH 13/19] refs.c: change resolve_ref_unsafe reading argument to be a flags field

2014-09-10 Thread Jonathan Nieder
to make sure that we capture any instances where callers have not been updated/aware of the new api so that they can be audited. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- branch.c| 2 +- builtin/blame.c | 2

[PATCH 17/19] refs.c: do not permit err == NULL

2014-09-10 Thread Jonathan Nieder
of these behaviors are for historical reasons and others were accidents. Luckily no callers pass err == NULL any more. Simplify by consistently requiring the strbuf argument. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- refs.c | 46 +++--- 1 file

[PATCH 16/19] for-each-ref.c: improve message before aborting on broken ref

2014-09-10 Thread Jonathan Nieder
From: Ronnie Sahlberg sahlb...@google.com Date: Fri, 5 Sep 2014 14:35:17 -0700 Print a warning message for any badly named refs we find in the repo. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/for-each-ref.c | 6 ++ 1 file

[PATCH 15/19] refs.c: fix handling of badly named refs

2014-09-10 Thread Jonathan Nieder
refs and refuse to delete them unless REF_BADNAMEOK flag is passed. Signed-off-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/branch.c| 13 ++ builtin/update-ref.c| 3 ++- cache.h | 8

[PATCH 14/19] branch -d: avoid repeated symref resolution

2014-09-10 Thread Jonathan Nieder
(for example to print a message about it) with that flag set --- resolve_ref_unsafe will resolve one level of symrefs and stop there. Signed-off-by: Jonathan Nieder jrnie...@gmail.com --- builtin/branch.c | 3 ++- cache.h | 1 + refs.c| 10 ++ t/t1400

[PATCH 18/19] lockfile: remove unable_to_lock_error

2014-09-10 Thread Jonathan Nieder
The former caller uses unable_to_lock_message now. Signed-off-by: Jonathan Nieder jrnie...@gmail.com Reviewed-by: Ronnie Sahlberg sahlb...@google.com --- cache.h| 1 - lockfile.c | 10 -- 2 files changed, 11 deletions(-) diff --git a/cache.h b/cache.h index 03a6144..995729f 100644

<    1   2   3   4   5   6   7   8   9   10   >