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

Re: [PATCH] git-svn: Allow certain refs to be ignored

From
Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Date
Oct 14, 2011, 09:24 UTC
Message-ID
<CAA01Csq9jR_C9t4PzsnpJo7wt=M_wnJVXZG2fAmrvvOgPb1SBA@mail.gmail.com>
In-Reply-To
<20111010225838.GB3828@dcvr.yhbt.net>
On Tue, Oct 11, 2011 at 12:58 AM, Eric Wong <normalperson@yhbt.net> wrote:
Show 13 quoted lines
> Junio C Hamano <gitster@pobox.com> wrote:
>> Asking Eric to comment when he has time to do so.
>>
>> I find these pattern matches that are not anchored on either side
>> somewhat disturbing (e.g. --ignore-refs=master would ignore master2)
>> but ignore-paths codepath seems to follow the same pattern, so perhaps it
>> is in line with what git-svn users want. I dunno.
>
> As stated last year, I remember wanting globs instead of regexps, but
> we already made the regexp mistake with ignore-paths, too :(
>
> I don't think it's horrible with regexps, and if git-svn users find it
> useful, it's fine by me.
In my case globs would be too limited. I'm using negative look-ahead
assertions to match only branches/tags for projects that are
interesting to me. With globs it's not possible AFAIK (I would have to
specify all ignored patterns by hand which would work only for known
patterns):
  ignore-paths = ^path/branches/(?!proj1|proj2)
Show 5 quoted lines
>> Michael Olson <mwolson@gnu.org> writes:
>> > Re-sent by request of Piotr Krukowiecki.  This is against v1.7.4.1,
>> > and I've been using it stably for a while.
>
> Michael: can you please rebase against latest and resend?  Thanks.

I've got following error while using the patch. I don't know it also happens without the patch...

	M	...
r216099 = 4d16d4890915f4c02ba541956957a4e4b4bed400
(refs/remotes/proj2/proj2-branch9)
Auto packing the repository for optimum performance. You may also
run "git gc" manually. See "git help gc" for more information.
Counting objects: 10284, done.
Compressing objects: 100% (7695/7695), done.
Writing objects: 100% (10284/10284), done.
Total 10284 (delta 5077), reused 0 (delta 0)
fatal: refs/remotes/proj1/trunk: not a valid SHA1
update-ref refs/heads/master refs/remotes/proj1/trunk: command
returned error: 128

$ git log -1 fatal: bad default revision 'HEAD' $ git log -1 trunk fatal: ambiguous argument 'trunk': unknown revision or path not in the working tree. Use '--' to separate paths from revisions $ ls .git/refs/remotes/ proj2

The commands I've used:

git svn init --prefix=proj2/ -Rproj2 -s --ignore-paths='^proj2/branches/(?!proj1|proj2)|^proj2/tags/(?!proj1|proj2)|^proj2/(?!trunk|branches|tags)' --ignore-refs='^refs/remotes/proj2/(?!proj1|proj2|trunk|tag)|^refs/remotes/proj2/tags/(?!proj1|proj2)' http://url/svn/repos/proj2 git svn init --prefix=proj1/ -Rproj1 -s --ignore-paths='^proj1/branches/(?!proj1|proj2)|^proj1/tags/(?!proj1|proj2)|^proj2/(?!trunk|branches|tags)' --ignore-refs='^refs/remotes/proj1/(?!proj1|proj2|trunk|tag)|^refs/remotes/proj1/tags/(?!proj1|proj2)' http://url/svn/repos/proj1 git svn fetch proj2 && git svn fetch proj1

The error happened while fetching proj2. I wonder why it tried to set master to proj1? Is my command ok? I want to have both proj1 and proj2 under one git repository.

-- 
Piotr Krukowiecki
Previous: Eric Wong
Message 5 of 5 in “git-svn: Allow certain refs to be ignored”
  1. git-svn: Allow certain refs to be ignoredMichael Olson, Oct 7, 2011
  2. Junio C HamanoOct 7, 2011
  3. Michael OlsonOct 7, 2011
  4. Eric WongOct 10, 2011
  5. Piotr KrukowieckiOct 14, 2011

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.