All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
Cc: tools@linux.kernel.org, users@linux.kernel.org
Subject: Re: b4: introducing b4 shazam (like b4 am -o- | git am)
Date: Tue, 19 Oct 2021 09:49:57 -0500	[thread overview]
Message-ID: <CAL_JsqK0+f_QPiYr6hv1dVoNT7qJspmjDW6hg0HUcfctpTo22Q@mail.gmail.com> (raw)
In-Reply-To: <20210921202526.mk2meetobbtl3tvi@meerkat.local>

On Tue, Sep 21, 2021 at 3:25 PM Konstantin Ryabitsev
<konstantin@linuxfoundation.org> wrote:
>
> Hi, all:
>
> The current master branch landed a new feature that implements a new
> subcommand "shazam". It is the functional equivalent of piping "b4 am" to "git
> am", with some extra safety padding.
>
> See "b4 shazam --help" to see the available options. You will notice that many
> of them are exactly the same as for "b4 am".
>
> The default operation still tries to be the safest possible:
>
> - we'll create a temporary sparse worktree that will only contain the files
>   being modified
> - we'll use the base-commit sha, if we find it, or we'll try to guess the base
>   commit from git index info
> - we'll run "git am" against that temporary worktree
> - if successful, we'll fetch from the worktree into your current repo and
>   delete the temporary sparse checkout
> - you can then "git checkout -b foo FETCH_HEAD" or "git merge FETCH_HEAD"
>   or "git rebase" as necessary

I get a splat due to my multiple worktree setup:

Fetching into FETCH_HEAD
Traceback (most recent call last):
  File "/home/rob/.local/bin/b4", line 33, in <module>
    sys.exit(load_entry_point('b4', 'console_scripts', 'b4')())
  File "/home/rob/proj/git/b4/b4/command.py", line 264, in cmd
    cmdargs.func(cmdargs)
  File "/home/rob/proj/git/b4/b4/command.py", line 76, in cmd_shazam
    b4.mbox.main(cmdargs)
  File "/home/rob/proj/git/b4/b4/mbox.py", line 721, in main
    make_am(msgs, cmdargs, msgid)
  File "/home/rob/proj/git/b4/b4/mbox.py", line 312, in make_am
    with open(fhf, 'r') as fhh:
NotADirectoryError: [Errno 20] Not a directory:
'/home/rob/proj/git/linux-dt/.git/FETCH_HEAD'

I just sent a patch to fix it.

>
> Alternatively, if you run "git shazam -A", we'll just run "git am" on the
> current HEAD, which is the exact equivalent of "b4 am -o- | git am".

'-A' worked fine. Can we make this a configuration value with
enable/disable override instead? I kind of expect users will use this
mostly one way or the other rather than decide per patch series. Sure,
I could wrap that in a script, but so could I with "b4 am -o- | git
am".

Rob

  parent reply	other threads:[~2021-10-19 14:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-21 20:25 b4: introducing b4 shazam (like b4 am -o- | git am) Konstantin Ryabitsev
2021-09-22 17:38 ` Jason Gunthorpe
2021-09-22 18:21   ` Konstantin Ryabitsev
2021-09-28 17:46     ` Jason Gunthorpe
2021-09-29 21:18       ` Konstantin Ryabitsev
2021-09-29 23:30         ` Jason Gunthorpe
2021-09-30 14:45           ` Konstantin Ryabitsev
2021-10-01 16:20         ` Mark Brown
2021-09-23  8:51 ` Geert Uytterhoeven
2021-09-24 21:08   ` Konstantin Ryabitsev
2021-09-28 18:22     ` Geert Uytterhoeven
2021-09-29 13:39       ` Rob Herring
2021-09-29 17:54         ` Geert Uytterhoeven
2021-09-29 18:07         ` Jason Gunthorpe
2021-09-29 14:27       ` Konstantin Ryabitsev
2021-10-19 14:49 ` Rob Herring [this message]
2021-10-19 16:30   ` Konstantin Ryabitsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAL_JsqK0+f_QPiYr6hv1dVoNT7qJspmjDW6hg0HUcfctpTo22Q@mail.gmail.com \
    --to=robh@kernel.org \
    --cc=konstantin@linuxfoundation.org \
    --cc=tools@linux.kernel.org \
    --cc=users@linux.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.