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

Re: [PATCH] git-am: head -1 is obsolete and doesn't work on some new systems

From
Jakub Narebski <jnareb@gmail.com>
Date
Jun 16, 2008, 20:26 UTC
Message-ID
<m3tzftnn28.fsf@localhost.localdomain>
In-Reply-To
<1213646544.908600.7895.nullmailer@rafaella.geeks.cl>
<amery@geeks.cl> writes:
> From 25cb047690dd6101527cdfa6198dd6a6f93bf095 Mon Sep 17 00:00:00 2001

This line is not needed (unless you use git-send-mail, or import patch as mbox to your MUA), and it should be removed.

> From: Alejandro Mery <amery@geeks.cl>
> Date: Mon, 16 Jun 2008 20:27:14 +0200
> Subject: [PATCH] git-am: head -1 is obsolete and doesn't work on some new systems

These headers should go as mailing list headers, which mean that your MUA should generate proper from (if it cannot, the From: would have to stay), and subject should go as email subject.

> http://www.opengroup.org/onlinepubs/009695399/utilities/head.html

We are not interested in theoretical POSIX compliance, see CodingGuidelines.

Patch lacks signoff line, per SubmittingPatches
: Signed-off-by: Alejandro Mery <amery@geeks.cl>
Show 14 quoted lines
> ---
>  git-am.sh |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/git-am.sh b/git-am.sh
> index b48096e..797988f 100755
> --- a/git-am.sh
> +++ b/git-am.sh
> @@ -421,7 +421,7 @@ do
>  	else
>  	    action=yes
>  	fi
> -	FIRSTLINE=$(head -1 "$dotest/final-commit")
> +	FIRSTLINE=$(head -n1 "$dotest/final-commit")
For better portability it would be better use 'sed 1q' here instead.

: - FIRSTLINE=$(head -1 "$dotest/final-commit") : + FIRSTLINE=$(sed -e 1q "$dotest/final-commit")

Show 5 quoted lines
>  	if test $action = skip
>  	then
> -- 
> 1.5.4.3
> 
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: amery@geeks.clNext: Alejandro Mery
Message 2 of 3 in “(unknown)”
  1. amery@geeks.clJun 16, 2008
  2. Jakub NarebskiJun 16, 2008
  3. Alejandro MeryJun 16, 2008

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.