git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-am: ignore leading whitespace before patch
@ 2011-08-02 22:20 David Barr
  2011-08-03 12:28 ` Tay Ray Chuan
  2011-08-08  5:10 ` David Barr
  0 siblings, 2 replies; 10+ messages in thread
From: David Barr @ 2011-08-02 22:20 UTC (permalink / raw)
  To: Git Mailing List; +Cc: David Barr

Some web-based email clients prepend whitespace to raw message
transcripts to workaround content-sniffing in some browsers.
Adjust the patch format detection logic to ignore leading
whitespace.

Signed-off-by: David Barr <davidbarr@google.com>
---
 git-am.sh |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/git-am.sh b/git-am.sh
index 463c741..19b2f0f 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -199,7 +199,11 @@ check_patch_format () {
 	# otherwise, check the first few lines of the first patch to try
 	# to detect its format
 	{
-		read l1
+		# Start from first line containing non-whitespace
+		until [ -n "$l1" ]
+		do
+			read l1
+		done
 		read l2
 		read l3
 		case "$l1" in
-- 
1.7.6

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

end of thread, other threads:[~2011-08-08  5:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-02 22:20 [PATCH] git-am: ignore leading whitespace before patch David Barr
2011-08-03 12:28 ` Tay Ray Chuan
2011-08-03 13:21   ` Sverre Rabbelier
2011-08-03 13:31     ` Tay Ray Chuan
2011-08-03 13:33       ` Sverre Rabbelier
2011-08-06  1:56   ` David Barr
2011-08-06  5:00     ` Junio C Hamano
2011-08-08  2:49       ` [PATCH v2] am: " Jonathan Nieder
2011-08-08  5:10 ` David Barr
2011-08-08  5:31   ` David Barr

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 NNTP newsgroup(s).