* [PATCH] t1400: fix --no-create-reflog test and description
@ 2024-10-20 16:12 kristofferhaugsbakk
2024-10-21 12:08 ` Patrick Steinhardt
2024-11-07 12:11 ` Kristoffer Haugsbakk
0 siblings, 2 replies; 8+ messages in thread
From: kristofferhaugsbakk @ 2024-10-20 16:12 UTC (permalink / raw)
To: git; +Cc: Kristoffer Haugsbakk
From: Kristoffer Haugsbakk <code@khaugsbakk.name>
This test has had the wrong title since it was created.[1] Use `always`
like the description says and negate the expected outcome.
The test works since `core.logAllRefUpdates` set to `true` does not
create a reflog for that ref namespace. So the test is testing the
config variable, not the option.
The test itself is fine and does not hide a bug: `--no-create-reflog` is
not supposed to override `core.logAllRefUpdates`.
† 1: 341fb286212 (refs: add option core.logAllRefUpdates = always,
2017-01-27)
Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
---
Notes (series):
From the commit message:
“ The test itself is fine and does not hide a bug:
`--no-create-reflog` is not supposed to override
A source for that: roundabout through git-branch(1):
“ The negated form --no-create-reflog only overrides an earlier
--create-reflog, but currently does not negate the setting of
core.logAllRefUpdates.
I *suppose* that the same applies to update-ref since (I suppose) they
use the same underlying machinery.
See also git-tag(1) which says the same thing.
update-ref should document the same thing, then. I have that marked as
a todo item. The changes there are a bit too involved to implicate in
this submission.
t/t1400-update-ref.sh | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh
index eb1691860da..9bf87db4775 100755
--- a/t/t1400-update-ref.sh
+++ b/t/t1400-update-ref.sh
@@ -169,14 +169,14 @@ test_expect_success 'core.logAllRefUpdates=always creates reflog for ORIG_HEAD'
git reflog exists ORIG_HEAD
'
-test_expect_success '--no-create-reflog overrides core.logAllRefUpdates=always' '
- test_config core.logAllRefUpdates true &&
+test_expect_success '--no-create-reflog does not override core.logAllRefUpdates=always' '
+ test_config core.logAllRefUpdates always &&
test_when_finished "git update-ref -d $outside" &&
git update-ref --no-create-reflog $outside $A &&
git rev-parse $A >expect &&
git rev-parse $outside >actual &&
test_cmp expect actual &&
- test_must_fail git reflog exists $outside
+ git reflog exists $outside
'
test_expect_success "create $m (by HEAD)" '
base-commit: 34b6ce9b30747131b6e781ff718a45328aa887d0
--
2.46.1.641.g54e7913fcb6
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] t1400: fix --no-create-reflog test and description
2024-10-20 16:12 [PATCH] t1400: fix --no-create-reflog test and description kristofferhaugsbakk
@ 2024-10-21 12:08 ` Patrick Steinhardt
2024-10-21 16:48 ` Kristoffer Haugsbakk
2024-11-07 12:11 ` Kristoffer Haugsbakk
1 sibling, 1 reply; 8+ messages in thread
From: Patrick Steinhardt @ 2024-10-21 12:08 UTC (permalink / raw)
To: kristofferhaugsbakk; +Cc: git, Kristoffer Haugsbakk
On Sun, Oct 20, 2024 at 06:12:03PM +0200, kristofferhaugsbakk@fastmail.com wrote:
> From: Kristoffer Haugsbakk <code@khaugsbakk.name>
>
> This test has had the wrong title since it was created.[1] Use `always`
> like the description says and negate the expected outcome.
>
> The test works since `core.logAllRefUpdates` set to `true` does not
> create a reflog for that ref namespace. So the test is testing the
> config variable, not the option.
>
> The test itself is fine and does not hide a bug: `--no-create-reflog` is
> not supposed to override `core.logAllRefUpdates`.
That's actually surprising to me, as command line options tend to
override configuration.
> † 1: 341fb286212 (refs: add option core.logAllRefUpdates = always,
> 2017-01-27)
>
> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name>
> ---
>
> Notes (series):
> From the commit message:
>
> “ The test itself is fine and does not hide a bug:
> `--no-create-reflog` is not supposed to override
>
> A source for that: roundabout through git-branch(1):
>
> “ The negated form --no-create-reflog only overrides an earlier
> --create-reflog, but currently does not negate the setting of
> core.logAllRefUpdates.
Hm. The "currently" reads as if this was a known shortcoming rather than
by design.
> I *suppose* that the same applies to update-ref since (I suppose) they
> use the same underlying machinery.
>
> See also git-tag(1) which says the same thing.
>
> update-ref should document the same thing, then. I have that marked as
> a todo item. The changes there are a bit too involved to implicate in
> this submission.
So I'm quite torn here. It's documented, even though the documentation
doesn't exactly feel like this was designed, but rather like it was a
side effect. The test also contradicts the documentation, even though it
only worked by chance. And as mentioned above, everywhere else we
typically have a design where the command line option overrides the
config.
Overall I'm rather leaning into the direction of making this work
properly. But that would of course be a backwards-incompatible change.
Patrick
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] t1400: fix --no-create-reflog test and description
2024-10-21 12:08 ` Patrick Steinhardt
@ 2024-10-21 16:48 ` Kristoffer Haugsbakk
2024-10-21 19:02 ` Taylor Blau
0 siblings, 1 reply; 8+ messages in thread
From: Kristoffer Haugsbakk @ 2024-10-21 16:48 UTC (permalink / raw)
To: Patrick Steinhardt; +Cc: git, Kristoffer Haugsbakk
On Mon, Oct 21, 2024, at 14:08, Patrick Steinhardt wrote:
>> […]
>> Notes (series):
>> From the commit message:
>>
>> “ The test itself is fine and does not hide a bug:
>> `--no-create-reflog` is not supposed to override
>>
>> A source for that: roundabout through git-branch(1):
>>
>> “ The negated form --no-create-reflog only overrides an earlier
>> --create-reflog, but currently does not negate the setting of
>> core.logAllRefUpdates.
>
> Hm. The "currently" reads as if this was a known shortcoming rather than
> by design.
I read it as “we might change our minds here—watch out”. ;)
It feels very emphasized. Like the documentation was expecting
your surprise.
>> I *suppose* that the same applies to update-ref since (I suppose) they
>> use the same underlying machinery.
>>
>> See also git-tag(1) which says the same thing.
>>
>> update-ref should document the same thing, then. I have that marked as
>> a todo item. The changes there are a bit too involved to implicate in
>> this submission.
>
> So I'm quite torn here. It's documented, even though the documentation
> doesn't exactly feel like this was designed, but rather like it was a
> side effect. The test also contradicts the documentation, even though it
> only worked by chance. And as mentioned above, everywhere else we
> typically have a design where the command line option overrides the
> config.
>
> Overall I'm rather leaning into the direction of making this work
> properly. But that would of course be a backwards-incompatible change.
Good point. It does feel inconsistent. I agree that the conventional
pattern (to my knowledge) is to have options override config when the
options are given.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] t1400: fix --no-create-reflog test and description
2024-10-21 16:48 ` Kristoffer Haugsbakk
@ 2024-10-21 19:02 ` Taylor Blau
2024-10-21 21:02 ` Kristoffer Haugsbakk
0 siblings, 1 reply; 8+ messages in thread
From: Taylor Blau @ 2024-10-21 19:02 UTC (permalink / raw)
To: Kristoffer Haugsbakk; +Cc: Patrick Steinhardt, git, Kristoffer Haugsbakk
On Mon, Oct 21, 2024 at 06:48:20PM +0200, Kristoffer Haugsbakk wrote:
> On Mon, Oct 21, 2024, at 14:08, Patrick Steinhardt wrote:
> >> […]
> >> Notes (series):
> >> From the commit message:
> >>
> >> “ The test itself is fine and does not hide a bug:
> >> `--no-create-reflog` is not supposed to override
> >>
> >> A source for that: roundabout through git-branch(1):
> >>
> >> “ The negated form --no-create-reflog only overrides an earlier
> >> --create-reflog, but currently does not negate the setting of
> >> core.logAllRefUpdates.
> >
> > Hm. The "currently" reads as if this was a known shortcoming rather than
> > by design.
>
> I read it as “we might change our minds here—watch out”. ;)
>
> It feels very emphasized. Like the documentation was expecting
> your surprise.
>
> >> I *suppose* that the same applies to update-ref since (I suppose) they
> >> use the same underlying machinery.
> >>
> >> See also git-tag(1) which says the same thing.
> >>
> >> update-ref should document the same thing, then. I have that marked as
> >> a todo item. The changes there are a bit too involved to implicate in
> >> this submission.
> >
> > So I'm quite torn here. It's documented, even though the documentation
> > doesn't exactly feel like this was designed, but rather like it was a
> > side effect. The test also contradicts the documentation, even though it
> > only worked by chance. And as mentioned above, everywhere else we
> > typically have a design where the command line option overrides the
> > config.
> >
> > Overall I'm rather leaning into the direction of making this work
> > properly. But that would of course be a backwards-incompatible change.
>
> Good point. It does feel inconsistent. I agree that the conventional
> pattern (to my knowledge) is to have options override config when the
> options are given.
I agree with you both that it feels inconsistent, but I feel somewhat
uncomfortable changing the behavior here in a backwards incompatible
way.
Even if the original documentation leaves the door open to changing the
behavior, I think that probably a non-zero number of users has either
(a) never read that documentation, or (b) come to rely on it, or (c)
both ;-).
I think if anything we might consider updating the documentation to more
clearly capture the status-quo, but I'd be very hesitant to see a patch
changing the behavior here.
Thanks,
Taylor
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] t1400: fix --no-create-reflog test and description
2024-10-21 19:02 ` Taylor Blau
@ 2024-10-21 21:02 ` Kristoffer Haugsbakk
2024-10-21 21:10 ` Taylor Blau
0 siblings, 1 reply; 8+ messages in thread
From: Kristoffer Haugsbakk @ 2024-10-21 21:02 UTC (permalink / raw)
To: Taylor Blau, Kristoffer Haugsbakk; +Cc: Patrick Steinhardt, git
On Mon, Oct 21, 2024, at 21:02, Taylor Blau wrote:
>> […]
>> > Overall I'm rather leaning into the direction of making this work
>> > properly. But that would of course be a backwards-incompatible change.
>>
>> Good point. It does feel inconsistent. I agree that the conventional
>> pattern (to my knowledge) is to have options override config when the
>> options are given.
Agreed, to be clear. ;)
> I agree with you both that it feels inconsistent, but I feel somewhat
> uncomfortable changing the behavior here in a backwards incompatible
> way.
>
> Even if the original documentation leaves the door open to changing the
> behavior, I think that probably a non-zero number of users has either
> (a) never read that documentation, or (b) come to rely on it, or (c)
> both ;-).
>
> I think if anything we might consider updating the documentation to more
> clearly capture the status-quo, but I'd be very hesitant to see a patch
> changing the behavior here.
My background (how I ended up in this test) was that I learnt yesterday
that `--create-reflog` and this config variable controls whether reflog
files are created. I thought that they toggled when entries were made.
I have some work in progress patches for clarifying this mechanism in
git-config(1) and other places.
Now git-tag(1) and git-branch(1) seem decently clear on this point[1]
but update-ref is lagging behind IMO. I will be looking at that one as
well.
† 1: There is also the `--create-reflog` case vs. when the config is
`false` but I can’t check that right now
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] t1400: fix --no-create-reflog test and description
2024-10-21 21:02 ` Kristoffer Haugsbakk
@ 2024-10-21 21:10 ` Taylor Blau
0 siblings, 0 replies; 8+ messages in thread
From: Taylor Blau @ 2024-10-21 21:10 UTC (permalink / raw)
To: Kristoffer Haugsbakk; +Cc: Patrick Steinhardt, git
On Mon, Oct 21, 2024 at 11:02:48PM +0200, Kristoffer Haugsbakk wrote:
> On Mon, Oct 21, 2024, at 21:02, Taylor Blau wrote:
> >> […]
> >> > Overall I'm rather leaning into the direction of making this work
> >> > properly. But that would of course be a backwards-incompatible change.
> >>
> >> Good point. It does feel inconsistent. I agree that the conventional
> >> pattern (to my knowledge) is to have options override config when the
> >> options are given.
>
> Agreed, to be clear. ;)
;-).
> Now git-tag(1) and git-branch(1) seem decently clear on this point[1]
> but update-ref is lagging behind IMO. I will be looking at that one as
> well.
Thanks very much.
Thanks,
Taylor
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] t1400: fix --no-create-reflog test and description
2024-10-20 16:12 [PATCH] t1400: fix --no-create-reflog test and description kristofferhaugsbakk
2024-10-21 12:08 ` Patrick Steinhardt
@ 2024-11-07 12:11 ` Kristoffer Haugsbakk
2024-11-08 3:13 ` Junio C Hamano
1 sibling, 1 reply; 8+ messages in thread
From: Kristoffer Haugsbakk @ 2024-11-07 12:11 UTC (permalink / raw)
To: Kristoffer Haugsbakk, git; +Cc: Patrick Steinhardt, Taylor Blau
I didn’t get the impression that this is expecting a reroll. But I
haven’t seen it mentioned or applied to `seen`/`next`?
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] t1400: fix --no-create-reflog test and description
2024-11-07 12:11 ` Kristoffer Haugsbakk
@ 2024-11-08 3:13 ` Junio C Hamano
0 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2024-11-08 3:13 UTC (permalink / raw)
To: Kristoffer Haugsbakk
Cc: Kristoffer Haugsbakk, git, Patrick Steinhardt, Taylor Blau
"Kristoffer Haugsbakk" <code@khaugsbakk.name> writes:
> I didn’t get the impression that this is expecting a reroll. But I
> haven’t seen it mentioned or applied to `seen`/`next`?
If the interim maintainer did not think it is ready to be queued to
'seen', I won't go back to the list archive to pick it up (after
all, that is part of trusting interim maintainer is about---otherwise
I have to go back and consume all the list backlog, which does not
make sense).
If a topic is worth resurrecting, do resend it for discussion.
Looking at the archived discussion (for this topic I am making an
exception), I did not get an impression that this got a "yeah this
is a good thing to do" support, only a lukewarm "it may be a
starting point in a good direction".
Thanks.
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-11-08 3:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-20 16:12 [PATCH] t1400: fix --no-create-reflog test and description kristofferhaugsbakk
2024-10-21 12:08 ` Patrick Steinhardt
2024-10-21 16:48 ` Kristoffer Haugsbakk
2024-10-21 19:02 ` Taylor Blau
2024-10-21 21:02 ` Kristoffer Haugsbakk
2024-10-21 21:10 ` Taylor Blau
2024-11-07 12:11 ` Kristoffer Haugsbakk
2024-11-08 3:13 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).