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

Re: [RFC] git-format-patch options

From
LTLuben Tuikov <ltuikov@yahoo.com>
Date
Nov 22, 2005, 06:26 UTC
Message-ID
<20051122062619.97432.qmail@web31810.mail.mud.yahoo.com>
In-Reply-To
<7vhda5ssxb.fsf@assigned-by-dhcp.cox.net>
--- Junio C Hamano <junkio@cox.net> wrote:
Show 14 quoted lines
> 
> The case statement that follows that comment is not quite right,
> BTW.  "format-patch foo bar..baz" should mean sequence of "foo"
> and then "bar..baz", but it incorrectly translates to a
> malformed "foo..bar..baz".
> 
> Modulo that bug, what the current code does is to special case
> one or two arguments case and rewrite them in that case
> statement, and then iterate over the resulting "$@".  We barf if
> each 'revpair' is not in rev1..rev2 format.
> 
> But it might make sense to (still keeping the above three
> backward compatibility syntax exceptions) interpret "rev" to
> mean "rev^1..rev", like this:

Ok, I don't understand the patch below. I tried to get from "rev" to a "rev^1..rev" or the identical "rev^1 rev", but could never do it with git-format-patch. So for now I just use the "rev^1..rev".

BTW, here is the analogy:
  git-diff-tree --pretty=raw -p <commit-id>
does what I want, except that it is not in patch format
as expected.  So it is quite possible to just add a
command line parameter to git-diff-tree to indicate
"formatted patch output", and we're done.
    Luben
Show 34 quoted lines
> 
> ---
> 
> diff --git a/git-format-patch.sh b/git-format-patch.sh
> index 7ee5d32..351790c 100755
> --- a/git-format-patch.sh
> +++ b/git-format-patch.sh
> @@ -99,7 +99,7 @@ filelist=$tmp-files
>  # Also, "rev1.." should mean "rev1..HEAD"; git-diff users are
>  # familiar with that syntax.
>  
> -case "$#,$1" in
> +case "$#,$1$2" in
>  1,?*..?*)
>  	# single "rev1..rev2"
>  	;;
> @@ -131,7 +131,8 @@ do
>  		rev2=`expr "$revpair" : '.*\.\.\(.*\)'`
>  		;;
>  	*)
> -		usage
> +		rev1="$revpair^"
> +		rev2="$revpair"
>  		;;
>  	esac
>  	git-rev-parse --verify "$rev1^0" >/dev/null 2>&1 ||
> 
> 
> 
> -
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Previous: Junio C Hamano
Message 9 of 9 in “[RFC] git-format-patch options”
  1. Luben TuikovNov 21, 2005
  2. Andreas EricssonNov 21, 2005
  3. Luben TuikovNov 21, 2005
  4. Andreas EricssonNov 21, 2005
  5. Luben TuikovNov 21, 2005
  6. Ryan AndersonNov 21, 2005
  7. Luben TuikovNov 22, 2005
  8. Junio C HamanoNov 21, 2005
  9. Luben TuikovNov 22, 2005

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.