Re: [PATCH v6 00/42] Use ref transactions for all ref updates

2014-05-05 Thread Michael Haggerty
into account in the future. Thanks, Michael [1] Of course, if a patch series has to grow to make the *existing* changes correct, then that's perfectly OK. -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.com/ -- To unsubscribe from this list: send the line unsubscribe git in the body

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

2014-05-05 Thread Michael Haggerty
, +const unsigned char *new_sha1, +const unsigned char *old_sha1, +int flags, int have_old); /* * Add a reference creation to transaction. new_sha1 is the value Michael -- Michael Haggerty mhag...@alum.mit.edu

Re: [PATCH 7/9] bundle.c: convert leaf functions to struct object_id

2014-05-06 Thread Michael Haggerty
- add_to_ref_list(sha1, buf.buf + 41, header-references); + add_to_ref_list(sha1, buf.buf + 41, header-references); I think that 41 here is GIT_OID_HEXSZ + 1. [...] Michael -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.com

Re: [PATCH 8/9] cache-tree: convert struct cache_tree to use object_id

2014-05-06 Thread Michael Haggerty
* rewriting code that works with it. [...] Michael -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.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

Re: [PATCH 8/9] cache-tree: convert struct cache_tree to use object_id

2014-05-06 Thread Michael Haggerty
(but not all!) of the literal constants that are derived from GIT_OID_RAWSZ and GIT_OID_HEXSZ. Michael -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.com/ -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org

Re: [PATCH 9/9] diff: convert struct combine_diff_path to object_id

2014-05-06 Thread Michael Haggerty
systematically looking for other literal constants that should be derived from GIT_OID_RAWSZ and GIT_OID_HEXSZ) and, aside from the problems that I already noted, they looked OK to me. Michael -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.com/ -- To unsubscribe from this list

Re: [PATCH] add a reflog_exists and delete_reflog abstraction

2014-05-06 Thread Michael Haggerty
at the command line by the time we implement pluggable reference backends. Michael -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.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

Re: [PATCH] refs.c: add new functions reflog_exists and delete_reflog

2014-05-06 Thread Michael Haggerty
*); + /* iterate over reflog entries */ typedef int each_reflog_ent_fn(unsigned char *osha1, unsigned char *nsha1, const char *, unsigned long, int, const char *, void *); int for_each_reflog_ent(const char *refname, each_reflog_ent_fn fn, void *cb_data); Thanks! Michael -- Michael Haggerty

Re: [PATCH 0/3] Use ref transactions for fetch

2014-05-06 Thread Michael Haggerty
On 05/06/2014 08:40 PM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: It would be pretty annoying to spend a lot of time fetching a big pack, only to have the fetch fail because one reference out of many couldn't be updated. This would force the user to download

Re: [PATCH v2 0/2] add a reflog_exists and delete_reflog abstraction

2014-05-07 Thread Michael Haggerty
deletions(-) +1 Looks good to me. Thanks! Michael -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.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

Re: [PATCH v1 23/25] contrib: remove 'hooks/multimail'

2014-05-09 Thread Michael Haggerty
On 05/09/2014 02:58 AM, Felipe Contreras wrote: No tests. No chance of ever graduating. Already out-of-tree. Cc: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Felipe Contreras felipe.contre...@gmail.com Thank you for your input. git-multimail is maintained outside of the Git

Re: [PATCH v1 23/25] contrib: remove 'hooks/multimail'

2014-05-09 Thread Michael Haggerty
On 05/09/2014 05:04 PM, David Kastrup wrote: Michael Haggerty mhag...@alum.mit.edu writes: On 05/09/2014 02:58 AM, Felipe Contreras wrote: No tests. No chance of ever graduating. Already out-of-tree. Cc: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Felipe Contreras felipe.contre

Re: Should git-remote-hg/bzr be part of the core?

2014-05-12 Thread Michael Haggerty
heart I truly wish you the best in your future endeavors. Michael [1] http://article.gmane.org/gmane.comp.version-control.git/227750 -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.com/ -- To unsubscribe from this list: send the line unsubscribe git in the body of a message

Re: Should git-remote-hg/bzr be part of the core?

2014-05-12 Thread Michael Haggerty
On 05/12/2014 12:37 PM, Felipe Contreras wrote: Michael Haggerty wrote: On 05/12/2014 01:34 AM, Felipe Contreras wrote: Recently Junio said he was willing to hear the opinion of other people regarding the move from contrib to the core[1]. This move is already under way, but suddenly Junio

Re: Should git-remote-hg/bzr be part of the core?

2014-05-12 Thread Michael Haggerty
On 05/12/2014 02:29 PM, Felipe Contreras wrote: Michael Haggerty wrote: [...] 2. Moving git-remote-hg into the core would require you to continue your presence on the Git mailing list. That is another red herring. Moving them back to the contrib/ area which is what Junio proposed would

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

2014-05-17 Thread Michael Haggerty
it would be a net win in terms of boilerplate? if (force !is_null_sha1(prev) hashcmp(prev, object)) printf(_(Updated tag '%s' (was %s)\n), tag, find_unique_abbrev(prev, DEFAULT_ABBREV)); -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.com

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

2014-05-17 Thread Michael Haggerty
); -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.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 v10 24/44] fetch.c: use a single ref transaction for all ref updates

2014-05-17 Thread Michael Haggerty
) error(_(some local refs could not be updated; try running\n -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.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

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

2014-05-17 Thread Michael Haggerty
On 05/17/2014 05:05 PM, Michael Haggerty wrote: On 05/16/2014 07:37 PM, Ronnie Sahlberg wrote: [...] disk and thus we would not return STORE_REF_ERROR_DF_CONFLICT for this case. I think this new behaviour is more correct, since if there was a problem we would not even try to commit

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

2014-05-17 Thread Michael Haggerty
going to have to stop here. FWIW patches 01-23 looked OK aside from the comments that I have made. Michael -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.com/ -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord

Re: [RFC/PATCH] replace: add --graft option

2014-05-19 Thread Michael Haggerty
layer of abstraction based on the commit object produced by the existing commit parser? E.g., edit the object it produces, and write the result? Or create a new commit object out of the parsed commit object and write that? It's great that you're working on this! Michael -- Michael Haggerty mhag

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

2014-05-20 Thread Michael Haggerty
GIF here [1] :-) Michael [1] https://github.com/blog/1691-michael-haggerty-is-a-githubber -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.com/ -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More

Re: Pluggable backends for refs,wip

2014-08-07 Thread Michael Haggerty
and reflogs are stored by the filesystem backend and just grabs at the files rather than accessing the references using git commands. It will take some work to clean this up. [2] http://thread.gmane.org/gmane.comp.version-control.git/243726 -- Michael Haggerty mhag...@alum.mit.edu

Re: [PATCH v2 23/23] rebase -i: enable options --signoff, --reset-author for pick, reword

2014-08-13 Thread Michael Haggerty
the picked commit which alters that information. squash and fixup still do not accept user options as the interplay of `--reset-author` and the author script are yet to be determined. [...] Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the line

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

2014-08-20 Thread Michael Haggerty
On 07/15/2014 10:58 PM, Ronnie Sahlberg wrote: On Tue, Jul 15, 2014 at 12:34 PM, Ronnie Sahlberg sahlb...@google.com wrote: On Tue, Jul 15, 2014 at 11:04 AM, Jonathan Nieder jrnie...@gmail.com wrote: Michael Haggerty wrote: So...I like the idea of enforcing refname checks at the lowest level

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

2014-08-20 Thread Michael Haggerty
On 08/20/2014 06:28 PM, 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

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

2014-08-20 Thread Michael Haggerty
On 08/20/2014 09:45 PM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: I think we can get away with not including broken refnames when iterating. After all, the main goal of tolerating them is to let them be deleted, right? Or read from a ref whose name has

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

2014-08-22 Thread Michael Haggerty
an alternative would be to do some minimal checks in any case, but make it possible to turn off the stricter checks (those that mostly exist to make reference expression parsing possible) when necessary. Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the line

Re: [PATCH 0/5] fix pack-refs pruning of refs/foo

2014-08-23 Thread Michael Haggerty
the chance to rename the local variable ref_name to refname to be consistent with most of our code, but this is by no means required. Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More

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

2014-08-27 Thread Michael Haggerty
to be transient). [...] I like the idea. I would use this setting on all my repos (information packrat that I am). Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More

Using Gerrit to review Git patches (was: Re: Transaction patch series overview)

2014-08-27 Thread Michael Haggerty
to mailing list was a bit awkward. So, overall I found it pleasant and efficient to review patches in Gerrit. I would welcome more such experiments. It would have been even better if Gerrit would generate more useful notification emails. Michael -- Michael Haggerty mhag...@alum.mit.edu

[PATCH v4 28/32] Change lock_file::filename into a strbuf

2014-09-06 Thread Michael Haggerty
() but then store a pointer to the naked string in struct lock_file. But lock_file objects are often reused. By reusing the same strbuf, we can avoid having to reallocate the string most times when a lock_file object is reused. Helped-by: Torsten Bögershausen tbo...@web.de Signed-off-by: Michael Haggerty mhag

[PATCH v4 13/32] write_packed_entry_fn(): convert cb_data into a (const int *)

2014-09-06 Thread Michael Haggerty
This makes it obvious that we have no plans to change the integer pointed to, which is actually the fd field from a struct lock_file. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/refs.c b/refs.c index 8a63073

[PATCH v4 26/32] try_merge_strategy(): use a statically-allocated lock_file object

2014-09-06 Thread Michael Haggerty
Even the one lockfile object needn't be allocated each time the function is called. Instead, define one statically-allocated lock_file object and reuse it for every call. Suggested-by: Jeff King p...@peff.net Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/merge.c | 14

[PATCH v4 12/32] prepare_index(): declare return value to be (const char *)

2014-09-06 Thread Michael Haggerty
with.) Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/commit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c index a3eaf4b..046be7e 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -315,8 +315,8 @@ static void

[PATCH v4 24/32] struct lock_file: declare some fields volatile

2014-09-06 Thread Michael Haggerty
without volatile in the filename case. Suggested-by: Johannes Sixt j...@kdbg.org Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- cache.h| 6 +++--- lockfile.c | 2 +- refs.c | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cache.h b/cache.h index e739482

[PATCH v4 01/32] unable_to_lock_die(): rename function from unable_to_lock_index_die()

2014-09-06 Thread Michael Haggerty
This function is used for other things besides the index, so rename it accordingly. Suggested-by: Jeff King p...@peff.net Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/update-index.c | 2 +- cache.h| 2 +- lockfile.c | 6 +++--- refs.c

[PATCH v4 17/32] commit_lock_file(): die() if called for unlocked lockfile object

2014-09-06 Thread Michael Haggerty
that the lock_file object really is locked. Helped-by: Johannes Sixt j...@kdbg.org Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- Documentation/technical/api-lockfile.txt | 4 +++- lockfile.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git

[PATCH v4 07/32] hold_lock_file_for_append(): release lock on errors

2014-09-06 Thread Michael Haggerty
If there is an error copying the old contents to the lockfile, roll back the lockfile before exiting so that the lockfile is not held until process cleanup. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v4 05/32] rollback_lock_file(): set fd to -1

2014-09-06 Thread Michael Haggerty
When rolling back the lockfile, call close_lock_file() so that the lock_file's fd field gets set back to -1. This keeps the lock_file object in a valid state, which is important because these objects are allowed to be reused. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c

[PATCH v4 08/32] lock_file(): always add lock_file object to lock_file_list

2014-09-06 Thread Michael Haggerty
-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 25 - 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/lockfile.c b/lockfile.c index 983c3ec..00c972c 100644 --- a/lockfile.c +++ b/lockfile.c @@ -129,6 +129,22 @@ static int lock_file(struct lock_file *lk

[PATCH v4 30/32] resolve_symlink(): take a strbuf parameter

2014-09-06 Thread Michael Haggerty
Change resolve_symlink() to take a strbuf rather than a string as parameter. This simplifies the code and removes an arbitrary pathname length restriction. It also means that lock_file's filename field no longer needs to be initialized to a large size. Signed-off-by: Michael Haggerty mhag

[PATCH v4 31/32] trim_last_path_elm(): replace last_path_elm()

2014-09-06 Thread Michael Haggerty
. Rename the function accordingly. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 38 -- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/lockfile.c b/lockfile.c index d78b6bf..4c6e720 100644 --- a/lockfile.c +++ b/lockfile.c

[PATCH v4 32/32] Extract a function commit_lock_file_to()

2014-09-06 Thread Michael Haggerty
functions, and call it from both commit_lock_file() and commit_locked_index(). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- Documentation/technical/api-lockfile.txt | 14 ++ cache.h | 1 + lockfile.c | 30

[PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-06 Thread Michael Haggerty
series. [1] http://thread.gmane.org/gmane.comp.version-control.git/245609 [2] http://thread.gmane.org/gmane.comp.version-control.git/245801 [3] http://thread.gmane.org/gmane.comp.version-control.git/246222 Michael Haggerty (32): unable_to_lock_die(): rename function from unable_to_lock_index_die

[PATCH v4 02/32] api-lockfile: expand the documentation

2014-09-06 Thread Michael Haggerty
Document a couple more functions and the flags argument as used by hold_lock_file_for_update() and hold_lock_file_for_append(). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- Documentation/technical/api-lockfile.txt | 36 +--- 1 file changed, 33 insertions

[PATCH v4 03/32] rollback_lock_file(): do not clear filename redundantly

2014-09-06 Thread Michael Haggerty
It is only necessary to clear the lock_file's filename field if it was not already clear. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lockfile.c b/lockfile.c index f1ce154..a548e08 100644 --- a/lockfile.c

[PATCH v4 06/32] lockfile: unlock file if lockfile permissions cannot be adjusted

2014-09-06 Thread Michael Haggerty
, unlocked). Previously, the lockfile was retained until process cleanup in this situation. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lockfile.c b/lockfile.c index b1c4ba0..d4f165d 100644 --- a/lockfile.c +++ b

[PATCH v4 11/32] delete_ref_loose(): don't muck around in the lock_file's filename

2014-09-06 Thread Michael Haggerty
It's bad manners. Especially since, if unlink_or_warn() failed, the memory wasn't restored to its original contents. So make our own copy to work with. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- refs.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff

[PATCH v4 09/32] lockfile.c: document the various states of lock_file objects

2014-09-06 Thread Michael Haggerty
Document the valid states of lock_file objects, how they get into each state, and how the state is encoded in the object's fields. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 52 1 file changed, 52 insertions(+) diff

[PATCH v4 14/32] lock_file(): exit early if lockfile cannot be opened

2014-09-06 Thread Michael Haggerty
This is a bit easier to read than the old version, which nested part of the non-error code in an if block. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/lockfile.c b/lockfile.c

[PATCH v4 04/32] rollback_lock_file(): exit early if lock is not active

2014-09-06 Thread Michael Haggerty
Eliminate a layer of nesting. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lockfile.c b/lockfile.c index a548e08..49179d8 100644 --- a/lockfile.c +++ b/lockfile.c @@ -272,10 +272,11 @@ int

[PATCH v4 10/32] cache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN

2014-09-06 Thread Michael Haggerty
There are a few places that use these values, so define constants for them. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- cache.h| 4 lockfile.c | 11 ++- refs.c | 7 --- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/cache.h b/cache.h index

[PATCH v4 19/32] commit_lock_file(): rollback lock file on failure to rename

2014-09-06 Thread Michael Haggerty
If rename() fails, call rollback_lock_file() to delete the lock file (in case it is still present) and reset the filename field to the empty string so that the lockfile object is left in a valid state. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 18 +++--- 1

[PATCH v4 21/32] dump_marks(): remove a redundant call to rollback_lock_file()

2014-09-06 Thread Michael Haggerty
When commit_lock_file() fails, it now always calls rollback_lock_file() internally, so there is no need to call that function here. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- fast-import.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fast-import.c b/fast

[PATCH v4 27/32] commit_lock_file(): use a strbuf to manage temporary space

2014-09-06 Thread Michael Haggerty
Avoid relying on the filename length restrictions that are currently checked by lock_file(). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lockfile.c b/lockfile.c index f51f73f..f6b3866 100644

[PATCH v4 18/32] commit_lock_file(): if close fails, roll back

2014-09-06 Thread Michael Haggerty
If closing an open lockfile fails, then we cannot be sure of the contents of the lockfile, so there is nothing sensible to do but delete it. This change also leaves the lock_file object in a defined state in this error path (namely, unlocked). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu

[PATCH v4 20/32] api-lockfile: document edge cases

2014-09-06 Thread Michael Haggerty
that it is a NOOP. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- Documentation/technical/api-lockfile.txt | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Documentation/technical/api-lockfile.txt b/Documentation/technical/api-lockfile.txt index 9a94ead..2514559

[PATCH v4 15/32] remove_lock_file(): call rollback_lock_file()

2014-09-06 Thread Michael Haggerty
It does just what we need. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lockfile.c b/lockfile.c index 71786c9..dacfc28 100644 --- a/lockfile.c +++ b/lockfile.c @@ -63,12 +63,8 @@ static void

[PATCH v4 16/32] commit_lock_file(): inline temporary variable

2014-09-06 Thread Michael Haggerty
Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lockfile.c b/lockfile.c index dacfc28..d64cf6b 100644 --- a/lockfile.c +++ b/lockfile.c @@ -306,12 +306,14 @@ int reopen_lock_file(struct lock_file *lk

[PATCH v4 22/32] git_config_set_multivar_in_file(): avoid call to rollback_lock_file()

2014-09-06 Thread Michael Haggerty
After commit_lock_file() is called, then the lock_file object is necessarily either committed or rolled back. So there is no need to call rollback_lock_file() again in either of these cases. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- config.c | 14 +++--- 1 file changed, 7

[PATCH v4 25/32] try_merge_strategy(): remove redundant lock_file allocation

2014-09-06 Thread Michael Haggerty
the inner definition. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/merge.c | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin/merge.c b/builtin/merge.c index ce82eb2..0f5c185 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -669,7 +669,6 @@ static int

[PATCH v4 23/32] lockfile: avoid transitory invalid states

2014-09-06 Thread Michael Haggerty
for this purpose. Be careful to set this field only when filename really contains the name of a file that should be deleted on cleanup. Helped-by: Johannes Sixt j...@kdbg.org Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- cache.h | 1 + lockfile.c | 45

[PATCH v4 29/32] resolve_symlink(): use a strbuf for internal scratch space

2014-09-06 Thread Michael Haggerty
Aside from shortening and simplifying the code, this removes another place where the path name length is arbitrarily limited. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 33 - 1 file changed, 12 insertions(+), 21 deletions(-) diff --git

[PATCH v4 0/1] Use absolute paths of lockfiles

2014-09-06 Thread Michael Haggerty
This patch applies on top of the patch series that I just sent [1]: Lockfile correctness and refactoring, v4 It has the same effect as Duy's [2] Keep .lock file paths absolute, v3 except that my patch series obviates the need for his patches 1/3 and 2/3. So only one patch remains, the

[PATCH v4 1/1] lockfile.c: store absolute path

2014-09-06 Thread Michael Haggerty
...@gmail.com Helped-by: Ramsay Jones ram...@ramsay1.demon.co.uk Helped-by: Johannes Sixt j...@kdbg.org Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com Adapted-by: Michael Haggerty mhag...@alum.mit.edu Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c| 14

Re: [PATCH] refs: write packed_refs file using stdio

2014-09-10 Thread Michael Haggerty
) { if (fsync(fd) 0) { Reviewed-by: Michael Haggerty mhag...@alum.mit.edu Michael -- Michael Haggerty mhag...@alum.mit.edu -- 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

Re: [PATCH v4 06/32] lockfile: unlock file if lockfile permissions cannot be adjusted

2014-09-12 Thread Michael Haggerty
On 09/10/2014 12:39 AM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: If the call to adjust_shared_perm() fails, lock_file returns -1, which to the caller looks like any other failure to lock the file. So in this case, roll back the lockfile before returning so

Re: [PATCH v4 07/32] hold_lock_file_for_append(): release lock on errors

2014-09-12 Thread Michael Haggerty
On 09/10/2014 12:41 AM, Junio C Hamano wrote: Michael Haggerty mhag...@alum.mit.edu writes: If there is an error copying the old contents to the lockfile, roll back the lockfile before exiting so that the lockfile is not held until process cleanup. Same comment as 06/32 applies here

Re: [PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-12 Thread Michael Haggerty
in this message. This is an interesting idea. I wouldn't trust git to handle efficiently commits with thousands of parents, but it would be easy to knit a huge number of tips together using multiple layers of, say, 16-parent octopus merges. Michael -- Michael Haggerty mhag...@alum.mit.edu

Re: [PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-12 Thread Michael Haggerty
for various reasons (e.g., who is referencing this object?). [...] Michael -- Michael Haggerty mhag...@alum.mit.edu -- 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

Re: [PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-12 Thread Michael Haggerty
On 09/07/2014 04:21 PM, Torsten Bögershausen wrote: On 2014-09-06 09.50, Michael Haggerty wrote: Sorry for the long delay since v3. This version mostly cleans up a couple more places where the lockfile object was left in an ill-defined state. No problem with the delay. The most important

Re: [PATCH v4 00/32] Lockfile correctness and refactoring

2014-09-12 Thread Michael Haggerty
-transaction code is, I think, moving in the direction of updating all references in a single transaction. This means that we would need to hold locks for all of the references at once anyway. So it might be all for naught. Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from

Re: [PATCH v4 10/32] cache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN

2014-09-12 Thread Michael Haggerty
On 09/12/2014 12:15 AM, Ronnie Sahlberg wrote: On Sat, Sep 6, 2014 at 12:50 AM, Michael Haggerty mhag...@alum.mit.edu wrote: There are a few places that use these values, so define constants for them. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- cache.h| 4

Re: [PATCH v4 10/32] cache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN

2014-09-12 Thread Michael Haggerty
wouldn't be deterred for long by not seeing a symbolic constant for the suffix length. So if it's OK with you I'll leave the constant. Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord

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

2014-09-12 Thread Michael Haggerty
for me. I really hope to get through the third series by the end of next week. so I'll send a reroll of the series as-is in an hour or so. Jonathan: Is a current version of this patch series set up for review in Gerrit? Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from

Re: [PATCH v4 11/32] delete_ref_loose(): don't muck around in the lock_file's filename

2014-09-14 Thread Michael Haggerty
On 09/13/2014 09:41 AM, Johannes Sixt wrote: Am 06.09.2014 um 09:50 schrieb Michael Haggerty: It's bad manners. Especially since, if unlink_or_warn() failed, the memory wasn't restored to its original contents. I do not see how the old code did not restore the file name. Except

Re: [PATCH v4 11/32] delete_ref_loose(): don't muck around in the lock_file's filename

2014-09-14 Thread Michael Haggerty
On 09/14/2014 08:27 AM, Michael Haggerty wrote: On 09/13/2014 09:41 AM, Johannes Sixt wrote: Am 06.09.2014 um 09:50 schrieb Michael Haggerty: It's bad manners. Especially since, if unlink_or_warn() failed, the memory wasn't restored to its original contents. I do not see how the old code

Re: [PATCH] fsck: return non-zero status on missing ref tips

2014-09-15 Thread Michael Haggerty
to get rid of the broken reference once it is discovered (short of opening packed-refs in an editor). Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the line unsubscribe git in the body of a message to majord...@vger.kernel.org More majordomo info

Re: [PATCH] fsck: return non-zero status on missing ref tips

2014-09-15 Thread Michael Haggerty
would pass up an opportunity to delete unneeded cruft from the packed-refs file. But I can't think of a rational reason to disagree with you, so as far as I'm concerned your suggestion seems OK. Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the line

[PATCH v5 07/35] hold_lock_file_for_append(): release lock on errors

2014-09-16 Thread Michael Haggerty
If there is an error copying the old contents to the lockfile, roll back the lockfile before exiting so that the lockfile is not held until process cleanup. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v5 22/35] git_config_set_multivar_in_file(): avoid call to rollback_lock_file()

2014-09-16 Thread Michael Haggerty
After commit_lock_file() is called, then the lock_file object is necessarily either committed or rolled back. So there is no need to call rollback_lock_file() again in either of these cases. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- config.c | 14 +++--- 1 file changed, 7

[PATCH v5 10/35] cache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN

2014-09-16 Thread Michael Haggerty
There are a few places that use these values, so define constants for them. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- cache.h| 4 lockfile.c | 11 ++- refs.c | 7 --- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/cache.h b/cache.h index

[PATCH v5 31/35] trim_last_path_component(): replace last_path_elm()

2014-09-16 Thread Michael Haggerty
. Rename the function accordingly and a bit less tersely. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 38 -- 1 file changed, 16 insertions(+), 22 deletions(-) diff --git a/lockfile.c b/lockfile.c index e689a84..3d5ab4f 100644

[PATCH v5 12/35] prepare_index(): declare return value to be (const char *)

2014-09-16 Thread Michael Haggerty
with.) Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/commit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c index 41f481b..d4228c9 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -315,8 +315,8 @@ static void

[PATCH v5 18/35] commit_lock_file(): if close fails, roll back

2014-09-16 Thread Michael Haggerty
If closing an open lockfile fails, then we cannot be sure of the contents of the lockfile, so there is nothing sensible to do but delete it. This change also leaves the lock_file object in a defined state in this error path (namely, unlocked). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu

[PATCH v5 21/35] dump_marks(): remove a redundant call to rollback_lock_file()

2014-09-16 Thread Michael Haggerty
When commit_lock_file() fails, it now always calls rollback_lock_file() internally, so there is no need to call that function here. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- fast-import.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fast-import.c b/fast

[PATCH v5 17/35] commit_lock_file(): die() if called for unlocked lockfile object

2014-09-16 Thread Michael Haggerty
that the lock_file object really is locked. Helped-by: Johannes Sixt j...@kdbg.org Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- Documentation/technical/api-lockfile.txt | 4 +++- lockfile.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git

[PATCH v5 33/35] Rename LOCK_NODEREF to LOCK_NO_DEREF

2014-09-16 Thread Michael Haggerty
This makes it harder to misread the name as LOCK_NODE_REF. Suggested-by: Torsten Bögershausen tbo...@web.de Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- Documentation/technical/api-lockfile.txt | 4 ++-- cache.h | 2 +- lockfile.c

[PATCH v5 25/35] try_merge_strategy(): remove redundant lock_file allocation

2014-09-16 Thread Michael Haggerty
the inner definition. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- builtin/merge.c | 1 - 1 file changed, 1 deletion(-) diff --git a/builtin/merge.c b/builtin/merge.c index 9da9e30..6b430f0 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -668,7 +668,6 @@ static int

[PATCH v5 23/35] lockfile: avoid transitory invalid states

2014-09-16 Thread Michael Haggerty
for this purpose. Be careful to set this field only when filename really contains the name of a file that should be deleted on cleanup. Helped-by: Johannes Sixt j...@kdbg.org Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- cache.h | 1 + lockfile.c | 47

[PATCH v5 35/35] get_locked_file_path(): new function

2014-09-16 Thread Michael Haggerty
Add a function to return the path of the file that is locked by a lock_file object. This reduces the knowledge that callers have to have about the lock_file layout. Suggested-by: Ronnie Sahlberg sahlb...@google.com Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- Documentation/technical

[PATCH v5 01/35] unable_to_lock_die(): rename function from unable_to_lock_index_die()

2014-09-16 Thread Michael Haggerty
This function is used for other things besides the index, so rename it accordingly. Suggested-by: Jeff King p...@peff.net Signed-off-by: Michael Haggerty mhag...@alum.mit.edu Reviewed-by: Ronnie Sahlberg sahlb...@google.com --- builtin/update-index.c | 2 +- cache.h| 2

[PATCH v5 00/35] Lockfile correctness and refactoring

2014-09-16 Thread Michael Haggerty
] http://thread.gmane.org/gmane.comp.version-control.git/256564 Michael Haggerty (35): unable_to_lock_die(): rename function from unable_to_lock_index_die() api-lockfile: expand the documentation rollback_lock_file(): do not clear filename redundantly rollback_lock_file(): exit early if lock

[PATCH v5 02/35] api-lockfile: expand the documentation

2014-09-16 Thread Michael Haggerty
Document a couple more functions and the flags argument as used by hold_lock_file_for_update() and hold_lock_file_for_append(). Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- Documentation/technical/api-lockfile.txt | 36 +--- 1 file changed, 33 insertions

[PATCH v5 13/35] write_packed_entry_fn(): convert cb_data into a (const int *)

2014-09-16 Thread Michael Haggerty
This makes it obvious that we have no plans to change the integer pointed to, which is actually the fd field from a struct lock_file. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu Reviewed-by: Ronnie Sahlberg sahlb...@google.com --- refs.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v5 04/35] rollback_lock_file(): exit early if lock is not active

2014-09-16 Thread Michael Haggerty
Eliminate a layer of nesting. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu Reviewed-by: Ronnie Sahlberg sahlb...@google.com --- lockfile.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lockfile.c b/lockfile.c index a548e08..49179d8 100644

[PATCH v5 14/35] lock_file(): exit early if lockfile cannot be opened

2014-09-16 Thread Michael Haggerty
This is a bit easier to read than the old version, which nested part of the non-error code in an if block. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu Reviewed-by: Ronnie Sahlberg sahlb...@google.com --- lockfile.c | 23 +++ 1 file changed, 11 insertions(+), 12

[PATCH v5 03/35] rollback_lock_file(): do not clear filename redundantly

2014-09-16 Thread Michael Haggerty
It is only necessary to clear the lock_file's filename field if it was not already clear. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu Reviewed-by: Ronnie Sahlberg sahlb...@google.com --- lockfile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lockfile.c b

[PATCH v5 19/35] commit_lock_file(): rollback lock file on failure to rename

2014-09-16 Thread Michael Haggerty
If rename() fails, call rollback_lock_file() to delete the lock file (in case it is still present) and reset the filename field to the empty string so that the lockfile object is left in a valid state. Signed-off-by: Michael Haggerty mhag...@alum.mit.edu --- lockfile.c | 18 +++--- 1

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