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
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
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
,
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
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
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
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
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
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
[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
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
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.
>&
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
/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_
_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
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
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 +++
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
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
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
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
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
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
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
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
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 &
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"
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
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
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
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
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
: 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
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
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.
>
>>
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
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
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
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
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
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
(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
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
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
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
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
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
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
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
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
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
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_
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
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
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
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
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.
{
> 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
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
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
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
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
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
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
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 |
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
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 |
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 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
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
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
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
.
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
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 |
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
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
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
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_
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
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
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.
.
[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_
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
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
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|
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
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
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
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
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
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
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
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
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
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
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
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
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
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
.
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 - 100 of 3206 matches
Mail list logo