{"thread":{"id":"20455","subject":"[PATCH 1/1] git-svn: ignore leading blank lines in svn:ignore","startedAt":"2009-08-07T19:21:21Z","lastAt":"2009-08-10T09:38:27Z","messageCount":2,"participants":["Michael Haggerty","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"119921","messageId":"e6857eacc53d862018138bd8d9e1ab778e8f5725.1249672562.git.mhagger@alum.mit.edu","threadId":"20455","inReplyTo":null,"subject":"[PATCH 1/1] git-svn: ignore leading blank lines in svn:ignore","fromName":"Michael Haggerty","fromEmail":"mhagger@alum.mit.edu","sentAt":"2009-08-07T19:21:21Z","receivedAt":"2009-08-07T19:21:21Z","isPatch":true,"sender":{"key":"mhagger@alum.mit.edu","avatar":"https://avatars.githubusercontent.com/u/119718?v=4"},"body":"Subversion ignores all blank lines in svn:ignore properties.  The old\ngit-svn code ignored blank lines everywhere except for the first line\nof the svn:ignore property.  This patch makes the \"git svn\nshow-ignore\" and \"git svn create-ignore\" commands ignore leading blank\nlines, too.\n\nAlso include leading blank lines in the test suite.\n\nSigned-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n---\n git-svn.perl             |    2 ++\n t/t9101-git-svn-props.sh |    5 ++++-\n 2 files changed, 6 insertions(+), 1 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex d075810..f1cc849 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -764,6 +764,7 @@ sub cmd_show_ignore {\n \t\tprint STDOUT \"\\n# $path\\n\";\n \t\tmy $s = $props->{'svn:ignore'} or return;\n \t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t$s =~ s/^\\n+//;\n \t\tchomp $s;\n \t\t$s =~ s#^#$path#gm;\n \t\tprint STDOUT \"$s\\n\";\n@@ -801,6 +802,7 @@ sub cmd_create_ignore {\n \t\topen(GITIGNORE, '>', $ignore)\n \t\t  or fatal(\"Failed to open `$ignore' for writing: $!\");\n \t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t$s =~ s/^\\n+//;\n \t\tchomp $s;\n \t\t# Prefix all patterns so that the ignore doesn't apply\n \t\t# to sub-directories.\ndiff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh\nindex 9da4178..929499e 100755\n--- a/t/t9101-git-svn-props.sh\n+++ b/t/t9101-git-svn-props.sh\n@@ -142,7 +142,9 @@ test_expect_success 'test show-ignore' \"\n \ttouch deeply/nested/directory/.keep &&\n \tsvn_cmd add deeply &&\n \tsvn_cmd up &&\n-\tsvn_cmd propset -R svn:ignore 'no-such-file*' .\n+\tsvn_cmd propset -R svn:ignore '\n+no-such-file*\n+' .\n \tsvn_cmd commit -m 'propset svn:ignore'\n \tcd .. &&\n \tgit svn show-ignore > show-ignore.got &&\n@@ -171,6 +173,7 @@ test_expect_success 'test create-ignore' \"\n \t\"\n \n cat >prop.expect <<\\EOF\n+\n no-such-file*\n \n EOF\n-- \n1.6.4\n"},{"id":"120134","messageId":"20090810093827.GA28489@dcvr.yhbt.net","threadId":"20455","inReplyTo":"e6857eacc53d862018138bd8d9e1ab778e8f5725.1249672562.git.mhagger@alum.mit.edu","subject":"Re: [PATCH 1/1] git-svn: ignore leading blank lines in svn:ignore","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2009-08-10T09:38:27Z","receivedAt":"2009-08-10T09:38:27Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Michael Haggerty <mhagger@alum.mit.edu> wrote:\n> Subversion ignores all blank lines in svn:ignore properties.  The old\n> git-svn code ignored blank lines everywhere except for the first line\n> of the svn:ignore property.  This patch makes the \"git svn\n> show-ignore\" and \"git svn create-ignore\" commands ignore leading blank\n> lines, too.\n> \n> Also include leading blank lines in the test suite.\n> \n> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>\n\nThanks Michael,\n\nAcked out and pushed out along with two of Adam's to\ngit://yhbt.net/git-svn:\n\nAdam Brewster (2):\n      svn: Add && to t9107-git-svn-migrate.sh\n      svn: Honor --prefix option in init without --stdlayout\n\nMichael Haggerty (1):\n      git-svn: ignore leading blank lines in svn:ignore\n\n-- \nEric Wong\n"}]}