Bug 217393 - b4 shazam in a subdir
Summary: b4 shazam in a subdir
Status: RESOLVED CODE_FIX
Alias: None
Product: Tools
Classification: Unclassified
Component: Infra (show other bugs)
Hardware: All Linux
: P3 normal
Assignee: Konstantin Ryabitsev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-02 17:18 UTC by Bugbot
Modified: 2023-06-22 20:21 UTC (History)
0 users

See Also:
Kernel Version:
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Bugbot 2023-05-02 17:18:33 UTC
Andrew Cooper <andrew.cooper3@citrix.com> writes:

Hello,

When using b4 shazam in a subdir of a git repository, you end up with
the patch(es) applied correctly, but also the diff structure expanded
under the current dir, and the working tree dirty back to the state
prior to applying the patch(es).

Running from the root of the repo leaves everything in order, but it
would be great if b4 wasn't sensitive to $CWD inside a repository.

Thanks,

~Andrew

(via https://msgid.link/4e4757cf-7351-9aff-fada-2b03ff82b2dc@citrix.com)
Comment 1 Bugbot 2023-05-02 17:18:38 UTC
Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:

On Tue, May 02, 2023 at 06:06:15PM +0100, Andrew Cooper wrote:
> Hello,
> 
> When using b4 shazam in a subdir of a git repository, you end up with
> the patch(es) applied correctly, but also the diff structure expanded
> under the current dir, and the working tree dirty back to the state
> prior to applying the patch(es).
> 
> Running from the root of the repo leaves everything in order, but it
> would be great if b4 wasn't sensitive to $CWD inside a repository.

Thanks for the report.

bugbot assign to me

-K

(via https://msgid.link/20230502-piper-tulane-log-af0fee@meerkat)
Comment 2 Bugbot 2023-06-22 20:20:58 UTC
Konstantin Ryabitsev writes in commit 73291165599839de9a2dcf4986c35a2041b22d09:

shazam: switch to top of git tree before running git-am

According to reports, running "git am" when not at the top of the tree
can result in the dirty tree state (see linked conversation). This
ensures that we switch back to the top of the git tree before running
"git am" and then switch back.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Link: https://msgid.link/4e4757cf-7351-9aff-fada-2b03ff82b2dc@citrix.com
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217393
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>

(via https://git.kernel.org/pub/scm/utils/b4/b4.git/commit/?id=732911655998)

Note You need to log in before you can comment on or make changes to this bug.