ForkInBrain · 2022-08-14 04:37
In my git tree I have a commit 3a3fbf96ce at HEAD. From the command line I can create a patch for just that commit as follows:
`$ git format-patch "3a3fbf96ce^"`
or even:
`$ git format-patch "HEAD^"`
I can't for the life of me figure out how to do this in Magit UI.
When I Meta-Space on the one commit it gets highlighted, but W c still prompts me for a revision and I don't know what to type at that point (3a3fbf96ce\^ doesn't work, unlike the command line).
Note that W c does a great job creating multiple patches from a selected range of revisions. It is this "single commit" patch workflow that I can't figure out.
I'm running Magit 20220722.345 \[>= 3.3.0-git\], Git 2.35.1, Emacs 29.0.50, gnu/linux
lebensterben · 2022-08-14 04:46
magit-patch
unixbhaskar · 2022-08-14 05:03
Use....... magit-patch-create or magit-patch-save
yurikhan · 2022-08-14 07:58
Entering `HEAD` on the `W c c` prompt works for me. (In this case, you point to the commit whose patch you want, not the commit since which you want patches.)
(I agree that it should just take the single commit at point and either offer that as default or just process it without prompting.)
ForkInBrain · 2022-08-14 16:51
I have suggested the improvement that magit support single-revision selections before "W c" here: https://github.com/magit/magit/discussions/4734
Thanks for the explanation, that makes sense. I think I was in part confused by the difference between how magit treated a "format patch" revision range and how the git command line does it.