git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 1/2] svn: added: Multi line support for ignore-paths

From
LGLukas via GitGitGadget <gitgitgadget@gmail.com>
Date
Sep 11, 2020, 08:00 UTC
Message-ID
<97232523112b433a4273ff5b4c132ca4fe3cf07c.1599811217.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.834.git.git.1599811217.gitgitgadget@gmail.com>
From: Lukas <Lukas>

With this change ths user is able to ignore more than a couple of folder. The git configuration has a max char length per line, so the user is limited if he want to ignor many folders/files. With this patch the ignore-paths expression is generated by all given lines. Example: ignore-paths=.*/somefolder1/ ignore-paths=base/differentfolder2/.*

Signed-off-by: Lukas Pupka-Lipinski <lukas.pupkalipinski@lpl-mind.de>
---
 perl/Git/SVN/Fetcher.pm | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/perl/Git/SVN/Fetcher.pm b/perl/Git/SVN/Fetcher.pm
index 64e900a0e9..96b14538b0 100644
--- a/perl/Git/SVN/Fetcher.pm
+++ b/perl/Git/SVN/Fetcher.pm
@@ -31,15 +31,17 @@ sub new {
 	# override options set in an [svn-remote "..."] section
 	$repo_id = $git_svn->{repo_id};
 	my $k = "svn-remote.$repo_id.ignore-paths";
-	my $v = eval { command_oneline('config', '--get', $k) };
-	$self->{ignore_regex} = $v;
+	my @config = eval { command( 'config', '--get-all', $k ) };
+	chomp(@config);	# Replace all \n\r on the end
+	$self->{ignore_regex} = '(?:'.join('|', @config).')';
 
 	$k = "svn-remote.$repo_id.include-paths";
-	$v = eval { command_oneline('config', '--get', $k) };
-	$self->{include_regex} = $v;
+	@config = eval { command( 'config', '--get-all', $k ) };
+	chomp(@config);	# Replace all \n\r on the end
+	$self->{include_regex} = '(?:'.join('|', @config).')';
 
 	$k = "svn-remote.$repo_id.preserve-empty-dirs";
-	$v = eval { command_oneline('config', '--get', '--bool', $k) };
+	my $v = eval { command_oneline('config', '--get', '--bool', $k) };
 	if ($v && $v eq 'true') {
 		$_preserve_empty_dirs = 1;
 		$k = "svn-remote.$repo_id.placeholder-filename";
-- 
gitgitgadget
Previous: Lukas Pupka-Lipinski via GitGitGadgetNext: Lukas via GitGitGadget
Message 2 of 3 in “GitSVN: Multi line support of ignore-path, include-paths and skiping of empty commits”
  1. 0/2 GitSVN: Multi line support of ignore-path, include-paths and skiping of empty commitsLukas Pupka-Lipinski via GitGitGadget, Sep 11, 2020
  2. 1/2 svn: added: Multi line support for ignore-pathsLukas via GitGitGadget, Sep 11, 2020
  3. 2/2 sv: added: Skip commit if all files are ignoredLukas via GitGitGadget, Sep 11, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.