Re: BUG: attempt to trim too many characters
On Tue, Sep 12, 2017 at 09:29:49PM -0700, Linus Torvalds wrote: > Just reminding people that this issue would seem to still exist in > current master.. Yeah, the fix is in 1d0538e4860, but it's still working it's way up through the integration branches. -Peff
Re: BUG: attempt to trim too many characters
Just reminding people that this issue would seem to still exist in current master.. It's trivial to show: [torvalds@i7 git]$ git bisect start [torvalds@i7 git]$ git bisect bad master [torvalds@i7 git]$ git bisect good master~5 Bisecting: 23 revisions left to test after this (roughly 5 steps) [f35a1d75b5ecefaef7b1a8ec55543c82883df82f] Merge branch 'rs/t3700-clean-leftover' into maint [torvalds@i7 git]$ git rev-parse --bisect fatal: BUG: attempt to trim too many characters (Note: I use "git rev-parse --bisect" to show it as an error on the command line, but normal people would obviously do "gitk --bisect" that then does that "git rev-parse" internally and shows a UI error box instead). Linus On Tue, Sep 5, 2017 at 3:03 PM, Jeff King wrote: > On Tue, Sep 05, 2017 at 02:55:08PM -0700, Linus Torvalds wrote: > >> On Tue, Sep 5, 2017 at 2:50 PM, Jeff King wrote: >> > >> > What version of git are you running? This should be fixed by 03df567fbf >> > (for_each_bisect_ref(): don't trim refnames, 2017-06-18) which is in >> > v2.14. >> >> I'm way more recent than 2.14. >> >> I'm at commit 238e487ea ("The fifth batch post 2.14") > > Ugh. Bitten again by the fact that rev-parse and revision.c implement > the same things in subtly different ways. > > This probably fixes it: > > diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c > index 2bd28d3c08..9f24004c0a 100644 > --- a/builtin/rev-parse.c > +++ b/builtin/rev-parse.c > @@ -757,8 +757,8 @@ int cmd_rev_parse(int argc, const char **argv, const char > *prefix) > continue; > } > if (!strcmp(arg, "--bisect")) { > - for_each_ref_in("refs/bisect/bad", > show_reference, NULL); > - for_each_ref_in("refs/bisect/good", > anti_reference, NULL); > + for_each_fullref_in("refs/bisect/bad", > show_reference, NULL, 0); > + for_each_fullref_in("refs/bisect/good", > anti_reference, NULL, 0); > continue; > } > if (opt_with_value(arg, "--branches", &arg)) {
Re: BUG: attempt to trim too many characters
On Tue, Sep 5, 2017 at 3:03 PM, Jeff King wrote: > > This probably fixes it: Yup. Thanks. Linus
Re: BUG: attempt to trim too many characters
On Tue, Sep 05, 2017 at 02:55:08PM -0700, Linus Torvalds wrote: > On Tue, Sep 5, 2017 at 2:50 PM, Jeff King wrote: > > > > What version of git are you running? This should be fixed by 03df567fbf > > (for_each_bisect_ref(): don't trim refnames, 2017-06-18) which is in > > v2.14. > > I'm way more recent than 2.14. > > I'm at commit 238e487ea ("The fifth batch post 2.14") Ugh. Bitten again by the fact that rev-parse and revision.c implement the same things in subtly different ways. This probably fixes it: diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c index 2bd28d3c08..9f24004c0a 100644 --- a/builtin/rev-parse.c +++ b/builtin/rev-parse.c @@ -757,8 +757,8 @@ int cmd_rev_parse(int argc, const char **argv, const char *prefix) continue; } if (!strcmp(arg, "--bisect")) { - for_each_ref_in("refs/bisect/bad", show_reference, NULL); - for_each_ref_in("refs/bisect/good", anti_reference, NULL); + for_each_fullref_in("refs/bisect/bad", show_reference, NULL, 0); + for_each_fullref_in("refs/bisect/good", anti_reference, NULL, 0); continue; } if (opt_with_value(arg, "--branches", &arg)) {
Re: BUG: attempt to trim too many characters
On Tue, Sep 5, 2017 at 2:50 PM, Jeff King wrote: > > What version of git are you running? This should be fixed by 03df567fbf > (for_each_bisect_ref(): don't trim refnames, 2017-06-18) which is in > v2.14. I'm way more recent than 2.14. I'm at commit 238e487ea ("The fifth batch post 2.14") Linus
Re: BUG: attempt to trim too many characters
On Tue, Sep 05, 2017 at 02:39:05PM -0700, Linus Torvalds wrote: > I just got this with > >gitk --bisect > > while doing some bisection on my current kernel. > > It happens with "git rev-parse --bisect" too, but interestingly, "git > log --bisect" works fine. > > I have not tried to figure out anything further, except that it was > introduced by commit b9c8e7f2f ("prefix_ref_iterator: don't trim too > much") and it happens with > >iter->iter0->refname = "refs/bisect/bad" >iter->trim = 15 > > (where 15 is also the same as the length of that refname). > > Not having time to chase this down any more, since I'm busy with the > merge window (and that annoying bisect) What version of git are you running? This should be fixed by 03df567fbf (for_each_bisect_ref(): don't trim refnames, 2017-06-18) which is in v2.14. More discussion at https://public-inbox.org/git/cover.1497792827.git.mhag...@alum.mit.edu/ -Peff