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

Re: [PATCH 1/8] Use %B for Split Subject/Body

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 1, 2013, 21:25 UTC
Message-ID
<7va9ssa94l.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1357012655-24974-2-git-send-email-greened@obbligato.org>
"David A. Greene" <greened@obbligato.org> writes:
> Subject: Re: [PATCH 1/8] Use %B for Split Subject/Body

This needs to say "contrib/subtree" somewhere (applies to all patches in this series).

Show 6 quoted lines
> From: Techlive Zheng <techlivezheng@gmail.com>
>
> Use %B to format the commit message and body to avoid an extra newline
> if a commit only has a subject line.
>
> Author:    Techlive Zheng <techlivezheng@gmail.com>
This needs to be a S-o-b instead; is it a real name, by the way?
Show 20 quoted lines
> Signed-off-by: David A. Greene <greened@obbligato.org>
> ---
>  contrib/subtree/git-subtree.sh     |    5 +++
>  contrib/subtree/t/t7900-subtree.sh |   73 ++++++++++++++++++++++--------------
>  2 files changed, 49 insertions(+), 29 deletions(-)
>
> diff --git a/contrib/subtree/git-subtree.sh b/contrib/subtree/git-subtree.sh
> index 920c664..f2b6d4a 100755
> --- a/contrib/subtree/git-subtree.sh
> +++ b/contrib/subtree/git-subtree.sh
> @@ -296,7 +296,12 @@ copy_commit()
>  	# We're going to set some environment vars here, so
>  	# do it in a subshell to get rid of them safely later
>  	debug copy_commit "{$1}" "{$2}" "{$3}"
> +	# Use %B rather than %s%n%n%b to handle the special case of a
> +	# commit that only has a subject line.  We don't want to
> +	# introduce a newline after the subject, causing generation of
> +	# a new hash.
>  	git log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%s%n%n%b' "$1" |
> +#	git log -1 --pretty=format:'%an%n%ae%n%ad%n%cn%n%ce%n%cd%n%B' "$1" |

Is it really replacing %s%n%n%b with %B, or is it still an experiment that is disabled?

Show 15 quoted lines
>  	(
>  		read GIT_AUTHOR_NAME
>  		read GIT_AUTHOR_EMAIL
> diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh
> index bc2eeb0..93eeb09 100755
> --- a/contrib/subtree/t/t7900-subtree.sh
> +++ b/contrib/subtree/t/t7900-subtree.sh
> @@ -76,6 +76,10 @@ test_expect_success 'add sub1' '
>          git branch -m master subproj
>  '
>  
> +# Save this hash for testing later.
> +
> +subdir_hash=`git rev-parse HEAD`
> +
We prefer $() over ``; much more readable.
Show 11 quoted lines
>  # 3
>  test_expect_success 'add sub2' '
>          create sub2 &&
> @@ -155,7 +159,6 @@ test_expect_success 'add main-sub5' '
>          create subdir/main-sub5 &&
>          git commit -m "main-sub5"
>  '
> -
>  # 15
>  test_expect_success 'add main6' '
>          create main6 &&
Why?
> @@ -235,7 +238,19 @@ test_expect_success 'check split with --branch' '
>          check_equal ''"$(git rev-parse splitbr1)"'' "$spl1"

Is quoting screwed up around here (and in many other places in this patch)? What are these no-op '' doing?

>  '
>  
> -# 25
> +#25
Why the lossage of a SP?

It may make sense to lose these "# num" that will have to be touched every time somebody inserts new test pieces in the middle, as a preparatory step before any of these patches, by the way. That will reduce noise in the patches for real changes.

Previous: Junio C HamanoNext: greened@obbligato.org
Message 10 of 38 in “git-subtree Patches to Apply”
  1. David A. GreeneJan 1, 2013
  2. 1/8 Use %B for Split Subject/BodyDavid A. Greene, Jan 1, 2013
  3. greened@obbligato.orgJan 1, 2013
  4. Junio C HamanoJan 1, 2013
  5. greened@obbligato.orgJan 1, 2013
  6. Junio C HamanoJan 1, 2013
  7. greened@obbligato.orgJan 1, 2013
  8. 郑文辉 (Techlive Zheng)Jan 7, 2013
  9. Junio C HamanoJan 7, 2013
  10. Junio C HamanoJan 1, 2013
  11. greened@obbligato.orgJan 1, 2013
  12. Junio C HamanoJan 2, 2013
  13. greened@obbligato.orgJan 8, 2013
  14. 2/8 Add --unannotateDavid A. Greene, Jan 1, 2013
  15. Junio C HamanoJan 1, 2013
  16. greened@obbligato.orgJan 1, 2013
  17. Junio C HamanoJan 2, 2013
  18. greened@obbligato.orgJan 8, 2013
  19. James NylenJan 17, 2013
  20. greened@obbligato.orgJan 22, 2013
  21. Junio C HamanoJan 22, 2013
  22. 3/8 Better Error Handling for addDavid A. Greene, Jan 1, 2013
  23. Junio C HamanoJan 1, 2013
  24. greened@obbligato.orgJan 1, 2013
  25. Junio C HamanoJan 2, 2013
  26. 4/8 Fix SynopsisDavid A. Greene, Jan 1, 2013
  27. Junio C HamanoJan 1, 2013
  28. greened@obbligato.orgJan 1, 2013
  29. 5/8 Honor DESTDIRDavid A. Greene, Jan 1, 2013
  30. Junio C HamanoJan 1, 2013
  31. greened@obbligato.orgJan 1, 2013
  32. 6/8 Make the Manual Directory if NeededDavid A. Greene, Jan 1, 2013
  33. Junio C HamanoJan 1, 2013
  34. greened@obbligato.orgJan 1, 2013
  35. 7/8 Ignore git-subtreeDavid A. Greene, Jan 1, 2013
  36. Junio C HamanoJan 1, 2013
  37. 8/8 Fix Documentation TypoDavid A. Greene, Jan 1, 2013
  38. 郑文辉 (Techlive Zheng)Jan 7, 2013

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.