{"thread":{"id":"61797","subject":"[PATCH 0/2] git-svn: use svn:global-ignores when creating .gitignores","startedAt":"2024-07-17T19:57:49Z","lastAt":"2024-08-12T20:39:47Z","messageCount":13,"participants":["Alex Galvin via GitGitGadget","Junio C Hamano","Alex Galvin"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"498852","messageId":"pull.1747.git.git.1721246266.gitgitgadget@gmail.com","threadId":"61797","inReplyTo":null,"subject":"[PATCH 0/2] git-svn: use svn:global-ignores when creating .gitignores","fromName":"Alex Galvin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-07-17T19:57:43Z","receivedAt":"2024-07-17T19:57:49Z","isPatch":true,"sender":{"key":"agalvin@comqi.com","avatar":"https://avatars.githubusercontent.com/u/32237198?v=4"},"body":"Git-SVN does not currently use the svn:global-ignores property added in\nSubversion 1.8 when showing or creating .gitignore files. This causes\nGit-SVN to track files that are ignored by this directive in Subversion.\n\nThe following patches add svn:global-ignores to the list of public svn\nproperties, and update git svn show-ignore and git svn create-ignore to use\nthis attribute (as well as svn:ignore).\n\nAlex Galvin (2):\n  git-svn: add public property `svn:global-ignores`\n  git-svn: use `svn:global-ignores` to create .gitignore\n\n git-svn.perl    | 45 +++++++++++++++++++++++++++++++--------------\n perl/Git/SVN.pm |  2 +-\n 2 files changed, 32 insertions(+), 15 deletions(-)\n\n\nbase-commit: c2b3f2b3cdbf5ad9feb978dd367d77561a1271f7\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1747%2Fav-gal%2Fgit-svn-global-ignores-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1747/av-gal/git-svn-global-ignores-v1\nPull-Request: https://github.com/git/git/pull/1747\n-- \ngitgitgadget\n"},{"id":"498853","messageId":"27bee8de47b34e8049ad922178bddc16dd2a7274.1721246266.git.gitgitgadget@gmail.com","threadId":"61797","inReplyTo":"pull.1747.git.git.1721246266.gitgitgadget@gmail.com","subject":"[PATCH 1/2] git-svn: add public property `svn:global-ignores`","fromName":"Alex Galvin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-07-17T19:57:44Z","receivedAt":"2024-07-17T19:57:49Z","isPatch":true,"sender":{"key":"agalvin@comqi.com","avatar":"https://avatars.githubusercontent.com/u/32237198?v=4"},"body":"From: Alex Galvin <agalvin@comqi.com>\n\nSigned-off-by: Alex Galvin <agalvin@comqi.com>\n---\n perl/Git/SVN.pm | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\nindex 7721708ce5d..b0913ca1b63 100644\n--- a/perl/Git/SVN.pm\n+++ b/perl/Git/SVN.pm\n@@ -763,7 +763,7 @@ sub prop_walk {\n \t\t# this needs to be updated.\n \t\t++$interesting_props if /^svn:(?:ignore|keywords|executable\n \t\t                                 |eol-style|mime-type\n-\t\t\t\t\t\t |externals|needs-lock)$/x;\n+\t\t\t\t\t\t |externals|needs-lock|global-ignores)$/x;\n \t}\n \t&$sub($self, $p, $props) if $interesting_props;\n \n-- \ngitgitgadget\n\n"},{"id":"498854","messageId":"10e240202f79a0f50edf47391389c4e0892edf41.1721246266.git.gitgitgadget@gmail.com","threadId":"61797","inReplyTo":"pull.1747.git.git.1721246266.gitgitgadget@gmail.com","subject":"[PATCH 2/2] git-svn: use `svn:global-ignores` to create .gitignore","fromName":"Alex Galvin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-07-17T19:57:45Z","receivedAt":"2024-07-17T19:57:50Z","isPatch":true,"sender":{"key":"agalvin@comqi.com","avatar":"https://avatars.githubusercontent.com/u/32237198?v=4"},"body":"From: Alex Galvin <agalvin@comqi.com>\n\nSigned-off-by: Alex Galvin <agalvin@comqi.com>\n---\n git-svn.perl | 45 +++++++++++++++++++++++++++++++--------------\n 1 file changed, 31 insertions(+), 14 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex b0d0a50984b..a2a46608c9b 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1279,12 +1279,20 @@ sub cmd_show_ignore {\n \t$gs->prop_walk($gs->path, $r, sub {\n \t\tmy ($gs, $path, $props) = @_;\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+\t\tif (my $s = $props->{'svn:ignore'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t$s =~ s#^#$path#gm;\n+\t\t\tprint STDOUT \"$s\\n\";\n+\t\t}\n+\t\tif (my $s = $props->{'svn:global-ignores'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t$s =~ s#^#$path**/#gm;\n+\t\t\tprint STDOUT \"$s\\n\";\n+\t\t}\n \t});\n }\n \n@@ -1315,16 +1323,25 @@ sub cmd_create_ignore {\n \t\t# which git won't track\n \t\tmkpath([$path]) unless -d $path;\n \t\tmy $ignore = $path . '.gitignore';\n-\t\tmy $s = $props->{'svn:ignore'} or return;\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.\n-\t\t$s =~ s#^#/#gm;\n-\t\tprint GITIGNORE \"$s\\n\";\n+\t\tif (my $s = $props->{'svn:ignore'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t# Prefix all patterns so that the ignore doesn't apply\n+\t\t\t# to sub-directories.\n+\t\t\t$s =~ s#^#/#gm;\n+\t\t\tprint GITIGNORE \"$s\\n\";\n+\t\t}\n+\t\tif (my $s = $props->{'svn:global-ignores'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t# Global ignores apply to sub-directories, so they are\n+\t\t\t# not prefixed.\n+\t\t\tprint GITIGNORE \"$s\\n\";\n+\t\t}\n \t\tclose(GITIGNORE)\n \t\t  or fatal(\"Failed to close `$ignore': $!\");\n \t\tcommand_noisy('add', '-f', $ignore);\n-- \ngitgitgadget\n"},{"id":"498859","messageId":"xmqqed7r3fyv.fsf@gitster.g","threadId":"61797","inReplyTo":"pull.1747.git.git.1721246266.gitgitgadget@gmail.com","subject":"Re: [PATCH 0/2] git-svn: use svn:global-ignores when creating .gitignores","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-07-17T20:45:28Z","receivedAt":"2024-07-17T20:45:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Alex Galvin via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> Git-SVN does not currently use the svn:global-ignores property added in\n> Subversion 1.8 when showing or creating .gitignore files. This causes\n> Git-SVN to track files that are ignored by this directive in Subversion.\n\nThat is a well written explanation of what issue the patches want to\naddress.\n\n> The following patches add svn:global-ignores to the list of public svn\n> properties, and update git svn show-ignore and git svn create-ignore to use\n> this attribute (as well as svn:ignore).\n\nPaying attention to the new property and get it reflected to\n.gitignore on Git side may be a reasonable solution, especially if\nwe ignore older version of Subversion.  But I have a naïve question.\nIf a new version of git-svn starts to rely on the new property that\nis only available in SVN 1.8, would it create problems with folks\nwhose SVN installation does not understand it?  Would it cause\nproblems to them?\n\nAnyway, in this project, explanation of the problem the patches\naddress, with the outline of the solution, should be in the proposed\ncommit log message of the patches themselves, not just written in\nthe cover letter.  Can you redo the proposed log messages of these\ntwo patches, where you have none in this iteration?\n\nThanks.\n\n> Alex Galvin (2):\n>   git-svn: add public property `svn:global-ignores`\n>   git-svn: use `svn:global-ignores` to create .gitignore\n>\n>  git-svn.perl    | 45 +++++++++++++++++++++++++++++++--------------\n>  perl/Git/SVN.pm |  2 +-\n>  2 files changed, 32 insertions(+), 15 deletions(-)\n>\n>\n> base-commit: c2b3f2b3cdbf5ad9feb978dd367d77561a1271f7\n> Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1747%2Fav-gal%2Fgit-svn-global-ignores-v1\n> Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1747/av-gal/git-svn-global-ignores-v1\n> Pull-Request: https://github.com/git/git/pull/1747\n"},{"id":"498939","messageId":"ba217f0c-68db-4e66-9397-c8819589371e@comqi.com","threadId":"61797","inReplyTo":"xmqqed7r3fyv.fsf@gitster.g","subject":"Re: [PATCH 0/2] git-svn: use svn:global-ignores when creating .gitignores","fromName":"Alex Galvin","fromEmail":"agalvin@comqi.com","sentAt":"2024-07-18T19:59:14Z","receivedAt":"2024-07-18T19:59:34Z","isPatch":true,"sender":{"key":"agalvin@comqi.com","avatar":"https://avatars.githubusercontent.com/u/32237198?v=4"},"body":"\nOn 2024-07-17 4:45 p.m., Junio C Hamano wrote:\n> Paying attention to the new property and get it reflected to\n> .gitignore on Git side may be a reasonable solution, especially if\n> we ignore older version of Subversion.  But I have a naïve question.\n> If a new version of git-svn starts to rely on the new property that\n> is only available in SVN 1.8, would it create problems with folks\n> whose SVN installation does not understand it?  Would it cause\n> problems to them?\n\nI don't believe so. Git doesn't do anything to set these properties,\nit just reads and translates them into the format used by .gitignore.\nSo users on old versions of SVN should not be affected, their\nservers will not have this property set anywhere.\n\n> Anyway, in this project, explanation of the problem the patches\n> address, with the outline of the solution, should be in the proposed\n> commit log message of the patches themselves, not just written in\n> the cover letter.  Can you redo the proposed log messages of these\n> two patches, where you have none in this iteration?\n>\n> Thanks.\nSure thing. An amended patchset is incoming.\n\nThanks,\nAlex\n"},{"id":"498940","messageId":"pull.1747.v2.git.git.1721335657.gitgitgadget@gmail.com","threadId":"61797","inReplyTo":"pull.1747.git.git.1721246266.gitgitgadget@gmail.com","subject":"[PATCH v2 0/2] git-svn: use svn:global-ignores when creating .gitignores","fromName":"Alex Galvin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-07-18T20:47:35Z","receivedAt":"2024-07-18T20:47:40Z","isPatch":true,"sender":{"key":"agalvin@comqi.com","avatar":"https://avatars.githubusercontent.com/u/32237198?v=4"},"body":"Git-SVN does not currently use the svn:global-ignores property added in\nSubversion 1.8 when showing or creating .gitignore files. This causes\nGit-SVN to track files that are ignored by this directive in Subversion.\n\nThe following patches add svn:global-ignores to the list of public svn\nproperties, and update git svn show-ignore and git svn create-ignore to use\nthis attribute (as well as svn:ignore).\n\nAlex Galvin (2):\n  git-svn: add public property `svn:global-ignores`\n  git-svn: use `svn:global-ignores` to create .gitignore\n\n git-svn.perl    | 45 +++++++++++++++++++++++++++++++--------------\n perl/Git/SVN.pm |  2 +-\n 2 files changed, 32 insertions(+), 15 deletions(-)\n\n\nbase-commit: c2b3f2b3cdbf5ad9feb978dd367d77561a1271f7\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1747%2Fav-gal%2Fgit-svn-global-ignores-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1747/av-gal/git-svn-global-ignores-v2\nPull-Request: https://github.com/git/git/pull/1747\n\nRange-diff vs v1:\n\n 1:  27bee8de47b ! 1:  002750ea47a git-svn: add public property `svn:global-ignores`\n     @@ Metadata\n       ## Commit message ##\n          git-svn: add public property `svn:global-ignores`\n      \n     +    Subversion 1.8 added a new property `svn:global-ignores`. It\n     +    contains a list of patterns used to determine what files should\n     +    be ignored. If Git-SVN is going to ignore these files as well, it\n     +    is important that we do not skip over directories that have this\n     +    property set.\n     +\n          Signed-off-by: Alex Galvin <agalvin@comqi.com>\n      \n       ## perl/Git/SVN.pm ##\n 2:  10e240202f7 ! 2:  7735afb32af git-svn: use `svn:global-ignores` to create .gitignore\n     @@ Metadata\n       ## Commit message ##\n          git-svn: use `svn:global-ignores` to create .gitignore\n      \n     +    `svn:global-ignores` contains a list of file patterns that should\n     +    not be tracked in version control. The syntax of these patterns is\n     +    the same as `svn:ignore`. Their semantics differ: patterns in\n     +    `svn:global-ignores` apply to all paths under the directory where\n     +    they apply, while `svn:ignore` only applies to the directory's\n     +    immediate children.\n     +\n          Signed-off-by: Alex Galvin <agalvin@comqi.com>\n      \n       ## git-svn.perl ##\n\n-- \ngitgitgadget\n"},{"id":"498941","messageId":"002750ea47a09d2f26c9c7b040c6730bc3f62b10.1721335657.git.gitgitgadget@gmail.com","threadId":"61797","inReplyTo":"pull.1747.v2.git.git.1721335657.gitgitgadget@gmail.com","subject":"[PATCH v2 1/2] git-svn: add public property `svn:global-ignores`","fromName":"Alex Galvin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-07-18T20:47:36Z","receivedAt":"2024-07-18T20:47:41Z","isPatch":true,"sender":{"key":"agalvin@comqi.com","avatar":"https://avatars.githubusercontent.com/u/32237198?v=4"},"body":"From: Alex Galvin <agalvin@comqi.com>\n\nSubversion 1.8 added a new property `svn:global-ignores`. It\ncontains a list of patterns used to determine what files should\nbe ignored. If Git-SVN is going to ignore these files as well, it\nis important that we do not skip over directories that have this\nproperty set.\n\nSigned-off-by: Alex Galvin <agalvin@comqi.com>\n---\n perl/Git/SVN.pm | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\nindex 7721708ce5d..b0913ca1b63 100644\n--- a/perl/Git/SVN.pm\n+++ b/perl/Git/SVN.pm\n@@ -763,7 +763,7 @@ sub prop_walk {\n \t\t# this needs to be updated.\n \t\t++$interesting_props if /^svn:(?:ignore|keywords|executable\n \t\t                                 |eol-style|mime-type\n-\t\t\t\t\t\t |externals|needs-lock)$/x;\n+\t\t\t\t\t\t |externals|needs-lock|global-ignores)$/x;\n \t}\n \t&$sub($self, $p, $props) if $interesting_props;\n \n-- \ngitgitgadget\n\n"},{"id":"498942","messageId":"7735afb32afd601e8306635e1cb3767f3f923f43.1721335657.git.gitgitgadget@gmail.com","threadId":"61797","inReplyTo":"pull.1747.v2.git.git.1721335657.gitgitgadget@gmail.com","subject":"[PATCH v2 2/2] git-svn: use `svn:global-ignores` to create .gitignore","fromName":"Alex Galvin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-07-18T20:47:37Z","receivedAt":"2024-07-18T20:47:43Z","isPatch":true,"sender":{"key":"agalvin@comqi.com","avatar":"https://avatars.githubusercontent.com/u/32237198?v=4"},"body":"From: Alex Galvin <agalvin@comqi.com>\n\n`svn:global-ignores` contains a list of file patterns that should\nnot be tracked in version control. The syntax of these patterns is\nthe same as `svn:ignore`. Their semantics differ: patterns in\n`svn:global-ignores` apply to all paths under the directory where\nthey apply, while `svn:ignore` only applies to the directory's\nimmediate children.\n\nSigned-off-by: Alex Galvin <agalvin@comqi.com>\n---\n git-svn.perl | 45 +++++++++++++++++++++++++++++++--------------\n 1 file changed, 31 insertions(+), 14 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex b0d0a50984b..a2a46608c9b 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1279,12 +1279,20 @@ sub cmd_show_ignore {\n \t$gs->prop_walk($gs->path, $r, sub {\n \t\tmy ($gs, $path, $props) = @_;\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+\t\tif (my $s = $props->{'svn:ignore'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t$s =~ s#^#$path#gm;\n+\t\t\tprint STDOUT \"$s\\n\";\n+\t\t}\n+\t\tif (my $s = $props->{'svn:global-ignores'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t$s =~ s#^#$path**/#gm;\n+\t\t\tprint STDOUT \"$s\\n\";\n+\t\t}\n \t});\n }\n \n@@ -1315,16 +1323,25 @@ sub cmd_create_ignore {\n \t\t# which git won't track\n \t\tmkpath([$path]) unless -d $path;\n \t\tmy $ignore = $path . '.gitignore';\n-\t\tmy $s = $props->{'svn:ignore'} or return;\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.\n-\t\t$s =~ s#^#/#gm;\n-\t\tprint GITIGNORE \"$s\\n\";\n+\t\tif (my $s = $props->{'svn:ignore'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t# Prefix all patterns so that the ignore doesn't apply\n+\t\t\t# to sub-directories.\n+\t\t\t$s =~ s#^#/#gm;\n+\t\t\tprint GITIGNORE \"$s\\n\";\n+\t\t}\n+\t\tif (my $s = $props->{'svn:global-ignores'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t# Global ignores apply to sub-directories, so they are\n+\t\t\t# not prefixed.\n+\t\t\tprint GITIGNORE \"$s\\n\";\n+\t\t}\n \t\tclose(GITIGNORE)\n \t\t  or fatal(\"Failed to close `$ignore': $!\");\n \t\tcommand_noisy('add', '-f', $ignore);\n-- \ngitgitgadget\n"},{"id":"500648","messageId":"pull.1747.v3.git.git.1723481908.gitgitgadget@gmail.com","threadId":"61797","inReplyTo":"pull.1747.v2.git.git.1721335657.gitgitgadget@gmail.com","subject":"[PATCH v3 0/3] git-svn: use svn:global-ignores when creating .gitignores","fromName":"Alex Galvin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-08-12T16:58:25Z","receivedAt":"2024-08-12T16:58:32Z","isPatch":true,"sender":{"key":"agalvin@comqi.com","avatar":"https://avatars.githubusercontent.com/u/32237198?v=4"},"body":"Git-SVN does not currently use the svn:global-ignores property added in\nSubversion 1.8 when showing or creating .gitignore files. This causes\nGit-SVN to track files that are ignored by this directive in Subversion.\n\nThe following patches add svn:global-ignores to the list of public svn\nproperties, and update git svn show-ignore and git svn create-ignore to use\nthis attribute (as well as svn:ignore).\n\nAlex Galvin (3):\n  git-svn: add public property `svn:global-ignores`\n  git-svn: use `svn:global-ignores` to create .gitignore\n  git-svn: mention `svn:globalignores` in help\n\n git-svn.perl    | 49 +++++++++++++++++++++++++++++++++----------------\n perl/Git/SVN.pm |  2 +-\n 2 files changed, 34 insertions(+), 17 deletions(-)\n\n\nbase-commit: c2b3f2b3cdbf5ad9feb978dd367d77561a1271f7\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1747%2Fav-gal%2Fgit-svn-global-ignores-v3\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1747/av-gal/git-svn-global-ignores-v3\nPull-Request: https://github.com/git/git/pull/1747\n\nRange-diff vs v2:\n\n 1:  002750ea47a = 1:  002750ea47a git-svn: add public property `svn:global-ignores`\n 2:  7735afb32af = 2:  7735afb32af git-svn: use `svn:global-ignores` to create .gitignore\n -:  ----------- > 3:  18dffbe992e git-svn: mention `svn:globalignores` in help\n\n-- \ngitgitgadget\n"},{"id":"500649","messageId":"002750ea47a09d2f26c9c7b040c6730bc3f62b10.1723481908.git.gitgitgadget@gmail.com","threadId":"61797","inReplyTo":"pull.1747.v3.git.git.1723481908.gitgitgadget@gmail.com","subject":"[PATCH v3 1/3] git-svn: add public property `svn:global-ignores`","fromName":"Alex Galvin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-08-12T16:58:26Z","receivedAt":"2024-08-12T16:58:33Z","isPatch":true,"sender":{"key":"agalvin@comqi.com","avatar":"https://avatars.githubusercontent.com/u/32237198?v=4"},"body":"From: Alex Galvin <agalvin@comqi.com>\n\nSubversion 1.8 added a new property `svn:global-ignores`. It\ncontains a list of patterns used to determine what files should\nbe ignored. If Git-SVN is going to ignore these files as well, it\nis important that we do not skip over directories that have this\nproperty set.\n\nSigned-off-by: Alex Galvin <agalvin@comqi.com>\n---\n perl/Git/SVN.pm | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\nindex 7721708ce5d..b0913ca1b63 100644\n--- a/perl/Git/SVN.pm\n+++ b/perl/Git/SVN.pm\n@@ -763,7 +763,7 @@ sub prop_walk {\n \t\t# this needs to be updated.\n \t\t++$interesting_props if /^svn:(?:ignore|keywords|executable\n \t\t                                 |eol-style|mime-type\n-\t\t\t\t\t\t |externals|needs-lock)$/x;\n+\t\t\t\t\t\t |externals|needs-lock|global-ignores)$/x;\n \t}\n \t&$sub($self, $p, $props) if $interesting_props;\n \n-- \ngitgitgadget\n\n"},{"id":"500650","messageId":"7735afb32afd601e8306635e1cb3767f3f923f43.1723481908.git.gitgitgadget@gmail.com","threadId":"61797","inReplyTo":"pull.1747.v3.git.git.1723481908.gitgitgadget@gmail.com","subject":"[PATCH v3 2/3] git-svn: use `svn:global-ignores` to create .gitignore","fromName":"Alex Galvin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-08-12T16:58:27Z","receivedAt":"2024-08-12T16:58:33Z","isPatch":true,"sender":{"key":"agalvin@comqi.com","avatar":"https://avatars.githubusercontent.com/u/32237198?v=4"},"body":"From: Alex Galvin <agalvin@comqi.com>\n\n`svn:global-ignores` contains a list of file patterns that should\nnot be tracked in version control. The syntax of these patterns is\nthe same as `svn:ignore`. Their semantics differ: patterns in\n`svn:global-ignores` apply to all paths under the directory where\nthey apply, while `svn:ignore` only applies to the directory's\nimmediate children.\n\nSigned-off-by: Alex Galvin <agalvin@comqi.com>\n---\n git-svn.perl | 45 +++++++++++++++++++++++++++++++--------------\n 1 file changed, 31 insertions(+), 14 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex b0d0a50984b..a2a46608c9b 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -1279,12 +1279,20 @@ sub cmd_show_ignore {\n \t$gs->prop_walk($gs->path, $r, sub {\n \t\tmy ($gs, $path, $props) = @_;\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+\t\tif (my $s = $props->{'svn:ignore'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t$s =~ s#^#$path#gm;\n+\t\t\tprint STDOUT \"$s\\n\";\n+\t\t}\n+\t\tif (my $s = $props->{'svn:global-ignores'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t$s =~ s#^#$path**/#gm;\n+\t\t\tprint STDOUT \"$s\\n\";\n+\t\t}\n \t});\n }\n \n@@ -1315,16 +1323,25 @@ sub cmd_create_ignore {\n \t\t# which git won't track\n \t\tmkpath([$path]) unless -d $path;\n \t\tmy $ignore = $path . '.gitignore';\n-\t\tmy $s = $props->{'svn:ignore'} or return;\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.\n-\t\t$s =~ s#^#/#gm;\n-\t\tprint GITIGNORE \"$s\\n\";\n+\t\tif (my $s = $props->{'svn:ignore'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t# Prefix all patterns so that the ignore doesn't apply\n+\t\t\t# to sub-directories.\n+\t\t\t$s =~ s#^#/#gm;\n+\t\t\tprint GITIGNORE \"$s\\n\";\n+\t\t}\n+\t\tif (my $s = $props->{'svn:global-ignores'}) {\n+\t\t\t$s =~ s/[\\r\\n]+/\\n/g;\n+\t\t\t$s =~ s/^\\n+//;\n+\t\t\tchomp $s;\n+\t\t\t# Global ignores apply to sub-directories, so they are\n+\t\t\t# not prefixed.\n+\t\t\tprint GITIGNORE \"$s\\n\";\n+\t\t}\n \t\tclose(GITIGNORE)\n \t\t  or fatal(\"Failed to close `$ignore': $!\");\n \t\tcommand_noisy('add', '-f', $ignore);\n-- \ngitgitgadget\n\n"},{"id":"500651","messageId":"18dffbe992e07cc6c9ce81f53977e256c3bb1ad8.1723481908.git.gitgitgadget@gmail.com","threadId":"61797","inReplyTo":"pull.1747.v3.git.git.1723481908.gitgitgadget@gmail.com","subject":"[PATCH v3 3/3] git-svn: mention `svn:globalignores` in help","fromName":"Alex Galvin via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2024-08-12T16:58:28Z","receivedAt":"2024-08-12T16:58:34Z","isPatch":true,"sender":{"key":"agalvin@comqi.com","avatar":"https://avatars.githubusercontent.com/u/32237198?v=4"},"body":"From: Alex Galvin <alex.v.galvin@gmail.com>\n\nSigned-off-by: Alex Galvin <alex.v.galvin@gmail.com>\n---\n git-svn.perl | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex a2a46608c9b..b824011154b 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -219,7 +219,7 @@ my %cmd = (\n \t                \"Set an SVN repository to a git tree-ish\",\n \t\t\t{ 'stdin' => \\$_stdin, %cmt_opts, %fc_opts, } ],\n \t'create-ignore' => [ \\&cmd_create_ignore,\n-\t\t\t     'Create a .gitignore per svn:ignore',\n+\t\t\t     'Create a .gitignore per svn:ignore and svn:globalignores',\n \t\t\t     { 'revision|r=i' => \\$_revision\n \t\t\t     } ],\n \t'mkdirs' => [ \\&cmd_mkdirs ,\n@@ -234,7 +234,7 @@ my %cmd = (\n         'proplist' => [ \\&cmd_proplist,\n \t\t       'List all properties of a file or directory',\n \t\t       { 'revision|r=i' => \\$_revision } ],\n-\t'show-ignore' => [ \\&cmd_show_ignore, \"Show svn:ignore listings\",\n+\t'show-ignore' => [ \\&cmd_show_ignore, \"Show svn:ignore and svn:globalignores listings\",\n \t\t\t{ 'revision|r=i' => \\$_revision\n \t\t\t} ],\n \t'show-externals' => [ \\&cmd_show_externals, \"Show svn:externals listings\",\n-- \ngitgitgadget\n"},{"id":"500658","messageId":"xmqq7ccl1nn7.fsf@gitster.g","threadId":"61797","inReplyTo":"pull.1747.v3.git.git.1723481908.gitgitgadget@gmail.com","subject":"Re: [PATCH v3 0/3] git-svn: use svn:global-ignores when creating .gitignores","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2024-08-12T20:39:40Z","receivedAt":"2024-08-12T20:39:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Alex Galvin via GitGitGadget\" <gitgitgadget@gmail.com> writes:\n\n> Git-SVN does not currently use the svn:global-ignores property added in\n> Subversion 1.8 when showing or creating .gitignore files. This causes\n> Git-SVN to track files that are ignored by this directive in Subversion.\n\nTHe v2 iteration of the topic has already been merged to 'next' last\nweek, and I was hoping we were done.  Can you make it an incremental \nupdate on top of d7969a5127, which was the previous round?\n\nThanks.\n"}]}