Re: [Bug] Rebase from worktree subdir is broken (was Re: [PATCH v5 07/11] rebase: do not attempt to remove startup_info->original_cwd)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 25, 2022 at 5:15 PM Glen Choo <chooglen@xxxxxxxxxx> wrote:
>
> Elijah Newren <newren@xxxxxxxxx> writes:
>
> > On Tue, Jan 25, 2022 at 4:39 PM Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> >>
> >> On Tue, Jan 25, 2022 at 7:32 PM Eric Sunshine <sunshine@xxxxxxxxxxxxxx> wrote:
> >> > On Tue, Jan 25, 2022 at 6:59 PM Elijah Newren <newren@xxxxxxxxx> wrote:
> >> > > On Tue, Jan 25, 2022 at 12:27 PM Glen Choo <chooglen@xxxxxxxxxx> wrote:
> >> > > > +test_expect_success 'rebase when inside worktree subdirectory' '
> >> > > > +       git init main-wt &&
> >> > > > +       (
> >> > > > +               cd main-wt &&
> >> > > > +               git commit --allow-empty -m "initial" &&
> >> > > > +               # create commit with foo/bar/baz
> >> > > > +               mkdir -p foo/bar &&
> >> > > > +               touch foo/bar/baz &&
> >> > > > +               git add foo/bar/baz &&
> >> > > > +               git commit -m "add foo/bar/baz" &&
> >> > > > +               # create commit with a/b/c
> >> > > > +               mkdir -p a/b &&
> >> > > > +               touch a/b/c &&
> >> > > > +               git add a/b/c &&
> >> > > > +               git commit -m "add a/b/c" &&
> >> >
> >> > This is entirely minor, but all the inner subshells in this test are
> >> > superfluous. [...]
> >>
> >> One other minor comment: If the file's timestamp has no significance
> >> to the test, then our style is to create the file with `>` rather than
> >> `touch`, so:
> >>
> >>     ... &&
> >>     >foo/bar/baz &&
> >>     ...
> >>     >a/b/c &&
> >>     ...
> >
> > Ah, good point.  And while at it, we can replace the touch/add/commit
> > sequence with a simple test_commit call.
>
> Yes, thanks for pointing that out - I had copied my reproduction script
> into the test case without paying enough attention.

To be honest, it's the kind of thing others have reminded me of dozens
of times.  In fact, although I read your testcase, it didn't even
occur to me until Eric brought up ">" instead of "touch" (which was
something else I had been reminded of dozens of times before
learning).

To me, it's all small potatoes compared to coming up with a good
reproducible testcase; that was the hard work, and you did that.  You
even found a fix and called out the right things in the review for
others to look at.  So, it's all good.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux