git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Remove use of git-rev-parse and replace git-rev-list --pretty with git-log

From
Junio C Hamano <junkio@cox.net>
Date
Mar 3, 2007, 11:52 UTC
Message-ID
<7virdiczn0.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200703030825.18378.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
Show 19 quoted lines
> Finding the "---" separator between diff and log message could at least 
> rely on finding "---" alone on a line so that "--- something else" 
> wouldn't trigger the end of log?
>
> I assume this is too simple?
>
> diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
> index 766a37e..4e0795a 100644
> --- a/builtin-mailinfo.c
> +++ b/builtin-mailinfo.c
> @@ -670,7 +670,7 @@ static int handle_commit_msg(int *seen)
>         return 0;
>     do {
>         if (!memcmp("diff -", line, 6) ||
> -           !memcmp("---", line, 3) ||
> +           !memcmp("---\n", line, 4) ||
>             !memcmp("Index: ", line, 7))
>             break;
>         if ((multipart_boundary[0] && is_multipart_boundary(line))) {

I think that would make us reject patches that we currently accept. Today, you can submit a patch created this way:

	$ cp Makefile Makefile.orig
        $ edit Makefile
	$ cat body-of-message
        $ echo "Signed-off-by: $me"
        $ diff -u Makefile.orig Makefile

The first line of the diff part would be "--- Makefile.orig" (and the second one begins with "+++ Makefile").

I do not think I've asked Linus about how he originally came up with "three dashes at the beginning of line" convention in the kernel circle, but my guess always have been that it would automatically allow us to accept patches prepared like this.

Previous: Andy ParkinsNext: Linus Torvalds
Message 8 of 9 in “Fix typo on variable name $newref should be $newrev in sample update hook”
  1. Fix typo on variable name $newref should be $newrev in sample update hookAndy Parkins, Mar 2, 2007
  2. Linus TorvaldsMar 2, 2007
  3. Andy ParkinsMar 2, 2007
  4. Remove use of git-rev-parse and replace git-rev-list --pretty with git-logAndy Parkins, Mar 2, 2007
  5. Linus TorvaldsMar 2, 2007
  6. Junio C HamanoMar 2, 2007
  7. Andy ParkinsMar 3, 2007
  8. Junio C HamanoMar 3, 2007
  9. Linus TorvaldsMar 4, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.