All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pavel Dydyshko via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Pavel Dydyshko <paul.dydyshko@gmail.com>,
	Pavel Dydyshka <paul.dydyshko@gmail.com>
Subject: [PATCH] svn: fix path strip for branches
Date: Fri, 31 Oct 2025 13:26:21 +0000	[thread overview]
Message-ID: <pull.2087.git.git.1761917181558.gitgitgadget@gmail.com> (raw)

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

             reply	other threads:[~2025-10-31 13:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-31 13:26 Pavel Dydyshko via GitGitGadget [this message]
2025-11-06 19:23 ` [PATCH] svn: fix path strip for branches Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=pull.2087.git.git.1761917181558.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=paul.dydyshko@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.