git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / 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
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

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://ou63pmih66umazou.onion/inbox.comp.version-control.git
	nntp://czquwvybam4bgbro.onion/inbox.comp.version-control.git
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for the project(s) associated with this inbox:

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

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git