mbox series

[v6,0/3] am: support --empty=(die|drop|keep) option to handle empty patches

Message ID pull.1076.v6.git.1637232636.gitgitgadget@gmail.com (mailing list archive)
Headers show
Series am: support --empty=(die|drop|keep) option to handle empty patches | expand

Message

John Cai via GitGitGadget Nov. 18, 2021, 10:50 a.m. UTC
Since that git has supported the --always option for the git-format-patch
command to create a patch with an empty commit message, git-am should
support applying and committing with empty patches.

----------------------------------------------------------------------------

Changes since v1:

 1. add a case when not passing the --always option.
 2. rename the --always option to --allow-empty.

----------------------------------------------------------------------------

Changes since v2:

 1. rename the --allow-empty option to --empty-commit.
 2. introduce three different strategies (die|skip|asis) when trying to
    record empty patches as empty commits.

----------------------------------------------------------------------------

Changes since v3:

 1. generate the missed file for test cases.
 2. grep -f cannot be used under Mac OS.

----------------------------------------------------------------------------

Changes since v4:

 1. rename the --empty-commit option to --empty.
 2. rename three different strategies (die|skip|asis) to die, drop and keep
    correspondingly.

----------------------------------------------------------------------------

Changes since v5:

 1. throw an error when passing --empty option without value.

----------------------------------------------------------------------------

Aleen (3):
  doc: git-format-patch: describe the option --always
  am: support --empty option to handle empty patches
  am: throw an error when passing --empty option without value

 Documentation/git-am.txt           |  9 ++++
 Documentation/git-format-patch.txt |  6 ++-
 builtin/am.c                       | 49 ++++++++++++++++--
 t/t4150-am.sh                      | 79 ++++++++++++++++++++++++++++++
 4 files changed, 137 insertions(+), 6 deletions(-)


base-commit: b550198c73edd4cc058832dcf74b41aeec2adba2
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-1076%2Faleen42%2Fnext-v6
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-1076/aleen42/next-v6
Pull-Request: https://github.com/gitgitgadget/git/pull/1076

Range-diff vs v5:

 1:  9f1b3dd6d0b = 1:  9f1b3dd6d0b doc: git-format-patch: describe the option --always
 2:  96d8573dc80 = 2:  96d8573dc80 am: support --empty option to handle empty patches
 -:  ----------- > 3:  e907a2b2faa am: throw an error when passing --empty option without value

Comments

Junio C Hamano Nov. 18, 2021, 11:47 p.m. UTC | #1
As per https://git-scm.com/docs/SubmittingPatches#sign-off:

   Please don’t hide your real name.

I suspect your real name is not Aleen, but something with x and w in
it.
Aleen 徐沛文 Nov. 19, 2021, 1:45 a.m. UTC | #2
> -----Original Messages-----From:"Junio C Hamano" <gitster@pobox.com>Sent Time:2021-11-19 07:47:11 (Friday)To:"Aleen via GitGitGadget" <gitgitgadget@gmail.com>Cc:git@vger.kernel.org, "René Scharfe" <l.s.r@web.de>, "Phillip Wood" <phillip.wood123@gmail.com>, "Aleen 徐沛文" <pwxu@coremail.cn>, Aleen <aleen42@vip.qq.com>Subject:Re: [PATCH v6 0/3] am: support --empty=(die|drop|keep) option to handle empty patches
> 
> 
> As per https://git-scm.com/docs/SubmittingPatches#sign-off:
> 
>    Please don’t hide your real name.
> 
> I suspect your real name is not Aleen, but something with x and w in
> it.
>

I have used "Aleen" <aleen42@vip.qq.com> as my GitHub account to send this pull request, but the e-mail service disgusts me that it is slow to send emails to the domain "vger.kernel.org". So I decided to use another mail service to discuss, "Aleen 徐沛文" <pwxu@coremail.cn> as you saw.

In the open-source world, I usually signed off "Aleen" rather than "Aleen 徐沛文", and is that necessary to change?
Aleen 徐沛文 Nov. 19, 2021, 4:16 a.m. UTC | #3
> As per https://git-scm.com/docs/SubmittingPatches#sign-off:
> 
>    Please don’t hide your real name.
> 
> I suspect your real name is not Aleen, but something with x and w in
> it.

BTW, gitgitgadget has defined that developers should sign off the user name
of the GitHub account, and I can't change it at all.
Junio C Hamano Nov. 19, 2021, 5:46 a.m. UTC | #4
Aleen 徐沛文 <pwxu@coremail.cn> writes:

>> As per https://git-scm.com/docs/SubmittingPatches#sign-off:
>> 
>>    Please don’t hide your real name.
>> 
>> I suspect your real name is not Aleen, but something with x and w in
>> it.
>>
>
> I have used "Aleen" <aleen42@vip.qq.com> as my GitHub account to
> send this pull request, but the e-mail service disgusts me that it
> is slow to send emails to the domain "vger.kernel.org". So I
> decided to use another mail service to discuss, "Aleen 徐沛文"
> <pwxu@coremail.cn> as you saw.
>
> In the open-source world, I usually signed off "Aleen" rather than
> "Aleen 徐沛文", and is that necessary to change?

Yes.

As the URL you were referred to explains, the sign-off procedure is
to keep track of provenance of the code, which is a more "legal"
formal requirement than just "I use this pseudonym everywhere".
When a big company comes to us, claiming that "this code is our
intellectual property stolen from us" and pointing at code added by
a patch from you, we do not want to see us in the position to have
to say "eh, somebody who uses psuedonym X signed DCO, but we do not
even know their real name".
Aleen 徐沛文 Nov. 19, 2021, 7:23 a.m. UTC | #5
> Yes.
> 
> As the URL you were referred to explains, the sign-off procedure is
> to keep track of provenance of the code, which is a more "legal"
> formal requirement than just "I use this pseudonym everywhere".
> When a big company comes to us, claiming that "this code is our
> intellectual property stolen from us" and pointing at code added by
> a patch from you, we do not want to see us in the position to have
> to say "eh, somebody who uses psuedonym X signed DCO, but we do not
> even know their real name".

I know it, and as I said before that gitgitgadget need PR creators to
sign off user name of GitHub account, according to the DCO check. I can
confirmed that "Aleen" and "Aleen 徐沛文" are both the real name of mine,
the committer. I can use the account aleen42@vip.qq.com to confirm this.
徐沛文 (Aleen) Nov. 19, 2021, 7:25 a.m. UTC | #6
> I know it, and as I said before that gitgitgadget need PR creators to
> sign off user name of GitHub account, according to the DCO check. I can
> confirmed that "Aleen" and "Aleen 徐沛文" are both the real name of mine,
> the committer. I can use the account aleen42@vip.qq.com to confirm this.

Confirmed.
Junio C Hamano Nov. 19, 2021, 4:54 p.m. UTC | #7
Aleen 徐沛文 <pwxu@coremail.cn> writes:

>> Yes.
>> 
>> As the URL you were referred to explains, the sign-off procedure is
>> to keep track of provenance of the code, which is a more "legal"
>> formal requirement than just "I use this pseudonym everywhere".
>> When a big company comes to us, claiming that "this code is our
>> intellectual property stolen from us" and pointing at code added by
>> a patch from you, we do not want to see us in the position to have
>> to say "eh, somebody who uses psuedonym X signed DCO, but we do not
>> even know their real name".
>
> I know it, and as I said before that gitgitgadget need PR creators to
> sign off user name of GitHub account, according to the DCO check. I can
> confirmed that "Aleen" and "Aleen 徐沛文" are both the real name of mine,
> the committer. I can use the account aleen42@vip.qq.com to confirm this.

Can somebody from GGG land help this user?  I _think_ the easiest
workaround (other than not using GGG and sending e-mail in the old
fashioned way) is to commit and sign-off under the real name, and
push under whatever GitHub username to throw a GGG pull request,
which GGG should be able to take, as I have seen users forward other
authors commits just fine.
Aleen 徐沛文 Nov. 19, 2021, 5:14 p.m. UTC | #8
> Can somebody from GGG land help this user?  I _think_ the easiest
> workaround (other than not using GGG and sending e-mail in the old
> fashioned way) is to commit and sign-off under the real name, and
> push under whatever GitHub username to throw a GGG pull request,
> which GGG should be able to take, as I have seen users forward other
> authors commits just fine.

When it comes to GGG, I just want to know whether this is the only
way to contribute to Git? I think we can directly use GitHub to
run the reviewing procedure, rather than sending emails in this old
fashioned way, since that Git code has been maintained in GitHub.
E-mails does well in playing the role as a notification way. They
helps nothing in reviewing code, especially when we need to point out
problems or suggestions referred to certain code snippets.
Junio C Hamano Nov. 19, 2021, 7:25 p.m. UTC | #9
Aleen 徐沛文 <pwxu@coremail.cn> writes:

>> Can somebody from GGG land help this user?  I _think_ the easiest
>> workaround (other than not using GGG and sending e-mail in the old
>> fashioned way) is to commit and sign-off under the real name, and
>> push under whatever GitHub username to throw a GGG pull request,
>> which GGG should be able to take, as I have seen users forward other
>> authors commits just fine.
>
> When it comes to GGG, I just want to know whether this is the only
> way to contribute to Git? I think we can directly use GitHub to
> run the reviewing procedure, rather than sending emails in this old
> fashioned way, since that Git code has been maintained in GitHub.

No, we do not develop or maintain at GitHub at all.  The repository
at GitHub is one of the several publishing point and development is
done here.
Johannes Schindelin Nov. 22, 2021, 11:57 a.m. UTC | #10
Hi Junio & Aleen,

On Fri, 19 Nov 2021, Junio C Hamano wrote:

> Aleen 徐沛文 <pwxu@coremail.cn> writes:
>
> >> Yes.
> >>
> >> As the URL you were referred to explains, the sign-off procedure is
> >> to keep track of provenance of the code, which is a more "legal"
> >> formal requirement than just "I use this pseudonym everywhere".
> >> When a big company comes to us, claiming that "this code is our
> >> intellectual property stolen from us" and pointing at code added by
> >> a patch from you, we do not want to see us in the position to have
> >> to say "eh, somebody who uses psuedonym X signed DCO, but we do not
> >> even know their real name".
> >
> > I know it, and as I said before that gitgitgadget need PR creators to
> > sign off user name of GitHub account, according to the DCO check. I can
> > confirmed that "Aleen" and "Aleen 徐沛文" are both the real name of mine,
> > the committer. I can use the account aleen42@vip.qq.com to confirm this.
>
> Can somebody from GGG land help this user?  I _think_ the easiest
> workaround (other than not using GGG and sending e-mail in the old
> fashioned way) is to commit and sign-off under the real name, and
> push under whatever GitHub username to throw a GGG pull request,
> which GGG should be able to take, as I have seen users forward other
> authors commits just fine.

GitGitGadget looks at the author information, so you need to ensure that
the "Author:" line in the output of `git log` shows the desired name. If
it does not, you need to configure `user.name` (and user.email)` as
desired, and then re-commit with `git commit --amend --reset-author`, then
force-push.

Ciao,
Johannes