[PATCH 1/4] get_remote_group(): handle remotes with single-character names

2015-07-28 Thread Michael Haggerty
The code for splitting a whitespace-separated list of values in "remotes." had an off-by-one error that caused it to skip over remotes whose names consist of a single character. Also remove unnecessary braces. Signed-off-by: Michael Haggerty --- builtin/fetch.c | 3 +-- 1 file

[PATCH 2/4] get_remote_group(): rename local variable "space" to "wordlen"

2015-07-28 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- builtin/fetch.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index 98f9048..d0d267b 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -978,13 +978,13 @@ static int get_remote_group(const

[PATCH 3/4] get_remote_group(): eliminate superfluous call to strcspn()

2015-07-28 Thread Michael Haggerty
There is no need to call it if value is the empty string. This also eliminates code duplication. Signed-off-by: Michael Haggerty --- builtin/fetch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index d0d267b..bd945d0 100644 --- a

[PATCH 0/4] Fix handling of remotes with single-character names

2015-07-28 Thread Michael Haggerty
, but it also rebases cleanly to master. It might make sense to apply only the first patch to maint and the others only to master. These patches are also available from my GitHub repository [1] as branch "single-character-remotes". Michael [1] https://github.com/mhagger/git Michael H

[PATCH 4/4] get_remote_group(): use skip_prefix()

2015-07-28 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- builtin/fetch.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/builtin/fetch.c b/builtin/fetch.c index bd945d0..76ca100 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -975,8 +975,7 @@ static int get_remote_group(const char *key

Re: [PATCH v3 2/6] notes: replace pseudorefs with real refs

2015-07-28 Thread Michael Haggerty
e same time. It's just a thought; I have no idea whether it is practical... 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

Re: [PATCH 0/4] Fix handling of remotes with single-character names

2015-07-31 Thread Michael Haggerty
release cycle if at all possible. 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-info.html

Re: [PATCH/RFC 0/2] bisect per-worktree

2015-07-31 Thread Michael Haggerty
want to be worktree-specific (for example, that in a linked worktree, "refs/bisect/*" should be silently redirected to "refs/worktree//bisect/*")? It's all a bit frightening, frankly. Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this

Re: [PATCH/RFC 0/2] bisect per-worktree

2015-07-31 Thread Michael Haggerty
On 08/01/2015 07:12 AM, Junio C Hamano wrote: > On Fri, Jul 31, 2015 at 8:59 PM, Michael Haggerty > wrote: >> >> It seems to me that adding a new top-level "worktree-refs" directory is >> pretty traumatic. Lots of people and tools will have made the assumpti

Re: [PATCH/RFC 0/9] Pseudorefs

2015-08-02 Thread Michael Haggerty
[1] http://git-scm.com/docs/git-fast-import#_use_tag_fixup_branches [2] https://github.com/mhagger/cvs2svn/blob/master/cvs2svn_lib/git_output_option.py#L502-L509 -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the line "unsubscribe git" in

Re: [PATCH v2 00/10] object_id part 2

2015-08-02 Thread Michael Haggerty
ght help reviewers decide how much diligence is needed when reviewing these patches and what kind of changes to inspect extra carefully. Because doing a thorough review of all of the patches would be quite a bit of work. Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from t

Re: [PATCH 06/14] tempfile: add several functions for creating temporary files

2015-08-09 Thread Michael Haggerty
On 06/10/2015 07:48 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> Add several functions for creating temporary files with >> automatically-generated names, analogous to mkstemps(), but also >> arranging for the files to be deleted on program exit. >&

Re: [PATCH 07/14] register_tempfile(): new function to handle an existing temporary file

2015-08-09 Thread Michael Haggerty
On 06/10/2015 07:55 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> Allow an existing file to be registered with the tempfile-handling >> infrastructure; in particular, arrange for it to be deleted on program >> exit. >> >> Signed-off-by: Michael Hag

[PATCH v2 00/16] Introduce a tempfile module

2015-08-10 Thread Michael Haggerty
/gmane.comp.version-control.git/270998 [2] https://github.com/mhagger/git Michael Haggerty (16): Move lockfile documentation to lockfile.h and lockfile.c create_bundle(): duplicate file descriptor to avoid closing it twice lockfile: add accessors get_lock_file_fd() and get_lock_file_

[PATCH v2 02/16] create_bundle(): duplicate file descriptor to avoid closing it twice

2015-08-10 Thread Michael Haggerty
_data(). Then that function can close its copy without closing the copy held in the lock_file object. Signed-off-by: Michael Haggerty --- This is new since v1. I like that it is better decoupled than the old code, but let me know if you think otherwise. Actually, it seems to me that start_comman

[PATCH v2 15/16] credential-cache--daemon: delete socket from main()

2015-08-10 Thread Michael Haggerty
main() is responsible for cleaning up the socket in the case of errors, so it is reasonable to also make it responsible for cleaning it up when there are no errors. This change also makes the next step easier. Signed-off-by: Michael Haggerty --- credential-cache--daemon.c | 3 ++- 1 file

[PATCH v2 06/16] tempfile: a new module for handling temporary files

2015-08-10 Thread Michael Haggerty
mplement lockfile on top of tempfile. Subsequent commits will add more users of the new module. Signed-off-by: Michael Haggerty --- Makefile | 1 + lockfile.c | 261 - lockfile.h | 73 +++

[PATCH v2 12/16] diff: use tempfile module

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- diff.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/diff.c b/diff.c index 7500c55..dc95247 100644 --- a/diff.c +++ b/diff.c @@ -2,6 +2,7 @@ * Copyright (C) 2005 Junio C Hamano */ #include "ca

[PATCH v2 16/16] credential-cache--daemon: use tempfile module

2015-08-10 Thread Michael Haggerty
Use the tempfile module to ensure that the socket file gets deleted on program exit. Signed-off-by: Michael Haggerty --- credential-cache--daemon.c | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/credential-cache--daemon.c b/credential-cache

[PATCH v2 10/16] write_shared_index(): use tempfile module

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- read-cache.c | 38 ++ 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/read-cache.c b/read-cache.c index 96cb9a3..89be226 100644 --- a/read-cache.c +++ b/read-cache.c @@ -5,6 +5,7 @@ */ #define

[PATCH v2 09/16] register_tempfile(): new function to handle an existing temporary file

2015-08-10 Thread Michael Haggerty
created via the lockfile API * If it is not a regular file (e.g., a socket) Signed-off-by: Michael Haggerty --- tempfile.c | 8 tempfile.h | 8 2 files changed, 16 insertions(+) diff --git a/tempfile.c b/tempfile.c index 0b5d8ce..0af7ebf 100644 --- a/tempfile.c +++ b/tempfile.c

[PATCH v2 07/16] prepare_tempfile_object(): new function, extracted from create_tempfile()

2015-08-10 Thread Michael Haggerty
This makes the next step easier. The old code used to use "path" to set the initial length of tempfile->filename. This was not helpful because path was usually relative whereas the value stored to filename will be absolute. So just initialize the length to 0. Signed-off-by: Mic

[PATCH v2 03/16] lockfile: add accessors get_lock_file_fd() and get_lock_file_fp()

2015-08-10 Thread Michael Haggerty
We are about to move those members, so change client code to read them through accessor functions. Signed-off-by: Michael Haggerty --- credential-store.c | 2 +- lockfile.c | 14 ++ lockfile.h | 3 +++ read-cache.c | 2 +- refs.c | 12

[PATCH v2 13/16] lock_repo_for_gc(): compute the path to "gc.pid" only once

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- builtin/gc.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index 36fe333..c41354b 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -199,6 +199,7 @@ static const char *lock_repo_for_gc(int force, pid_t

[PATCH v2 04/16] lockfile: add accessor get_lock_file_path()

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- builtin/commit.c | 15 --- config.c | 14 +++--- lockfile.c | 7 +++ lockfile.h | 6 ++ refs.c | 6 +++--- shallow.c| 6 +++--- 6 files changed, 34 insertions(+), 20 deletions(-) diff --git

[PATCH v2 11/16] setup_temporary_shallow(): use tempfile module

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- shallow.c | 35 +++ 1 file changed, 7 insertions(+), 28 deletions(-) diff --git a/shallow.c b/shallow.c index 7973e74..2ba29a5 100644 --- a/shallow.c +++ b/shallow.c @@ -1,4 +1,5 @@ #include "cache.h" +#include &

[PATCH v2 14/16] gc: use tempfile module to handle gc.pid file

2015-08-10 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- builtin/gc.c | 25 + 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index c41354b..bfe589f 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -11,6 +11,7 @@ */ #include "builtin.h"

[PATCH v2 05/16] commit_lock_file(): use get_locked_file_path()

2015-08-10 Thread Michael Haggerty
First beef up the sanity checking in get_locked_file_path() to match that in commit_lock_file(). Then rewrite commit_lock_file() to use get_locked_file_path() for its pathname computation. Signed-off-by: Michael Haggerty --- lockfile.c | 28 1 file changed, 12

[PATCH v2 08/16] tempfile: add several functions for creating temporary files

2015-08-10 Thread Michael Haggerty
the code where temporary files are created and cleaned up ad-hoc. Signed-off-by: Michael Haggerty --- tempfile.c | 53 ++ tempfile.h | 96 ++ 2 files changed, 149 insertions(+) diff --git a/tempfile.c b

[PATCH v2 01/16] Move lockfile documentation to lockfile.h and lockfile.c

2015-08-10 Thread Michael Haggerty
Rearrange/rewrite it somewhat to fit its new environment. Signed-off-by: Michael Haggerty --- Documentation/technical/api-lockfile.txt | 220 --- lockfile.c | 53 ++ lockfile.h | 290

Re: [PATCH 11/17] refs.c: simplify strbufs in reflog setup and writing

2015-08-10 Thread Michael Haggerty
const unsigned char *new_sha1, const char *msg, > -struct strbuf *sb_log_file, int flags, > +struct strbuf *log_file, int flags, > struct strbuf *err) > { > [...] Nice change. How about taking this o

Re: [PATCH 17/17] memoize common git-path "constant" files

2015-08-10 Thread Michael Haggerty
memoized functions were called before git_common_dir is initialized, then the pre-git_common_dir value would continue to be used even if git_common_dir is changed afterwards. But I believe it is taboo to call git_path() before setup_git_env(), so I think this is not a problem. Michael -- Michael

Re: [PATCH 0/17] removing questionable uses of git_path

2015-08-10 Thread Michael Haggerty
: memoize common git-path "constant" files I read through all of the patches (except for 03) and didn't see any problems. Thanks, Peff, for defusing some grenades :-) Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the line "unsubscr

Re: [PATCH 04/17] add_to_alternates_file: don't add duplicate entries

2015-08-10 Thread Michael Haggerty
ut if I'm wrong, it might be friendly to de-dup the existing lines while copying them. 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-info.html

Re: [PATCH v2 12/16] diff: use tempfile module

2015-08-12 Thread Michael Haggerty
On 08/11/2015 10:03 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> Signed-off-by: Michael Haggerty >> --- >> diff.c | 29 +++-- >> 1 file changed, 7 insertions(+), 22 deletions(-) > > Nice code reduction. > >>

Re: [PATCH v2 00/16] Introduce a tempfile module

2015-08-12 Thread Michael Haggerty
On 08/11/2015 10:21 PM, Junio C Hamano wrote: > Thanks for a pleasant read. All looked reasonable. Thanks for your review! 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...@vg

[PATCH v2' 12/16] diff: use tempfile module

2015-08-12 Thread Michael Haggerty
Also add some code comments explaining how the fields in "struct diff_tempfile" are used. Signed-off-by: Michael Haggerty --- This is a replacement for tempfile patch v2 12/16 that includes some extra code comments. It is also available from my GitHub repo [1] on branch "tempfi

Re: [PATCH v3 2/4] path: optimize common dir checking

2015-08-13 Thread Michael Haggerty
3rd-party applications that think they are clever enough to grub around in `$GIT_DIR` at the filesystem level. But that should be highly discouraged, and we should make it our mission to provide commands that make it unnecessary. Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe f

Re: [PATCH v3 3/4] refs: make refs/worktree/* per-worktree

2015-08-13 Thread Michael Haggerty
ks. > > When I make that change, my test fails with: > > FATAL: Unexpected exit with code 2 > > Apparently, you can't use ! in pipelines like that. So that's why I > used test_must_fail. You would have to negate the whole pipeline, like ! git for-each-r

Re: [PATCH v3 3/4] refs: make refs/worktree/* per-worktree

2015-08-14 Thread Michael Haggerty
On 08/13/2015 10:32 PM, David Turner wrote: > On Thu, 2015-08-13 at 22:16 +0200, Michael Haggerty wrote: >> On 08/13/2015 07:41 PM, David Turner wrote: >>> On Thu, 2015-08-13 at 13:15 -0400, Eric Sunshine wrote: >>>> On Wed, Aug 12, 2015 at 5:57 PM, David Turner &g

Re: [PATCH v3 2/4] path: optimize common dir checking

2015-08-15 Thread Michael Haggerty
On 08/14/2015 07:04 PM, Junio C Hamano wrote: > Michael Haggerty writes: > >> Let's take a step back. >> >> We have always had a ton of code that uses `git_path()` and friends to >> convert abstract things into filesystem paths. Let's take the

Re: [PATCH v3 2/4] path: optimize common dir checking

2015-08-15 Thread Michael Haggerty
(That is, the other way was a giant hassle). OK, so the functions can be empty for the lmdb backend, too :-) > [...] > For this patch series, I don't think we need to change anything [...] > Implementing > Junio's proposal would not affect this series; it would jus

Re: [PATCH v13 05/12] ref-filter: add option to filter out tags, branches and remotes

2015-08-26 Thread Michael Haggerty
ern int for_each_glob_ref(each_ref_fn fn, const char *pattern, void > *cb_data); > extern int for_each_glob_ref_in(each_ref_fn fn, const char *pattern, const > char *prefix, void *cb_data); > +extern int for_each_reftype_fullpath(each_ref_fn fn, char *type, unsigned > int broken, void *cb_data); This function is most like for_each_ref_in(prefix, fn, cb_data). Therefore, I suggest that you rename the "type" parameter" to "prefix", maybe reorder its arguments, and maybe rename it (to for_each_fullref_in()?) for consistency, and maybe put its declaration next to that function's. (I see that the argument orders among these functions are already pretty inconsistent, but it seems best to be consistent with the function that is most similar to it.) I think the "type"/"prefix" argument can be "const char *". > > extern int head_ref_submodule(const char *submodule, each_ref_fn fn, void > *cb_data); > extern int for_each_ref_submodule(const char *submodule, each_ref_fn fn, > void *cb_data); > 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-info.html

Re: [PATCH v13 05/12] ref-filter: add option to filter out tags, branches and remotes

2015-08-27 Thread Michael Haggerty
On 08/27/2015 02:42 PM, Karthik Nayak wrote: > On Wed, Aug 26, 2015 at 9:40 PM, Michael Haggerty > wrote: >> On 08/22/2015 05:39 AM, Karthik Nayak wrote: >>> [...] >>> + if (type == FILTER_REFS_BRANCHES) >>> + ret = for_each_reftype_fullpa

Bloom filters for have/want negotiation

2015-09-11 Thread Michael Haggerty
has promise. (I have no plans to pursue it.) Michael [1] http://git-merge.com/videos/scaling-git-at-twitter-wilhelm-bierbaum.html -- 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.ker

Re: Bloom filters for have/want negotiation

2015-09-13 Thread Michael Haggerty
On 09/12/2015 07:16 AM, Shawn Pearce wrote: > On Fri, Sep 11, 2015 at 2:13 PM, Michael Haggerty > wrote: >> I have been thinking about Wilhelm Bierbaum's talk at the last GitMerge >> conference [1] in which he describes a scheme for using Bloom filters to >&g

Re: [PATCH v4] gc: save log from daemonized gc --auto and print it next time

2015-09-16 Thread Michael Haggerty
y would require a lot of other code to be duplicated. Another possibility that might work (maybe without requiring changes to tempfile/lockfile): don't worry about deleting the log file if it is empty, but make observers treat an empty log file the same as an absent one. Michael [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03 -- 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-info.html

Re: [PATCH v4] gc: save log from daemonized gc --auto and print it next time

2015-09-17 Thread Michael Haggerty
ecution. ^^^ This was the point that was confusing me. If this is not one of the roles of the log file, then things are easier. If you decide to go the route of tempfile/lockfile modifications, feel free to CC me for feedback. Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscri

Re: [PATCH v5 2/3] path: optimize common dir checking

2015-10-04 Thread Michael Haggerty
suggest a raft of other improvements. Ask me if you are interested. 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-info.html

Re: [PATCH v2 01/43] refs.c: create a public version of verify_refname_available

2015-10-04 Thread Michael Haggerty
e, struct string_list *extra, > + struct string_list *skip, struct strbuf *err); > + > +/* > * Flags controlling ref_transaction_update(), ref_transaction_create(), etc. > * REF_NODEREF: act on the ref directly, instead of dereferencing > * symbolic references. > 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-info.html

Re: [PATCH v2 02/43] refs: make repack_without_refs and is_branch public

2015-10-04 Thread Michael Haggerty
ithout_refs(struct string_list *refnames, struct strbuf *err) I looked for the corresponding change to remove `static` from is_branch(). Apparently that function already had external linkage, even though it was not listed in the header file. As a convenience to readers you might note that peculiari

Re: [PATCH v2 18/43] refs-be-files.c: add a backend method structure with transaction functions

2015-10-05 Thread Michael Haggerty
gt; + ref_transaction_create_fn transaction_create; > + ref_transaction_delete_fn transaction_delete; > + ref_transaction_verify_fn transaction_verify; > + ref_transaction_commit_fn transaction_commit; > + ref_transaction_free_fn transaction_free; > +}; > + > + > +extern struct ref_

Re: [PATCH v2 22/43] refs-be-files.c: add do_for_each_per_worktree_ref

2015-10-05 Thread Michael Haggerty
include per-worktree refs in a do_for_each_ref*() iteration */ > +#define DO_FOR_EACH_PER_WORKTREE_ONLY 0x02 And why do you define this one here instead of in refs-be-files.c? > [...] Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the li

Re: [PATCH v2 28/43] refs.c: add ref backend init function

2015-10-05 Thread Michael Haggerty
date; > ref_transaction_create_fn transaction_create; > @@ -669,6 +671,6 @@ struct ref_be { > > > extern struct ref_be refs_be_files; > -int set_refs_backend(const char *name); > +int set_refs_backend(const char *name, void *init_data); > > #endif /* REFS_H */ > 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-info.html

Re: [PATCH v2 30/43] refs-be-files.c: add method to expire reflogs

2015-10-05 Thread Michael Haggerty
l to squash this into the previous patch. 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-info.html

Re: [PATCH v2 37/43] refs: move some defines from refs-be-files.c to refs.h

2015-10-05 Thread Michael Haggerty
eference backends. In fact, maybe `struct ref_be` and the associated typedefs could even be moved there. Probably some of the functions that you have made public earlier in this series could also go into the "protected" area. Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsu

Re: [PATCH v2 38/43] refs: make some files backend functions public

2015-10-05 Thread Michael Haggerty
les backend. That seems like a more complicated and less flexible design. But I'm open to be persuaded otherwise... 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.

Re: [PATCH v2 39/43] refs: break out a ref conflict check

2015-10-05 Thread Michael Haggerty
{ > diff --git a/refs.h b/refs.h > index da29232..cf1780e 100644 > --- a/refs.h > +++ b/refs.h > @@ -571,6 +571,10 @@ enum ref_type ref_type(const char *refname); > > int copy_reflog_msg(char *buf, const char *msg); > > +const char *find_descendant_ref(const char *refn

Re: [PATCH v2 40/43] refs: allow ref backend to be set for clone

2015-10-05 Thread Michael Haggerty
g that we were chatting about off-list. I haven't reviewed the actual code in this patch yet but I wanted to get the above comment on your radar. Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a mes

Re: [PATCH v2 40/43] refs: allow ref backend to be set for clone

2015-10-05 Thread Michael Haggerty
nd-type", > + refs_backend_type, NULL) < 0) > + die("unable to write backend parameter to config file"); > } Our config variable names don't use separated-with-hyphens but rather wordsruntogether (though in docum

Re: [PATCH v2 42/43] refs: add LMDB refs backend

2015-10-05 Thread Michael Haggerty
of time, and never when calling other processes. * Locks usually only apply to single references (loose references). Sometimes the packed-refs file has to be locked, but in such cases a second writer retries the lock acquisition for long enough that it should usually succeed. * If a reference val

[PATCH 0/3] Fix how for-each-ref handles broken loose references

2015-06-01 Thread Michael Haggerty
es was prepared against "maint" as it might be suitable for that branch, but it also applies cleanly against "master". This patch series is also available from my GitHub account [1], as branch for-each-ref-errors. [1] https://github.com/mhagger/git Michael Haggerty (3): t63

[PATCH 1/3] t6301: new tests of for-each-ref error handling

2015-06-01 Thread Michael Haggerty
come. Signed-off-by: Michael Haggerty --- Notes (discussion): Note that a reference that points at NULL_SHA1 is reported as "broken" rather than "missing". This is because NULL_SHA1 is manifestly bogus, whereas we have no systematic basis for rejecting any other

[PATCH 3/3] read_loose_refs(): treat NULL_SHA1 loose references as broken

2015-06-01 Thread Michael Haggerty
t;SHA-1 is invalid" value inside of Git client source code (not only ours!), and accidentally writing it to a loose reference file would be an easy mistake to make. Signed-off-by: Michael Haggerty --- refs.c | 7 +++ t/t6301-for-each-ref-errors.sh | 2 +- 2 files

[PATCH 2/3] for-each-ref: report broken references correctly

2015-06-01 Thread Michael Haggerty
rocessed *as if* they had the value NULL_SHA1, which is the value stored in entries for broken references. Change "git for-each-ref" to emit warnings for references that are REF_ISBROKEN but to otherwise skip them. Signed-off-by: Michael Haggerty --- builtin/for-each-ref.c |

Re: [PATCH 1/3] t6301: new tests of for-each-ref error handling

2015-06-02 Thread Michael Haggerty
On 06/01/2015 06:08 PM, Jeff King wrote: > On Mon, Jun 01, 2015 at 05:53:49PM +0200, Michael Haggerty wrote: > >> Add tests that for-each-ref correctly reports broken loose reference >> files and references that point at missing objects. In fact, two of >> these tests fai

[PATCH v2 2/3] for-each-ref: report broken references correctly

2015-06-02 Thread Michael Haggerty
rocessed *as if* they had the value NULL_SHA1, which is the value stored in entries for broken references. Change "git for-each-ref" to emit warnings for references that are REF_ISBROKEN but to otherwise skip them. Signed-off-by: Michael Haggerty --- builtin/for-each-ref.c |

[PATCH v2 1/3] t6301: new tests of for-each-ref error handling

2015-06-02 Thread Michael Haggerty
This is OK. Signed-off-by: Michael Haggerty --- Notes (discussion): Note that a reference that points at NULL_SHA1 is reported as "broken" rather than "missing". This is because NULL_SHA1 is manifestly bogus, whereas we have no systematic basis for rejecting any o

[PATCH v2 0/3] Fix how for-each-ref handles broken loose references

2015-06-02 Thread Michael Haggerty
patch series is also available from my GitHub account [2] as branch for-each-ref-errors. [1] http://thread.gmane.org/gmane.comp.version-control.git/270429 [2] https://github.com/mhagger/git Michael Haggerty (3): t6301: new tests of for-each-ref error handling for-each-ref: report broken

[PATCH v2 3/3] read_loose_refs(): treat NULL_SHA1 loose references as broken

2015-06-02 Thread Michael Haggerty
t;SHA-1 is invalid" value inside of Git client source code (not only ours!), and accidentally writing it to a loose reference file would be an easy mistake to make. Signed-off-by: Michael Haggerty --- refs.c | 7 +++ t/t6301-for-each-ref-errors.sh | 2 +- 2 files

Re: [PATCH v2 3/3] read_loose_refs(): treat NULL_SHA1 loose references as broken

2015-06-02 Thread Michael Haggerty
On 06/02/2015 07:28 PM, Stefan Beller wrote: > On Tue, Jun 2, 2015 at 8:57 AM, Michael Haggerty wrote: >> NULL_SHA1 is never a valid value for a reference. If a loose reference >> has that value, mark it as broken. >> >> Why check NULL_SHA1 and not the nearly 2^160 ot

[PATCH v3 1/4] t6301: new tests of for-each-ref error handling

2015-06-03 Thread Michael Haggerty
This is OK. Signed-off-by: Michael Haggerty --- t/t6301-for-each-ref-errors.sh | 56 ++ 1 file changed, 56 insertions(+) create mode 100755 t/t6301-for-each-ref-errors.sh diff --git a/t/t6301-for-each-ref-errors.sh b/t/t6301-for-each-ref-errors.sh new fi

[PATCH v3 0/4] Fix how for-each-ref handles broken loose references

2015-06-03 Thread Michael Haggerty
. This patch series is also available from my GitHub account [3] as branch for-each-ref-errors. [1] http://thread.gmane.org/gmane.comp.version-control.git/270429 [2] http://thread.gmane.org/gmane.comp.version-control.git/270556 [3] https://github.com/mhagger/git Michael Haggerty (4): t6301: new

[PATCH v3 2/4] for-each-ref: report broken references correctly

2015-06-03 Thread Michael Haggerty
rocessed *as if* they had the value NULL_SHA1, which is the value stored in entries for broken references. Change "git for-each-ref" to emit warnings for references that are REF_ISBROKEN but to otherwise skip them. Signed-off-by: Michael Haggerty --- builtin/for-each-ref.c |

[PATCH v3 4/4] read_loose_refs(): treat NULL_SHA1 loose references as broken

2015-06-03 Thread Michael Haggerty
rence file by accident, whereas accidentally writing NULL_SHA1 to a loose reference file would be an easy mistake to make. Signed-off-by: Michael Haggerty --- refs.c | 10 ++ t/t6301-for-each-ref-errors.sh | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) di

[PATCH v3 3/4] read_loose_refs(): simplify function logic

2015-06-03 Thread Michael Haggerty
Make it clearer that there are two possible ways to read the reference, but that we handle read errors uniformly regardless of which way it was read. This refactoring also makes the following change easier to implement. Signed-off-by: Michael Haggerty --- refs.c | 19 --- 1

Re: [PATCH mh/lockfile-retry] lockfile: replace random() by rand()

2015-06-04 Thread Michael Haggerty
ight have portability advantages, presumably on other platforms. Maybe the easiest thing would be to switch to using rand() and see if the OS/2 and VMS users complain ;-) Michael -- Michael Haggerty mhag...@alum.mit.edu -- To unsubscribe from this list: send the line "unsubscribe gi

Re: [PATCH v3 16/56] add_branch_for_removal(): don't set "util" field of string_list entries

2015-06-05 Thread Michael Haggerty
On 05/25/2015 08:38 PM, brian m. carlson wrote: > From: Michael Haggerty > > They were never used. > [...] I happened to dig into the background of this change a little more, and this is what I found out. When deleting remote-tracking references, we used to record the old_

Re: Pack files, standards compliance, and efficiency

2015-06-05 Thread Michael Haggerty
struct object_id oid_copy = *oid; /* ... */ } The compiler is allowed to implement the copy using instructions that rely on proper alignment. Such code would fail if oid is not properly aligned. Michael -- Michael Haggerty mhag...@alum.mit.edu http://softwareswirl.blogspot.com/ -- T

Re: Pack files, standards compliance, and efficiency

2015-06-05 Thread Michael Haggerty
On 06/05/2015 09:42 PM, brian m. carlson wrote: > On Fri, Jun 05, 2015 at 05:22:08PM +0200, Michael Haggerty wrote: >> I don't know that there would necessarily be problems, but I >> would worry about code involving structure assignment. For >> example, suppose the follow

Re: [PATCH 0/4] Fix file locking with retry and timeout on Windows

2015-06-05 Thread Michael Haggerty
4 files changed, 16 insertions(+), 23 deletions(-) The whole series looks good to me. Johannes, thanks for taking care of this. 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.

[PATCH 00/14] Introduce a tempfile module

2015-06-08 Thread Michael Haggerty
. [1] http://git.github.io/SoC-2014-Ideas.html [2] https://github.com/mhagger/git Michael Haggerty (14): Move lockfile API documentation to lockfile.h tempfile: a new module for handling temporary files lockfile: remove some redundant functions commit_lock_file(): use get_locked_

[PATCH 01/14] Move lockfile API documentation to lockfile.h

2015-06-08 Thread Michael Haggerty
Rearrange/rewrite it somewhat to fit its new environment. Signed-off-by: Michael Haggerty --- Documentation/technical/api-lockfile.txt | 220 -- lockfile.h | 310 ++- 2 files changed, 266 insertions(+), 264 deletions

[PATCH 14/14] credential-cache--daemon: use tempfile module

2015-06-08 Thread Michael Haggerty
Use the tempfile module to ensure that the socket file gets deleted on program exit. Signed-off-by: Michael Haggerty --- credential-cache--daemon.c | 26 ++ 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/credential-cache--daemon.c b/credential-cache

[PATCH 02/14] tempfile: a new module for handling temporary files

2015-06-08 Thread Michael Haggerty
mplement lockfile on top of tempfile. This first step is a pretty direct transplant of code. Subsequent commits will improve the boundary between the two modules and add users of the new module. Signed-off-by: Michael Haggerty --- Makefile | 1 + builtin/add.c|

[PATCH 10/14] diff: use tempfile module

2015-06-08 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- diff.c | 29 +++-- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/diff.c b/diff.c index 7500c55..742a842 100644 --- a/diff.c +++ b/diff.c @@ -2,6 +2,7 @@ * Copyright (C) 2005 Junio C Hamano */ #include "ca

[PATCH 12/14] gc: use tempfile module to handle gc.pid file

2015-06-08 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- builtin/gc.c | 24 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index 4dc21b2..a340e89 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -43,20 +43,7 @@ static struct argv_array prune

[PATCH 03/14] lockfile: remove some redundant functions

2015-06-08 Thread Michael Haggerty
Remove the following functions and rewrite their callers to use the equivalent tempfile functions directly: * fdopen_lock_file() -> fdopen_tempfile() * reopen_lock_file() -> reopen_tempfile() * close_lock_file() -> close_tempfile() Signed-off-by: Michael Haggerty --- builtin/comm

[PATCH 09/14] setup_temporary_shallow(): use tempfile module

2015-06-08 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- shallow.c | 34 ++ 1 file changed, 6 insertions(+), 28 deletions(-) diff --git a/shallow.c b/shallow.c index 59ee321..311ba9b 100644 --- a/shallow.c +++ b/shallow.c @@ -209,50 +209,28 @@ int write_shallow_commits(struct strbuf

[PATCH 06/14] tempfile: add several functions for creating temporary files

2015-06-08 Thread Michael Haggerty
the code where temporary files are created and cleaned up ad-hoc. Signed-off-by: Michael Haggerty --- tempfile.c | 55 ++- tempfile.h | 96 ++ 2 files changed, 150 insertions(+), 1 deletion(-) diff --git a

[PATCH 04/14] commit_lock_file(): use get_locked_file_path()

2015-06-08 Thread Michael Haggerty
First beef up the sanity checking in get_locked_file_path() to match that in commit_lock_file(). Then rewrite commit_lock_file() to use get_locked_file_path() for its pathname computation. Signed-off-by: Michael Haggerty --- lockfile.c | 30 +- 1 file changed, 13

[PATCH 07/14] register_tempfile(): new function to handle an existing temporary file

2015-06-08 Thread Michael Haggerty
Allow an existing file to be registered with the tempfile-handling infrastructure; in particular, arrange for it to be deleted on program exit. Signed-off-by: Michael Haggerty --- tempfile.c | 9 + tempfile.h | 8 2 files changed, 17 insertions(+) diff --git a/tempfile.c b

[PATCH 11/14] lock_repo_for_gc(): compute the path to "gc.pid" only once

2015-06-08 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- builtin/gc.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/builtin/gc.c b/builtin/gc.c index 6e18d35..4dc21b2 100644 --- a/builtin/gc.c +++ b/builtin/gc.c @@ -200,6 +200,7 @@ static const char *lock_repo_for_gc(int force, pid_t

[PATCH 05/14] register_tempfile_object(): new function, extracted from create_tempfile()

2015-06-08 Thread Michael Haggerty
This makes the next step easier. Signed-off-by: Michael Haggerty --- tempfile.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tempfile.c b/tempfile.c index bde7fd3..f76bc07 100644 --- a/tempfile.c +++ b/tempfile.c @@ -31,11 +31,8 @@ static void

[PATCH 08/14] write_shared_index(): use tempfile module

2015-06-08 Thread Michael Haggerty
Signed-off-by: Michael Haggerty --- read-cache.c | 37 + 1 file changed, 5 insertions(+), 32 deletions(-) diff --git a/read-cache.c b/read-cache.c index 3e49c49..4f7b70f 100644 --- a/read-cache.c +++ b/read-cache.c @@ -2137,54 +2137,27 @@ static int

[PATCH 13/14] credential-cache--daemon: delete socket from main()

2015-06-08 Thread Michael Haggerty
main() is responsible for cleaning up the socket in the case of errors, so it is reasonable to also make it responsible for cleaning it up when there are no errors. This change also makes the next step easier. Signed-off-by: Michael Haggerty --- credential-cache--daemon.c | 3 ++- 1 file

Re: [PATCH v3 4/4] read_loose_refs(): treat NULL_SHA1 loose references as broken

2015-06-08 Thread Michael Haggerty
On 06/03/2015 11:20 PM, Junio C Hamano wrote: > Jeff King writes: > >> On Wed, Jun 03, 2015 at 11:51:43AM -0700, Junio C Hamano wrote: >> >>> Jeff King writes: >>> >>>> On Wed, Jun 03, 2015 at 03:51:59PM +0200, Michael Haggerty wrote: >>&g

[PATCH 01/13] delete_ref(): move declaration to refs.h

2015-06-08 Thread Michael Haggerty
Also * Add a docstring * Rename the second parameter to "old_sha1", to be consistent with the convention used elsewhere in the refs module Signed-off-by: Michael Haggerty --- cache.h | 2 -- refs.c | 5 +++-- refs.h | 9 + 3 files changed, 12 insertions(+), 4 deletion

[PATCH 08/13] repack_without_refs(): make function private

2015-06-08 Thread Michael Haggerty
It is no longer called from outside of the refs module. Also move its docstring and change it to imperative voice. Signed-off-by: Michael Haggerty --- refs.c | 9 - refs.h | 11 --- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/refs.c b/refs.c index a10aba8

[PATCH 03/13] delete_ref(): handle special case more explicitly

2015-06-08 Thread Michael Haggerty
. Signed-off-by: Michael Haggerty --- refs.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/refs.c b/refs.c index b575bb8..f9d87b6 100644 --- a/refs.c +++ b/refs.c @@ -2795,10 +2795,13 @@ int delete_ref(const char *refname, const unsigned char *old_sha1, struct

  1   2   3   4   5   6   7   8   9   10   >