Error out if the ref_transaction includes more than one update for any
refname.
Signed-off-by: Michael Haggerty
---
refs.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/refs.c b/refs.c
index b103a4b..ced4e53 100644
--- a/refs.c
+++ b/refs.c
@@ -4064,12 +4064,22 @@ int
This string is going to have to be re-internationalized anyway because
of the previous commit. So while we're at it, we might as well convert
it to lower case as per our usual practice.
Signed-off-by: Michael Haggerty
---
refs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff
This will result in errors being emitted for references that can't be
deleted, but that is a good thing.
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 11 ++-
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index c8
Move the function remove_branches() from builtin/remote.c to refs.c,
rename it to delete_refs(), and make it public.
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 21 +
refs.c | 19 +++
refs.h | 7 +++
3 files changed, 27
er need to
care about the distinction between loose and packed references.
These patches are also available from my GitHub account [1] as branch
"init-delete-refs-api".
[1] https://github.com/mhagger/git
Michael Haggerty (13):
delete_ref(): move declaration to refs.h
remove_branches
, the
function trusts its caller to only call it when it makes sense. Future
commits will add some more limited sanity checks.
Signed-off-by: Michael Haggerty
---
builtin/clone.c | 19 +++
refs.c | 47 +++
refs.h | 14 +
e shouldn't *be* any existing references when this
function is called. But, at least in the case of the "testgit" remote
helper, "clone" can be called after the remote-tracking "HEAD" and
"master" branches have already been created. So let's just
Change the error message from
Could not remove branch %s
to
Could not remove reference %s
This change makes sense even for the existing caller, which uses the
function to delete remote-tracking branches.
Signed-off-by: Michael Haggerty
---
refs.c | 2 +-
1 file changed, 1 insertion
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index f4a6ec9..53b8e13 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -756,8 +756,7 @@ static int remove_branches(struct
difference between loose and packed
references.
Signed-off-by: Michael Haggerty
---
refs.c | 31 ---
refs.h | 30 --
2 files changed, 24 insertions(+), 37 deletions(-)
diff --git a/refs.c b/refs.c
index ec4b8a0..b103a4b 100644
--- a/refs.c
Some functions from the refs module were still declared in cache.h.
Move them to refs.h.
Add some parameter names where they were missing.
Signed-off-by: Michael Haggerty
---
archive.c | 1 +
builtin/blame.c | 1 +
builtin/fast-export.c | 1 +
builtin/fmt-merge
New function, extracted from fsck_handle_reflog_ent(). The extra
is_null_sha1() test for the new reference is currently unnecessary, as
reflogs are deleted when the reference itself is deleted. But it
doesn't hurt, either.
Signed-off-by: Michael Haggerty
---
builtin/fsck.c
Previously, if a reflog entry's old or new SHA-1 was not resolvable to
an object, that SHA-1 was silently ignored. Instead, report such cases
as errors.
Signed-off-by: Michael Haggerty
---
builtin/fsck.c | 13 +
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/bu
com/mhagger/git
Michael Haggerty (2):
fsck_handle_reflog_sha1(): new function
fsck: report errors if reflog entries point at invalid objects
builtin/fsck.c | 34 --
1 file changed, 20 insertions(+), 14 deletions(-)
--
2.1.4
--
To unsubscribe from this list
On 06/08/2015 04:27 PM, Johannes Schindelin wrote:
> On 2015-06-08 08:40, Michael Haggerty wrote:
>> Previously, if a reflog entry's old or new SHA-1 was not resolvable
>> to an object, that SHA-1 was silently ignored. Instead, report such
>> cases as errors.
>
>
On 06/08/2015 05:07 PM, Junio C Hamano wrote:
> Michael Haggerty writes:
>
>> New function, extracted from fsck_handle_reflog_ent(). The extra
>> is_null_sha1() test for the new reference is currently unnecessary, as
>> reflogs are deleted when the reference itself is de
On 06/08/2015 06:43 PM, Stefan Beller wrote:
> On Mon, Jun 8, 2015 at 4:45 AM, Michael Haggerty wrote:
>> [...]
>> +/*
>> + * Delete the specified reference. If old_sha1 is non-NULL and not
>> + * NULL_SHA1, then verify that the current value of the reference is
>>
On 06/08/2015 06:48 PM, Stefan Beller wrote:
> On Mon, Jun 8, 2015 at 4:45 AM, Michael Haggerty wrote:
>> delete_ref() uses a different convention for its old_sha1 parameter
>> than, say, ref_transaction_delete(): NULL_SHA1 means not to check the
>> old value. Make this fact
On 06/08/2015 06:51 PM, Stefan Beller wrote:
> On Mon, Jun 8, 2015 at 4:45 AM, Michael Haggerty wrote:
>> This string is going to have to be re-internationalized anyway because
>> of the previous commit. So while we're at it, we might as well convert
>> it to lower case
On 06/08/2015 07:12 PM, Jeff King wrote:
> On Mon, Jun 08, 2015 at 09:57:04AM -0700, Stefan Beller wrote:
>
>> On Mon, Jun 8, 2015 at 4:45 AM, Michael Haggerty
>> wrote:
>>> This will result in errors being emitted for references that can't be
>>> dele
On 06/10/2015 07:36 PM, Junio C Hamano wrote:
> Michael Haggerty writes:
>
>> diff --git a/builtin/add.c b/builtin/add.c
>> index df5135b..aaa9ce4 100644
>> --- a/builtin/add.c
>> +++ b/builtin/add.c
>> @@ -5,6 +5,7 @@
>> */
>> #include
; **local_tail = ref;
> *local_tail = &ref->next;
> [...]
> diff --git a/transport-helper.c b/transport-helper.c
> index 5d99a6b..4ca3e80 100644
> --- a/transport-helper.c
> +++ b/transport-helper.c
> [...]
> @@ -883,7 +883,7 @@ static int push_refs_with_exp
nction would want
to return 0 on *error*.
Which is another disadvantage of this style. All the code that called
get_sha1_hex() had to treat 0 as success. With your function they would
have to be inverted to treat 0 as failure. I think this would cause
confusion.
> [...]
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
idn't like the idea of parse_oid_hex as it
> stands, so it will end up being mostly moot.
In the same email where I made those design suggestions, I also I
pointed out a bug in the implementation of parse_oid_hex(). Maybe that
is the reason for the test failures.
Michael
- --
Michael
On 06/09/2015 06:42 PM, Stefan Beller wrote:
> On Tue, Jun 9, 2015 at 3:10 AM, Michael Haggerty wrote:
>> In set notation,
>>
>> "non-NULL" =
>> "non-NULL and not NULL_SHA1" ∪
>> "non-NULL and equal to NULL_SHA1"
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 | 10 ++
3 files changed, 13 insertions(+), 4
Move the function remove_branches() from builtin/remote.c to refs.c,
rename it to delete_refs(), and make it public.
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 21 +
refs.c | 19 +++
refs.h | 7 +++
3 files changed, 27
.
Signed-off-by: Michael Haggerty
---
refs.c | 11 +--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index b575bb8..f0b6cec 100644
--- a/refs.c
+++ b/refs.c
@@ -2795,10 +2795,17 @@ int delete_ref(const char *refname, const unsigned char
*old_sha1,
struct
This will result in errors being emitted for references that can't be
deleted, but that is a good thing.
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 11 ++-
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index c8
e shouldn't *be* any existing references when this
function is called. But, at least in the case of the "testgit" remote
helper, "clone" can be called after the remote-tracking "HEAD" and
"master" branches have already been created. So let's just do th
Some functions from the refs module were still declared in cache.h.
Move them to refs.h.
Add some parameter names where they were missing.
Signed-off-by: Michael Haggerty
---
archive.c | 1 +
builtin/blame.c | 1 +
builtin/fast-export.c | 1 +
builtin/fmt-merge
error message in
delete_refs().
These patches are also available from my GitHub account [2] as branch
"init-delete-refs-api".
Michael
[1] http://thread.gmane.org/gmane.comp.version-control.git/271017
[2] https://github.com/mhagger/git
Michael Haggerty (12):
delete_ref(): move decl
convention.
Signed-off-by: Michael Haggerty
---
refs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs.c b/refs.c
index 6f62bd1..5386077 100644
--- a/refs.c
+++ b/refs.c
@@ -2831,7 +2831,7 @@ int delete_refs(struct string_list *refnames)
const char *refname
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index f4a6ec9..53b8e13 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -756,8 +756,7 @@ static int remove_branches(struct
difference between loose and packed
references.
Signed-off-by: Michael Haggerty
---
refs.c | 31 ---
refs.h | 30 --
2 files changed, 24 insertions(+), 37 deletions(-)
diff --git a/refs.c b/refs.c
index 05e5d42..a715524 100644
--- a/refs.c
Error out if the ref_transaction includes more than one update for any
refname.
Signed-off-by: Michael Haggerty
---
refs.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/refs.c b/refs.c
index a715524..dfe9090 100644
--- a/refs.c
+++ b/refs.c
@@ -4068,12 +4068,22 @@ int
, the
function trusts its caller to only call it when it makes sense. Future
commits will add some more limited sanity checks.
Signed-off-by: Michael Haggerty
---
builtin/clone.c | 19 +++
refs.c | 47 +++
refs.h | 14 +
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 5386077
On 06/15/2015 08:29 PM, Junio C Hamano wrote:
> Michael Haggerty writes:
>
>> Subject: Re: [PATCH v2 05/12] delete_refs(): improve error message
>
> I'd call this "make error message more generic".
>
>> Change the error message from
>>
>>
gt;> +extern int for_each_glob_ref_in(each_ref_fn fn, const char *pattern, const
>>> char* prefix, void *cb_data);
>>
>> Likewise for addition of fn and cb_data.
>>
>> If you really want to make unrelated changes to this file, what you
>> should fix is to update "const char* prefix" to "const char *prefix"
>> ;-)
>
> IMHO they are in the same boat (style fixes), and I would be happy to
> see both improved. :)
I will fix this too.
Michael
--
Michael Haggerty
mhag...@alum.mit.edu
--
To unsubscribe from this list: send the line "unsubscribe git" in
On 06/15/2015 08:53 PM, Junio C Hamano wrote:
> Michael Haggerty writes:
>
>> +struct ref_transaction *t;
>> +struct strbuf err = STRBUF_INIT;
>> +
>> +t = ref_transaction_begin(&err);
>> +if (!t)
>> +die(err.buf);
&g
lity` check that would would default to OFF
but sometimes turn on by hand.
--
Michael Haggerty
mhag...@alum.mit.edu
--
To unsubscribe from this list: send the line "unsubscribe git" in
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 | 10 ++
3 files changed, 13 insertions(+), 4
difference between loose and packed
references.
Signed-off-by: Michael Haggerty
---
refs.c | 31 ---
refs.h | 30 --
2 files changed, 24 insertions(+), 37 deletions(-)
diff --git a/refs.c b/refs.c
index 2367572..31661c7 100644
--- a/refs.c
Move the function remove_branches() from builtin/remote.c to refs.c,
rename it to delete_refs(), and make it public.
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 21 +
refs.c | 19 +++
refs.h | 7 +++
3 files changed, 27
at it, convert the error message to lower case, as per our
usual convention.
Signed-off-by: Michael Haggerty
---
refs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/refs.c b/refs.c
index 6f62bd1..5386077 100644
--- a/refs.c
+++ b/refs.c
@@ -2831,7 +2831,7 @@ int delet
Signed-off-by: Michael Haggerty
---
refs.h | 22 +++---
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/refs.h b/refs.h
index b22e308..c9596ea 100644
--- a/refs.h
+++ b/refs.h
@@ -62,7 +62,7 @@ extern int read_ref_full(const char *refname, int
resolve_flags
Some functions from the refs module were still declared in cache.h.
Move them to refs.h.
Signed-off-by: Michael Haggerty
---
archive.c | 1 +
builtin/blame.c | 1 +
builtin/fast-export.c | 1 +
builtin/fmt-merge-msg.c | 1 +
builtin/init-db.c | 1
d" with the old
value set to "does not exist", just as it is for the `--stdin`
command "delete". But since this usage was accepted until now,
continue to accept it.
* The call in delete_branches(), which could pass NULL_SHA1 if
deleting a broken or symbolic ref. Change i
Error out if the ref_transaction includes more than one update for any
refname.
Signed-off-by: Michael Haggerty
---
refs.c | 11 +++
1 file changed, 11 insertions(+)
diff --git a/refs.c b/refs.c
index 31661c7..53d9e45 100644
--- a/refs.c
+++ b/refs.c
@@ -4087,12 +4087,22 @@ int
repack_without_refs() fails, emit a more explicit error message
and bail.
Signed-off-by: Michael Haggerty
---
refs.c | 25 ++---
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/refs.c b/refs.c
index 5386077..19afc4d 100644
--- a/refs.c
+++ b/refs.c
@@ -2823,9 +2823,26 @@ int
e shouldn't *be* any existing references when this
function is called. But, at least in the case of the "testgit" remote
helper, "clone" can be called after the remote-tracking "HEAD" and
"master" branches have already been created. So let's just
.
Signed-off-by: Michael Haggerty
---
refs.c | 11 +--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/refs.c b/refs.c
index b575bb8..f0b6cec 100644
--- a/refs.c
+++ b/refs.c
@@ -2795,10 +2795,17 @@ int delete_ref(const char *refname, const unsigned char
*old_sha1,
struct
quot;init-delete-refs-api".
[1] http://thread.gmane.org/gmane.comp.version-control.git/271017
[2] http://thread.gmane.org/gmane.comp.version-control.git/271552
[3] http://article.gmane.org/gmane.comp.version-control.git/271697
[4] https://github.com/mhagger/git
Michael Haggerty (19):
Make it clear that this function does not overwrite its first
argument.
Signed-off-by: Michael Haggerty
---
builtin/branch.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/branch.c b/builtin/branch.c
index b42e5b6..47e3eb9 100644
--- a/builtin/branch.c
+++ b/builtin
Restructure the code to avoid clearing oldsha1 when oldval is unset.
It's value is not needed in that case, so this change makes it more
obvious that its initialization is consistent with its later use.
Signed-off-by: Michael Haggerty
---
builtin/update-ref.c | 13 ++---
1 file ch
(admittedly extreme) repositories, we've seen
cases where the ref-pruning part of fetch takes multiple tens of
minutes.
Instead call delete_refs(), which (aside from being less code) has the
optimization that it only rewrites the packed-refs file a single time.
Signed-off-by: Michael Hag
because these errors should only ever be seen in the case of a broken
repository or a race between two processes; i.e., only in pretty rare
and anomalous situations.
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 11 ++-
1 file changed, 2 insertions(+), 9 deletions(-)
diff --gi
e
previously didn't exist, we can call delete_ref() on it if we don't
provide an old_sha1 value.
Signed-off-by: Michael Haggerty
---
fast-import.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 6378726..d7ed065 100644
---
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 19afc4d
, the
function trusts its caller to only call it when it makes sense. Future
commits will add some more limited sanity checks.
Signed-off-by: Michael Haggerty
---
builtin/clone.c | 18 ++
refs.c | 47 +++
refs.h | 14 +
Signed-off-by: Michael Haggerty
---
builtin/remote.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/builtin/remote.c b/builtin/remote.c
index f4a6ec9..53b8e13 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -756,8 +756,7 @@ static int remove_branches(struct
On 06/22/2015 11:06 PM, Junio C Hamano wrote:
> Michael Haggerty writes:
>
>> Error out if the ref_transaction includes more than one update for any
>> refname.
>>
>> Signed-off-by: Michael Haggerty
>> ---
>> refs.c | 11 +++
>> 1 file c
de since then,
> and that there are some further changes in-flight from e.g. Michael
> Haggerty. If there is interest in this, I can rebase once Michael's
> changes land.
It's awesome that you are working on this!
I'm reading through your commits and will add comments as th
On 06/23/2015 09:53 PM, David Turner wrote:
> On Tue, 2015-06-23 at 17:51 +0200, Michael Haggerty wrote:
> [...]
>> * I don't like the fact that you have replaced `struct ref_transaction
>> *` with `void *` in the public interface. On a practical level, I like
>> the
Getting help" section down.
* Remove the "Look for a fix instead of a regression in the code"
example, as (1) it was in the "git bisect run" section, but it
doesn't use that command, and (2) I think this usage is adequately
explained in the "Alternate terms&
On 06/26/2015 02:50 PM, Matthieu Moy wrote:
> Michael Haggerty writes:
>
>> * Remove the "Look for a fix instead of a regression in the code"
>> example, as (1) it was in the "git bisect run" section, but it
>> doesn't use that command, and (2
On 06/26/2015 03:15 PM, Christian Couder wrote:
> On Fri, Jun 26, 2015 at 3:00 PM, Matthieu Moy
> wrote:
>> Christian Couder writes:
>>
>>> On Fri, Jun 26, 2015 at 1:30 PM, Michael Haggerty
>>> wrote:
>>>
>>> [...]
>>>
>>&
ot;:
http://article.gmane.org/gmane.comp.version-control.git/244036
I think that making `bisect` smarter could make the UI simpler, though
admittedly it would be more work than the current proposal.
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 06/28/2015 08:15 AM, Junio C Hamano wrote:
> On Sat, Jun 27, 2015 at 10:51 PM, Michael Haggerty
> wrote:
>>
>> I would like to remind everybody of my old claim that it would be
>> possible to teach `git bisect` to infer by itself which term means
>> "
On 06/28/2015 09:32 AM, Junio C Hamano wrote:
> Michael Haggerty writes:
>
>> I understand that the user might make a mistake when marking the initial
>> commits, but as soon as bisect says
>>
>> Commit is an ancestor of , so I
>> will look for the co
"get-mark" command to "git fast-import" that allows the importer
to ask for the value of a mark that has been created earlier.
Signed-off-by: Michael Haggerty
---
This is something that we need for an internal GitHub project, but I
think it will also be of general interest.
Do
It is currently declared to return int, which could overflow for large
files.
Signed-off-by: Michael Haggerty
---
This patch is against maint, but it also rebases against master
without conflict.
I couldn't find any way to exploit this bug. Most callers only use
this function for lo
e whatever error message that commit_ref_update()
emitted rather than the one that was previously chosen here.
> ret = TRANSACTION_GENERIC_ERROR;
> goto cleanup;
> } else {
> diff --git a/refs.h b/refs.h
> index e82fca5..debdefc 100644
> --- a/refs.h
> +++ b/refs.h
> @@ -226,9 +226,9 @@ int pack_refs(unsigned int flags);
> #define REF_NODEREF 0x01
>
> /*
> - * Setup reflog before using. Set errno to something meaningful on failure.
> + * Setup reflog before using. Fill in err and return -1 on failure.
> */
> -int log_ref_setup(const char *refname, struct strbuf *logfile);
> +int log_ref_setup(const char *refname, struct strbuf *logfile, struct strbuf
> *err);
>
> /** Reads log for the value of ref during at_time. **/
> extern int read_ref_at(const char *refname, unsigned int flags,
>
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
+ if (ref_transaction_commit(transaction, &err))
> + die(_("Could not commit ref write %s: %s"), ref, err.buf);
> }
I didn't check all the details, but this code looks a lot like what
update_ref() does. Maybe you can use that function?
> static void pr
og_ref_setup(const char *refname, struct strbuf
> *sb_logfile, struct strbuf
> return 0;
> }
>
> +
> +int safe_create_reflog(const char *refname, struct strbuf *err, int
> force_create)
> +{
> + int ret;
> + struct strbuf sb = STRBUF_INIT;
> +
;
>
> + if (!strcmp(argv[1], "create"))
> + return cmd_reflog_create(argc - 1, argv + 1, prefix);
> +
> + if (!strcmp(argv[1], "exists"))
> + return cmd_reflog_exists(argc - 1, argv + 1, prefix);
> +
> return cmd_log_ref
On 07/08/2015 12:41 AM, David Turner wrote:
> On Mon, 2015-07-06 at 17:53 +0200, Michael Haggerty wrote:
>> On 06/29/2015 10:17 PM, David Turner wrote:
>>> [...]
>>> @@ -3317,7 +3322,8 @@ static int commit_ref_update(struct ref_lock *lock,
>>>
On 07/08/2015 01:18 AM, David Turner wrote:
> On Mon, 2015-07-06 at 18:21 +0200, Michael Haggerty wrote:
>
> changes applied; will re-roll.
>
>>> +
>>> +int safe_create_reflog(const char *refname, struct strbuf *err, int
>>> force_create)
>>&
gt; }
I see this code already did what I complained about in my earlier email
[*]: fail a reference transaction after it is already partly committed.
In my opinion this is incorrect for the reasons stated there. But you
don't have to consider it to be in the scope of your patch series.
[*
non-zero). Otherwise, create it regardless of the reference
* name. Fill in *err and return -1 on failure.
*/
Otherwise, this patch looks good.
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 07/08/2015 02:49 AM, David Turner wrote:
> On Mon, 2015-07-06 at 18:51 +0200, Michael Haggerty wrote:
>> [...]
>> So all in all, I think it is unwise to allow a reflog to be created
>> without its corresponding reference.
>>
>> This, in turn, suggests one or b
>* NULL_SHA1 as "don't care" here:
> @@ -429,7 +437,12 @@ int cmd_update_ref(int argc, const char **argv, const
> char *prefix)
> return delete_ref(refname,
> (oldval && !is_null_sha1(oldsha1)) ? oldsha1
> : NULL,
> flags);
> - else
> + } else {
> + struct strbuf err = STRBUF_INIT;
> + if (create_reflog && safe_create_reflog(refname, &err, 1))
> + die("failed to create reflog for %s: %s", refname,
> err.buf);
This reflog also should not be left around if the reference does not
exist at the end of this command.
> +
> return update_ref(msg, refname, sha1, oldval ? oldsha1 : NULL,
> flags, UPDATE_REFS_DIE_ON_ERR);
> + }
> }
> diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
> index d787bf5..9d21c19 100755
> --- a/t/t1400-update-ref.sh
> +++ b/t/t1400-update-ref.sh
> [...]
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
27;m happy that we will be getting new commands and command
options to deal with reflogs, because that was one case were users
previously had to muck about within the .git directory, which is a very
bad thing. We need to train users never to look behind the curtain!
Michael
--
Michael Hag
On 07/08/2015 07:11 PM, Junio C Hamano wrote:
> Michael Haggerty writes:
>
>> I think your v7 of this patch goes too far, by turning a failure to
>> write to the reflog into a failure of the whole transaction. The problem
>> is that this failure comes too late, in
n the refs code needs to hold a
>> files-backend transaction for HEAD, which it will commit immediately
>> after the other transaction succeeds. We can stick a pointer to the
>> extra transaction in the generic struct ref_transaction, which (as
>> Michael Haggerty suggests) sp
Sometimes linked working trees were called "linked working
directories" or "linked worktrees". Always refer to them as "linked
working trees" for consistency.
Signed-off-by: Michael Haggerty
---
Documentation/git-worktree.txt | 10 +-
Documentation
The manpage referred to file "lock" in a couple of places. The file is
actually called "locked".
Signed-off-by: Michael Haggerty
---
Documentation/git-worktree.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-worktree.txt
Signed-off-by: Michael Haggerty
---
Documentation/git-worktree.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index c8dd0e5..707dfd0 100644
--- a/Documentation/git-worktree.txt
+++ b/Documentation/git
So remove it from the "BUGS" section.
Signed-off-by: Michael Haggerty
---
Documentation/git-worktree.txt | 2 --
1 file changed, 2 deletions(-)
diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt
index 6cb3877..d5aeda0 100644
--- a/Documentation/git-worktree
Signed-off-by: Michael Haggerty
---
Documentation/config.txt | 8
Documentation/git-worktree.txt | 2 +-
Documentation/gitrepository-layout.txt | 18 +-
3 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/Documentation/config.txt b
The latter doesn't exist.
Signed-off-by: Michael Haggerty
---
Documentation/config.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 3e37b93..7f65dbb 100644
--- a/Documentation/config.txt
+++ b/Document
ncies in the documentation. The last patch
contains some wordsmithing. Feel free to squash them together if you
prefer.
This patch series is also available from my GitHub account [1] as
branch "worktree-docs".
[1] https://github.com/mhagger/git
Michael Haggerty (6):
worktree: consis
config manpage. Similarly
for the other expiration grace time settings.
But it's definitely not a blocker.
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
error("Trying to write non-commit object %s to branch %s",
> - sha1_to_hex(sha1), lock->ref_name);
> + strbuf_addf(err,
> + "Trying to write non-commit object %s to branch %s",
> + sha1_to_hex(sha1), lock->ref_name);
> unlock_ref(lock);
> errno = EINVAL;
> return -1;
> [...]
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
g. "`git reflog delete
> master@{2}`"). This subcommand is also typically not used directly by
> end users.
>
> +The "exists" subcommand checks whether a ref has a reflog. It exists
The second "exists" should be "exits".
> +with zero status i
t;git tag -d tag_with_reflog" &&
> + git tag --create-reflog tag_with_reflog &&
> + git reflog exists refs/tags/tag_with_reflog
> +'
> +
> +test_expect_success '--create-reflog does not creates reflog on failure' '
s/creates
ing to pseudorefs. It just does reflog stuff.
>
> In addition, this version removes the over-aggressive die() on reflog
> update failure from v7. It adds the REF_FORCE_CREATE_REFLOG flag, as
> Michael Haggerty suggested. And it fixes commit message or two, as
> suggested. I bel
k->orig_ref_name, lock->old_oid.hash, sha1,
> logmsg, err) < 0)) {
> + char *old_msg = strbuf_detach(err, NULL);
> + strbuf_addf(err, "Cannot update the ref '%s': '%s'",
> + lock->ref_name, old_msg);
The above
y: David Turner
> [...]
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
101 - 200 of 3206 matches
Mail list logo