git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Better suggestions when git-am(1) fails
@ 2023-03-08 20:15 Alejandro Colomar
  2023-03-09  3:17 ` Jeff King
  0 siblings, 1 reply; 30+ messages in thread
From: Alejandro Colomar @ 2023-03-08 20:15 UTC (permalink / raw)
  To: Git Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 2358 bytes --]

Hi,

I had the following error already a few times, when some contributors,
for some reason unknown to me, remove the leading path components from
the patch.  Now I know that the fix is to use -p0, but the first times
it wasn't obvious.  And still I forget about -p0 sometimes and it's
hard to find in the manual pages.  I think it would be good to suggest
using it when such an error appears.


$ git am -s patches/\[PATCH\ 1_2\]\ CONTRIBUTING\:\ Fix\ typo\,\ there\ is\ one\ active\ maintainer\ -\ Rodrigo\ Campos\ \<rodrigo@sdfg.com.ar\>\ -\ 2023-03-08\ 1622.eml
Applying: CONTRIBUTING: Fix typo, there is one active maintainer
error: git diff header lacks filename information when removing 1 leading pathname component (line 9)
Patch failed at 0001 CONTRIBUTING: Fix typo, there is one active maintainer
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
alx@asus5775:~/src/linux/man-pages/man-pages/main$ man git-am
alx@asus5775:~/src/linux/man-pages/man-pages/main$ git am --show-current-patch=diff
---
 CONTRIBUTING | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git CONTRIBUTING CONTRIBUTING
index 3b4408108..3bb671eca 100644
--- CONTRIBUTING
+++ CONTRIBUTING
@@ -8,7 +8,7 @@ Description
    Mailing list
        The main discussions regarding development of the project, patches,
        bugs, news, doubts, etc. happen on the mailing list.  To send an email
-       to the project, send it to both maintainers and CC the mailing list:
+       to the project, send it to Alejandro and CC the mailing list:
 
            To: Alejandro Colomar <alx@kernel.org>
            Cc: <linux-man@vger.kernel.org>
-- 
2.39.2


git(1) could recommend using `-p` to sort this out.  It could go
further and check which level would be needed for the patch to apply,
but at the very least it could tell the user which option it wants
to look for in the documentation.

Does this make sense to you?  I usually find git-am error messages
quite uninformative.


Cheers,

Alex


-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2023-03-13 19:54 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08 20:15 Better suggestions when git-am(1) fails Alejandro Colomar
2023-03-09  3:17 ` Jeff King
2023-03-09  6:06   ` Jeff King
2023-03-09  6:07     ` [PATCH 1/5] diff: factor out src/dst prefix setup Jeff King
2023-03-09 10:50       ` Alejandro Colomar
2023-03-09  6:07     ` [PATCH 2/5] t4013: add tests for diff prefix options Jeff King
2023-03-09  6:09     ` [PATCH 3/5] diff: add --default-prefix option Jeff King
2023-03-09 10:51       ` Alejandro Colomar
2023-03-09 16:31       ` Junio C Hamano
2023-03-10  9:44         ` Jeff King
2023-03-10 17:04           ` Junio C Hamano
2023-03-13 16:43             ` Jeff King
2023-03-13 17:17               ` Junio C Hamano
2023-03-13 17:31               ` Junio C Hamano
2023-03-13 19:54                 ` Jeff King
2023-03-09  6:11     ` [PATCH 4/5] format-patch: do not respect diff.noprefix Jeff King
2023-03-09 10:53       ` Alejandro Colomar
2023-03-09 16:41       ` Junio C Hamano
2023-03-10  9:49         ` Jeff King
2023-03-09  6:12     ` [PATCH 5/5] format-patch: add format.noprefix option Jeff King
2023-03-09 17:00       ` Junio C Hamano
2023-03-10  9:51         ` Jeff King
2023-03-09 10:58     ` Better suggestions when git-am(1) fails Alejandro Colomar
2023-03-09 21:53     ` Junio C Hamano
2023-03-10  9:54       ` Jeff King
2023-03-09 16:22   ` Junio C Hamano
2023-03-10  9:39     ` Jeff King
2023-03-10 16:28       ` Junio C Hamano
2023-03-13 16:37         ` Jeff King
2023-03-13 17:10           ` Junio C Hamano

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).