Skip to contentSkip to conversation

Why "git send-email -M -1" in our contributing instructions?

DISCUSSION Michael Opdenacker 3 participants 8 messages Nov 12, 2021 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,

I've just sent a patch to the bitbake-devel and docs mailing lists using "git send-email -M -1", strictly following the contribution instructions.

However, my e-mail got sent twice. What's this "-M -1" option? I can't find it in the manual of "git send-email", and I had done without it so far.

I wonder if we could remove it from our guidelines for sending patches with "git send-email"...

Thanks in advance
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#1 lore raw

git send-email inherits all options from git format-patch. Yes it's annoying.

-M[<n>], --find-renames[=<n>]
Detect renames. If n is specified, it is a threshold on the
similarity index (i.e. amount of addition/deletions compared to the file’s size). For example, -M90% means Git should consider a delete/add pair to be a rename
if more than 90% of the file hasn’t changed. Without a % sign,
the number is to be read as a fraction, with a decimal point before it. I.e., -M5 becomes 0.5, and is thus the same as -M50%. Similarly, -M05 is the same as
-M5%. To limit detection to exact renames, use -M100%. The
default similarity index is 50%.

Alex

Quoted 32 lines · Michael Opdenacker

Hi,

I've just sent a patch to the bitbake-devel and docs mailing lists using "git send-email -M -1", strictly following the contribution instructions.

However, my e-mail got sent twice. What's this "-M -1" option? I can't find it in the manual of "git send-email", and I had done without it so far.

I wonder if we could remove it from our guidelines for sending patches with "git send-email"...

Thanks in advance
Michael.

--
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#2140):
https://lists.yoctoproject.org/g/docs/message/2140
Mute This Topic: https://lists.yoctoproject.org/mt/87010850/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/docs/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

No. You need to specify what commit(s) you want to sent, '-1' means 'one latest commit'. And that in itself won't send things twice, there's something else in your local setup.

Alex

Quoted 44 lines · Michael Opdenacker

Hi Alex,

Quoted 2 lines · Alexander Kanavin

git send-email inherits all options from git format-patch. Yes it's annoying.

Got it, I missed this sentence in git send-email's documentation: "any format accepted by git-format-patch[1]
<https://git-scm.com/docs/git-format-patch> can be passed to git send-email."

Quoted 12 lines

-M[<n>], --find-renames[=<n>]
Detect renames. If n is specified, it is a threshold on the
similarity index (i.e. amount of addition/deletions compared to the file’s size). For example, -M90% means Git should consider a delete/add pair to be a rename
if more than 90% of the file hasn’t changed. Without a %
sign, the number is to be read as a fraction, with a decimal point before it. I.e., -M5 becomes 0.5, and is thus the same as -M50%. Similarly, -M05 is the same as
-M5%. To limit detection to exact renames, use -M100%. The
default similarity index is 50%.

Actually, I found that "-1" alone (with or without "-M" before) was causing the e-mail to be sent twice. So, if "-1" doesn't apply to "-M", then we probably have the default value for the -M option, and therefore, we could do without "-M" entirely, couldn't we?

At least, we could drop "-1" from our contributing instructions, right?

Thanks for your help!

Michael.

--

Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

#4 lore raw
Quoted 3 lines · Alexander Kanavin

No. You need to specify what commit(s) you want to sent, '-1' means 'one latest commit'. And that in itself won't send things twice, there's something else in your local setup.

It makes sense. Thanks for your help.
Cheers
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#6 lore raw

-M shouldn't be dropped either, as without it there might not be rename detection at all, depending on local configuration.

Alex

Quoted 64 lines · Alexander Kanavin via lists.yoctoproject.org

No. You need to specify what commit(s) you want to sent, '-1' means 'one latest commit'. And that in itself won't send things twice, there's something else in your local setup.

Alex

Quoted 35 lines · Michael Opdenacker

Hi Alex,

Quoted 2 lines · Alexander Kanavin

git send-email inherits all options from git format-patch. Yes it's annoying.

Got it, I missed this sentence in git send-email's documentation: "any format accepted by git-format-patch[1]
<https://git-scm.com/docs/git-format-patch> can be passed to git send-email."

Quoted 12 lines

-M[<n>], --find-renames[=<n>]
Detect renames. If n is specified, it is a threshold on the
similarity index (i.e. amount of addition/deletions compared to the file’s size). For example, -M90% means Git should consider a delete/add pair to be a rename
if more than 90% of the file hasn’t changed. Without a %
sign, the number is to be read as a fraction, with a decimal point before it. I.e., -M5 becomes 0.5, and is thus the same as -M50%. Similarly, -M05 is the same as
-M5%. To limit detection to exact renames, use -M100%. The
default similarity index is 50%.

Actually, I found that "-1" alone (with or without "-M" before) was causing the e-mail to be sent twice. So, if "-1" doesn't apply to "-M", then we probably have the default value for the -M option, and therefore, we could do without "-M" entirely, couldn't we?

At least, we could drop "-1" from our contributing instructions, right?

Thanks for your help!

Quoted 9 lines

Michael.

--

Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#2146):
https://lists.yoctoproject.org/g/docs/message/2146
Mute This Topic: https://lists.yoctoproject.org/mt/87010850/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/docs/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#7 lore raw
In reply to Michael Opdenacker
Quoted 10 lines · Michael Opdenacker

Hi,

I've just sent a patch to the bitbake-devel and docs mailing lists using "git send-email -M -1", strictly following the contribution instructions.

However, my e-mail got sent twice. What's this "-M -1" option? I can't find it in the manual of "git send-email", and I had done without it so far.

I wonder if we could remove it from our guidelines for sending patches with "git send-email"...

It is possible it was confused with git format-patch which we definitely want -M for? I agree we can probably drop it.

Cheers,

Richard

#8 lore raw

There's no confusion. 'format-patch' writes a patch to disk, send-email formats a patch in the same way with the same options and sends it over email. We want rename detection in both.

Alex

Quoted 33 lines · Richard Purdie
Quoted 7 lines · Michael Opdenacker

Hi,

I've just sent a patch to the bitbake-devel and docs mailing lists using "git send-email -M -1", strictly following the contribution instructions.

However, my e-mail got sent twice. What's this "-M -1" option? I can't find it in the manual of "git send-email", and I had done without it so

far.

Quoted 3 lines

I wonder if we could remove it from our guidelines for sending patches with "git send-email"...

It is possible it was confused with git format-patch which we definitely want -M
for? I agree we can probably drop it.

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#2142):
https://lists.yoctoproject.org/g/docs/message/2142
Mute This Topic: https://lists.yoctoproject.org/mt/87010850/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/docs/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#9 lore raw
Quoted 3 lines · Alexander Kanavin

There's no confusion. 'format-patch' writes a patch to disk, send-email formats a patch in the same way with the same options and sends it over email. We want rename detection in both.

I usually write to disk with format-patch, edit and then send. I'd forgotten the send-email options are piped to format-patch...

Cheers,

Richard