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

Re: [PATCH 1/2] Add per-svn-remote ignore-paths config

From
EWEric Wong <normalperson@yhbt.net>
Date
Apr 11, 2009, 01:22 UTC
Message-ID
<20090411012256.GA2945@dcvr.yhbt.net>
In-Reply-To
<1239314289-36149-1-git-send-email-ben@ben.com>
Ben Jackson <ben@ben.com> wrote:
Show 10 quoted lines
> The --ignore-paths option to fetch is very useful for working on a subset
> of a SVN repository.  For proper operation, every command that causes a
> fetch (explicit or implied) must include a matching --ignore-paths option.
> 
> This patch adds a persistent svn-remote.$repo_id.ignore-paths config by
> promoting Fetcher::is_path_ignored to a member function and initializing
> $self->{ignore_regex} in Fetcher::new.  Command line --ignore-paths is
> still recognized and acts in addition to the config value.
> 
> Signed-off-by: Ben Jackson <ben@ben.com>

Hi Ben, the patch looks useful, but there are some minor issues with comments inline.

Show 9 quoted lines
> --- a/git-svn.perl
> +++ b/git-svn.perl
>  # return value: 0 -- don't ignore, 1 -- ignore
>  sub is_path_ignored {
> -	my ($path) = @_;
> +	my ($self, $path) = @_;
>  	return 1 if in_dot_git($path);
> +	return 1 if defined($self->{ignore_regex}) &&
> +	            $path =~ m!$self->{ignore_regex}!o;

Since we're making the regex per-remote, I'd remove the "o" operator. It can break things if Git::SVN::Fetcher ever gets reused by multiple SVN remotes within the same process.

Show 8 quoted lines
> --- a/t/t9134-git-svn-ignore-paths.sh
> +++ b/t/t9134-git-svn-ignore-paths.sh
> @@ -44,7 +51,7 @@ test_expect_success 'SVN-side change outside of www' '
>  test_expect_success 'update git svn-cloned repo' '
>  	(
>  		cd g &&
> -		git svn rebase --ignore-paths="^www" &&
> +		git svn rebase &&

I'd rather not change the existing tests since existing behavior can break. Instead, augment the existing tests so we test both the .git/config and command-line cases.

Thanks.
-- 
Eric Wong
Previous: Ben Jackson
Message 3 of 3 in “Add per-svn-remote ignore-paths config”
  1. 1/2 Add per-svn-remote ignore-paths configBen Jackson, Apr 9, 2009
  2. 2/2 Save init/clone --ignore-paths option as svn-remotes.svn.ignore-pathsBen Jackson, Apr 9, 2009
  3. Eric WongApr 11, 2009

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.