# getting git send-email patches from someone who is behind

3 messages from 2023-12-08 to 2023-12-08. Participants: Sandra Snan, Konstantin Ryabitsev.
Thread: https://gitlist.dev/t/60596

## Sandra Snan, 2023-12-08 17:50

Subject: getting git send-email patches from someone who is behind
Message-ID: <87h6ksk2hk.fsf@ellen.idiomdrottning.org>
URL: https://gitlist.dev/e/87h6ksk2hk.fsf%40ellen.idiomdrottning.org

```
I have a li'l git send-email question. Someone sent me a patch set 
of six patches today but they were not on most current main. I had 
to guess what version they were sending to so I could git am when 
I was on that particular version. I managed to sort it all out so 
this question is more for future reference.

Isn't there a way inside of the emails that it can show what 
version to apply the patches to?

Because now I was like "OK, I remember talking to them the other 
day and that means they probably are on what for me is HEAD^^" and 
that turned out to be correct, and sorting out the conflicts was 
also easy enough,
but if I hadn't talked to them beforehand I would've been 
completely lost.

I asked another friend about it and he said:

> it's possible to record the base commit: 
> https://git-scm.com/docs/git-format-patch#_base_tree_information
> however, it's a bit finicky to do with git-send-email

I dunno.

I get that one of the fun parts about using patches instead of PRs 
is
that you can be a li'l more loosey goosey about exactly what 
commit
something is supposed to belong to but here I would've been 
completely
lost because the patchset just borked horribly right from the 
first patch.

If others have run into this, what's the solution?

```

## Konstantin Ryabitsev, 2023-12-08 18:49

Subject: Re: getting git send-email patches from someone who is behind
Message-ID: <20231208-amusing-vengeful-raptor-e71a8b@meerkat>
URL: https://gitlist.dev/e/20231208-amusing-vengeful-raptor-e71a8b%40meerkat
In-Reply-To: <87h6ksk2hk.fsf@ellen.idiomdrottning.org>

```
On Fri, Dec 08, 2023 at 06:50:31PM +0100, Sandra Snan wrote:
> I have a li'l git send-email question. Someone sent me a patch set of six
> patches today but they were not on most current main. I had to guess what
> version they were sending to so I could git am when I was on that particular
> version. I managed to sort it all out so this question is more for future
> reference.
> 
> Isn't there a way inside of the emails that it can show what version to
> apply the patches to?
> 
> Because now I was like "OK, I remember talking to them the other day and
> that means they probably are on what for me is HEAD^^" and that turned out
> to be correct, and sorting out the conflicts was also easy enough,
> but if I hadn't talked to them beforehand I would've been completely lost.
> 
> I asked another friend about it and he said:
> 
> > it's possible to record the base commit:
> > https://git-scm.com/docs/git-format-patch#_base_tree_information
> > however, it's a bit finicky to do with git-send-email
> 
> I dunno.
> 
> I get that one of the fun parts about using patches instead of PRs is
> that you can be a li'l more loosey goosey about exactly what commit
> something is supposed to belong to but here I would've been completely
> lost because the patchset just borked horribly right from the first patch.
> 
> If others have run into this, what's the solution?

Yes, setting base-commit is the right solution here -- it will tell you
exactly where in the tree it belongs. In its absence, tools like b4 will also
try to guess where the series might belong by comparing the file index
information mentioned in the patches. It's a clever, but not exact process,
because the patch may depend on changes in the files that aren't being
modified.

In general, having a base-commit: line in the cover letter or first patch is
absolutely the right way to go.

-K

```

## Sandra Snan, 2023-12-08 18:57

Subject: Re: getting git send-email patches from someone who is behind
Message-ID: <87a5qkjzdu.fsf@ellen.idiomdrottning.org>
URL: https://gitlist.dev/e/87a5qkjzdu.fsf%40ellen.idiomdrottning.org
In-Reply-To: <20231208-amusing-vengeful-raptor-e71a8b@meerkat>

```
Konstantin Ryabitsev <konstantin@linuxfoundation.org> writes:
> Yes, setting base-commit is the right solution here -- it will 
> tell you exactly where in the tree it belongs.

I didn't know that before today and that's good advice when 
sending patches, but if I'm receiving patches without that field 
set, I wonder how people are dealing with that.

> In its absence, tools like b4 will also try to guess where the 
> series might belong by comparing the file index information 
> mentioned in the patches.

Ah, this! https://b4.docs.kernel.org/en/latest/

This looks wonderful, thank you!

```
