git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Lukas via GitGitGadget" <gitgitgadget@gmail.com>
To: git@vger.kernel.org
Cc: Lukas <Lukas@vger.kernel.org>
Subject: [PATCH 1/2] svn: added: Multi line support for ignore-paths
Date: Fri, 11 Sep 2020 08:00:16 +0000	[thread overview]
Message-ID: <97232523112b433a4273ff5b4c132ca4fe3cf07c.1599811217.git.gitgitgadget@gmail.com> (raw)
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


  reply	other threads:[~2020-09-11  8:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11  8:00 [PATCH 0/2] GitSVN: Multi line support of ignore-path, include-paths and skiping of empty commits Lukas Pupka-Lipinski via GitGitGadget
2020-09-11  8:00 ` Lukas via GitGitGadget [this message]
2020-09-11  8:00 ` [PATCH 2/2] sv: added: Skip commit if all files are ignored Lukas via GitGitGadget

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=97232523112b433a4273ff5b4c132ca4fe3cf07c.1599811217.git.gitgitgadget@gmail.com \
    --to=gitgitgadget@gmail.com \
    --cc=Lukas@vger.kernel.org \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).