git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] svn: fix path strip for branches
@ 2025-10-31 13:26 Pavel Dydyshko via GitGitGadget
  2025-11-06 19:23 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Dydyshko via GitGitGadget @ 2025-10-31 13:26 UTC (permalink / raw)
  To: git; +Cc: Pavel Dydyshko, Pavel Dydyshka

From: Pavel Dydyshka <paul.dydyshko@gmail.com>

When checking path against ignore-include regexps $path argument is
given relatively to svn repo root. This results in unwanted prefix which
is path to svn branch location and should be stripped before testing
path against ignore-include regexps

Signed-off-by: Pavel Dydyshka <paul.dydyshko@gmail.com>
---
    svn: fix path strip for branches

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2087%2Fpddshk%2Fsvn-fix-strip-path-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2087/pddshk/svn-fix-strip-path-v1
Pull-Request: https://github.com/git/git/pull/2087

 perl/Git/SVN/Fetcher.pm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/perl/Git/SVN/Fetcher.pm b/perl/Git/SVN/Fetcher.pm
index 968309e6d6..5ac8c71a3d 100644
--- a/perl/Git/SVN/Fetcher.pm
+++ b/perl/Git/SVN/Fetcher.pm
@@ -123,6 +123,10 @@ sub in_dot_git {
 # This will also check whether the path is explicitly included
 sub is_path_ignored {
 	my ($self, $path) = @_;
+	if ($self->{path_strip}) {
+		$path =~ s/$self->{path_strip}//;
+		$path =~ s{^/}{};
+	}
 	return 1 if in_dot_git($path);
 	return 1 if defined($self->{ignore_regex}) &&
 	            $path =~ m!$self->{ignore_regex}!;

base-commit: 419c72cb8ada252b260efc38ff91fe201de7c8c3
-- 
gitgitgadget

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

* Re: [PATCH] svn: fix path strip for branches
  2025-10-31 13:26 [PATCH] svn: fix path strip for branches Pavel Dydyshko via GitGitGadget
@ 2025-11-06 19:23 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2025-11-06 19:23 UTC (permalink / raw)
  To: Pavel Dydyshko via GitGitGadget; +Cc: git, Pavel Dydyshko

Pavel Dydyshko via GitGitGadget <gitgitgadget@gmail.com> wrote:
>  perl/Git/SVN/Fetcher.pm | 4 ++++
>  1 file changed, 4 insertions(+)

Can you please include tests for this and your other change
for multi-line support in
<pull.2091.git.git.1761917197824.gitgitgadget@gmail.com>?

It's difficult to do any maintainence or updates on `git svn'
without tests, especially since SVN is far less common nowadays
with few remaining users.  Thanks.

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

end of thread, other threads:[~2025-11-06 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-31 13:26 [PATCH] svn: fix path strip for branches Pavel Dydyshko via GitGitGadget
2025-11-06 19:23 ` Eric Wong

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).