~sircmpwn/sr.ht-discuss

5 5

Git-send-mail for maintainers?

Details
Message ID
<166928113263.8.9119854440983931590.78477745@ploum.eu>
DKIM signature
pass
Download raw message
Hello,

I do really appreciate the git-send-mail workflow.

As a maintainer, when I receive a patch, I need to :

1. Go to the project folder
2. Ensure that there’s no uncommited changes (very important)
3. open neomutt in that folder
4. Type |git am  when viewing the mail.

Really efficient, I like it.

But what if, after applying it, I realize the patch is not perfect? I’m
currently fiddling a bit with git reset (never sure if I should do a
--soft or --hard).

What’s your maintainer workflow with git-send-mail?

Could it be added to the git-send-mail.io website?

Thanks !
--
Ploum - Lionel Dricot
Blog: https://www.ploum.net — Livres: https://ploum.net/livres
Gemini : gemini://rawtext.club/~ploum/
Rene Kita <mail@rkta.de>
Details
Message ID
<Y385/VTG4MLBBpiB@t480>
In-Reply-To
<166928113263.8.9119854440983931590.78477745@ploum.eu> (view parent)
DKIM signature
missing
Download raw message
On Thu, Nov 24, 2022 at 09:12:07AM +0000, sourcehut@ploum.eu wrote:
> Hello,

Hi!

[...]

> But what if, after applying it, I realize the patch is not perfect? I’m
> currently fiddling a bit with git reset (never sure if I should do a
> --soft or --hard).

Until you feel more comfortable with git, you can create a new branch
before applying patches. This way you can just delete the branch if you
don't want the changes. If you decide to keep them, merging back will be
a fast-forward merge and the patches are just applied - there will no
trace of this branch in your history.
Details
Message ID
<87cz9cisvd.fsf@bzg.fr>
In-Reply-To
<166928113263.8.9119854440983931590.78477745@ploum.eu> (view parent)
DKIM signature
pass
Download raw message
sourcehut@ploum.eu writes:

> But what if, after applying it, I realize the patch is not perfect? 

You can apply the patch (git apply) vs "commit" the patch (git am).

If it is only applied, the changes appear in the working directory but
are not staged nor committed yet, you can discard them with git reset.

And you can also apply changes on a separate dedicated branch to avoid
mistakes, as already suggested.

HTH,

-- 
 Bastien
Details
Message ID
<9sc347oVpyp4p9cUCH1fEBsgbjBPszIW-cvYhNGgmkOZEFjgeD6di8QwP_P8ApFJZUqEBGIRSGZSksc4Djcfq6uns9PWHV5fOGvTSZSc7dw=@emersion.fr>
In-Reply-To
<166928113263.8.9119854440983931590.78477745@ploum.eu> (view parent)
DKIM signature
pass
Download raw message
I usually use `git commit --amend` and `git rebase -i` to edit patches.
Details
Message ID
<166928385721.7.18148672535174667792.78484688@ploum.eu>
In-Reply-To
<87cz9cisvd.fsf@bzg.fr> (view parent)
DKIM signature
pass
Download raw message
On 22/11/24 10:50, Bastien - bzg at gnu.org wrote:
>sourcehut@ploum.eu writes:
>
>> But what if, after applying it, I realize the patch is not perfect?
>
>You can apply the patch (git apply) vs "commit" the patch (git am).
>
>If it is only applied, the changes appear in the working directory but
>are not staged nor committed yet, you can discard them with git reset.

Thanks a lot. The apply command is exactly what I was looking for.

I guess that I could :

1. Apply
2. Reset
3. Am  (to keep the original author as the commiter instead of commiting
myself after apply)

That looks quite an easy workflow for small patches.

>
>And you can also apply changes on a separate dedicated branch to avoid
>mistakes, as already suggested.

Yeah, I thought about the branches but I find it a bit overkill for
small patches.
Details
Message ID
<b2e3c52c-9c34-6725-6449-624542b63451@bitfehler.net>
In-Reply-To
<166928113263.8.9119854440983931590.78477745@ploum.eu> (view parent)
DKIM signature
pass
Download raw message
Hi,

On 11/24/22 10:12, sourcehut@ploum.eu wrote:
> What’s your maintainer workflow with git-send-mail?

Probably relevant:

https://drewdevault.com/2022/07/25/Code-review-with-aerc.html

And since you asked: I wrote and use this:

https://crates.io/crates/vmt

See the second screencast in there for the "apply patch" flow. The idea 
is to be less of an email reader. Be aware, though: the whole thing is 
somewhat of a construction site atm. It should work, but things might 
change drastically in new versions. Happy to help with any questions you 
might have.

Cheers, Conrad
Reply to thread Export thread (mbox)