2
  1. I generated two commits using $ git format-patch -M origin/master
  2. I downloaded and configured $ sudo apt-get install git-email
  3. I opened the email very happy and received it, but only the submission instructions in the email, no patch file.
  4. I don't know how to fix it, I used email to send the patch for the first time.

I currently have no ideas to solve:

Server: smtp.qq.com
MAIL FROM:<2046643946@qq.com>
RCPT TO:<2046643946@qq.com>
RCPT TO:<ubuntu@qq.com>
From: 2046643946@qq.com
To: 2046643946@qq.com
Cc: ubuntu <ubuntu@qq.com>
Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BA=86c.txt?=
Date: Thu, 30 May 2019 10:50:06 +0800
Message-Id: <20190530025006.14987-2-2046643946@qq.com>
X-Mailer: git-send-email 2.17.1
In-Reply-To: <20190530025006.14987-1-2046643946@qq.com>
References: <20190530025006.14987-1-2046643946@qq.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Result: 250 
czx@ubuntu1802:~/test/chezixin_git$ 

Above is some information sent。⬆️

I think that after sending the patch, the mail should receive the patch file, or how to merge?
However, my mail only received the submission information, no patch file.

--------------Second question---------------

Thank you very much for your help, I tried to read the documentation and solve it myself, but I still haven't solved it. When I executed git send-email -10 --cover-letter --annotate, the terminal took me to the editing page. At this moment, I don't know how to proceed to the next step. When my ctrl+x is all closed, the terminal prompts the following content. :

Czx@ubuntu1802:~/test/chezixin_git$ git send-email -10 --cover-letter --annotate/tmp/YXy7Hba5WV/0000-cover-letter.patch
/tmp/YXy7Hba5WV/0001-ubuntu.patch
/tmp/YXy7Hba5WV/0002-ceshi-mac.patch
/tmp/YXy7Hba5WV/0003-b.patch
/tmp/YXy7Hba5WV/0004-c.txt.patch
Refusing to send because the patch
/tmp/YXy7Hba5WV/0000-cover-letter.patch
Has the template subject '*** SUBJECT HERE ***'. Pass --force if you really want to send.

Sorry, I let you down, can you continue to help me?

-------------Third supplement---------------- Below is git log enter image description here

Below is ls

enter image description here

Below is email enter image description here

-------------Fourth questioning-------------------

After entering the image content, after pressing ctrl + x, I was prompted to refuse to send. What should I press to send the content of the message. enter image description here

I also entered the picture before, I ctrl+o, then enter, then ctrl+x. Is there a problem with my steps?

chezi chezi
  • 91
  • 1
  • 1
  • 7

1 Answers1

4

git format-patch alone would not send an email.

git send-email would

See for instance "How to Use git send-email"

Sending the last 10 commits in the current branch:

git send-email -10 --cover-letter --annotate --subject "a topic"

(note: adapt -10 to the actual number of last commits you want to include in your email)

The --cover-letter option creates an extra mail that will be sent before the actual patch mails. You can add write some introduction to the patch set in the cover letter.
If you need to explain the patches, be sure to include the explanations also in the commit messages, because the cover letter text won't be recorded in the git history.

Refusing to send because the patch
/tmp/YXy7Hba5WV/0000-cover-letter.patch
Has the template subject '*** SUBJECT HERE ***'. Pass --force if you really want to send

Make sure to use the --subject option.


Note that git format-patch also has a --notes option

The expected use case of this is to write supporting explanation for the commit that does not belong to the commit log message proper, and include it with the patch submission.
While one can simply write these explanations after format-patch has run but before sending, keeping them as Git notes allows them to be maintained between versions of the patch series

Git 2.23 (Q3 2019) add a configuration to set the default for its --notes=<ref> option.

See commit 13cdf78 (16 May 2019), and commit 83d9db7 (10 May 2019) by Denton Liu (Denton-L).
(Merged by Junio C Hamano -- gitster -- in commit e91f65d, 13 Jun 2019)

format-patch: teach format.notes config option

In git-format-patch, notes can be appended with the --notes option.
However, this must be specified by the user on an invocation-by-invocation basis. If a user is not careful, it's possible that they may forget to include it and generate a patch series without notes.

Teach git-format-patch the format.notes config option.
Its value is a notes ref that will be automatically appended.
The special value of "standard" can be used to specify the standard notes. This option is overridable with the --no-notes option in case a user wishes not to append notes.


With Git 2.25 (Q1 2020), "git format-patch" can take a set of configured format.notes values to specify which notes refs to use in the log message part of the output.

The behaviour of this was not consistent with multiple --notes command line options, which has been corrected.

See commit e0f9095 (18 Dec 2019), commit 1d72975, commit 66f79ee (12 Dec 2019), and commit 09ac67a, commit 8164c96, commit 452538c, commit e6e230e, commit 1e6ed54 (09 Dec 2019) by Denton Liu (Denton-L).
(Merged by Junio C Hamano -- gitster -- in commit 17066be, 25 Dec 2019)

format-patch: use --notes behavior for format.notes

Signed-off-by: Denton Liu

When we had multiple format.notes config values where we had <ref1>, false, <ref2> (in that order), then we would print out the notes for both <ref1> and <ref2>.
This doesn't make sense, however, since we parse the config in a top-down manner and a false should be able to override previous configurations, just like how --no-notes will override previous --notes.

Duplicate the logic that handles the --[no-]notes[=] option to format.notes for consistency.
As a result, when parsing the config from top to bottom, format.notes = true will behave like --notes, format.notes = <ref> will behave like --notes=<ref> and format.notes = false will behave like --no-notes.

This change isn't strictly backwards compatible but since it is an edge case where a sane user would not mix notes refs with false and this feature is relatively new (released only in v2.23.0), this change should be harmless.

The config/format documentation now includes:

This configuration can be specified multiple times in order to allow multiple notes refs to be included.
In that case, it will behave similarly to multiple --[no-]notes[=] options passed in. That is, a value of true will show the default notes, a value of <ref> will also show notes from that notes ref and a value of false will negate previous configurations and not show notes.

For example:

------------
[format]
    notes = true
    notes = foo
    notes = false
    notes = bar
------------

will only show notes from refs/notes/bar.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you very much for your answer, I tried to solve the problem yourself according to the documentation you gave. But I have limited ability. I sent the email for the first time. I will re-edit the question. Can you help me? – chezi chezi May 30 '19 at 06:25
  • I am very grateful to you, I hope you don't dislike me, I edited this question. – chezi chezi May 30 '19 at 06:33
  • I changed the way to $ git send-email -1, so after the execution, my mailbox received the message again, but the message only has text information and no patch file. Do you want to manually copy the patch file and then manually send it to the other patch file? I feel that I have problems with the implementation. – chezi chezi May 30 '19 at 06:44
  • @chezichezi First, does git log shows you commits (meaning did you add and commit files, before attempting to send patches)? – VonC May 30 '19 at 07:19
  • That's right, before I send the patch: 1. I created a new branch locally and made a change. 2. Add a commit to the local library. Then a patch file is generated. 3. Send these patches. However, my mailbox has only text information, and no patch file can be downloaded. – chezi chezi May 30 '19 at 07:26
  • I have prepared some screenshots, I hope to help me see – chezi chezi May 30 '19 at 07:26
  • Thank you for continuing to help me, I edited the question, added some screenshots, I hope you can help me analyze the root cause of the problem. – chezi chezi May 30 '19 at 07:33
  • thank you very much,thank you very much,thank you very much,thank you very much,thank you very much,thank you very much – chezi chezi May 30 '19 at 07:34
  • Thank you for your patience. You may have told me the correct answer, but I will not use it correctly. Can you continue to check my editing questions? Sorry – chezi chezi May 30 '19 at 07:54
  • @chezichezi Strange, send-email didn't seem complex to use. (AS in https://medium.com/@yestyle/git%E6%9D%83%E5%A8%81%E6%8C%87%E5%8D%97-%E8%AF%BB%E4%B9%A6%E7%AC%94%E8%AE%B0-part-1-827a341945c5 for instance) – VonC May 30 '19 at 07:58
  • I used to send it like this, I received the mailbox, but unfortunately there is only text, no patch file. $ git send-email * .patch Now I send it the way you want, but I don't know how to send it correctly. – chezi chezi May 30 '19 at 07:59
  • @chezichezi Can you try and follow https://burzalodowa.wordpress.com/2013/10/05/how-to-send-patches-with-git-send-email/, to test if this work better? – VonC May 30 '19 at 08:00
  • Thank you for your information, thank you very much, the damn Chinese network is too broken. – chezi chezi May 30 '19 at 08:04
  • I seriously read the official documents, books. I am successful in sending the way, maybe I have any misunderstanding about the mail? Because I don't know how to merge patches. Look at my connection – chezi chezi May 30 '19 at 10:40
  • https://stackoverflow.com/questions/56375151/my-mailbox-was-received-but-i-dont-know-how-to-get-the-patch-in-the-mailbox-b You may have disliked me, but no second person helped me, sorry. – chezi chezi May 30 '19 at 10:41