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

Re: .gitignore and svn:ignore [WAS: git-svn and submodules]

From
EWEric Wong <normalperson@yhbt.net>
Date
Oct 16, 2007, 07:58 UTC
Message-ID
<20071016075827.GB32348@soma>
In-Reply-To
<20071015151405.GA1655@pe.Belkin>
Chris Shoemaker <c.shoemaker@cox.net> wrote:
Show 23 quoted lines
> On Mon, Oct 15, 2007 at 04:45:13PM +0200, Karl Hasselström wrote:
> > On 2007-10-15 09:07:21 +0200, Benoit SIGOURE wrote:
> > 
> > >   - git svn create-ignore (to create one .gitignore per directory
> > > from the svn:ignore properties. This has the disadvantage of
> > > committing the .gitignore during the next dcommit,
> > 
> > I built ignore support for git-svnignore a long time ago. It converts
> > the per-directory svn:ignore to per-directory .gitignore at commit
> > import time, which is very handy:
> > 
> > -I <ignorefile_name>::
> >         Import the svn:ignore directory property to files with this
> >         name in each directory. (The Subversion and GIT ignore
> >         syntaxes are similar enough that using the Subversion patterns
> >         directly with "-I .gitignore" will almost always just work.)
> > 
> > The only downside with that is that svn ignore patterns are
> > non-recursive, while git ignore patterns are recursive. This could be
> > solved by prefixing them with a "/".
> 
> Has anyone put any thought into mapping the other direction? 
> i.e. .gitignore  ->  svn:ignore

If we support .gitignore <-> svn:ignore in git-svn; bidirectional, transparent mapping is the only way I want to go.

This means that *all* .gitignore files will be translated to svn:ignore files and vice versa; and the .gitignore files will be NOT be committed to SVN itself, but present in the git-svn created mirrors. Recursive .gitignore definitions will be mapped to svn:ignore recursively on the client side; and non-recursive ones will only map to one directory.

Sound good?

I may be sleepy at the moment, but the thought of implementing this is sounding complicated now...

One goal of git-svn is that other users shouldn't be able to tell if a user is using git-svn or plain svn; even.

But back to submodules, I plan on mapping svn:externals <=> .gitmodules files in a similar fashion. .gitmodule files will never be seen by SVN users, period.

That being said, the first step to submodule/externals support in git-svn will be to allow /any/ git repository to use a submodule that points to SVN; and then git-submodule will invoke git-svn if it sees such a submodule.

Yes, I have a plan, sort of...

Since externals/submodules don't operate recursively in either system like .gitignore; supporting svn:externals <=> submodules will be much easier and done first[1] :)

[1] - I've personally rarely bothered with putting svn:ignores in the repository and have been very much spoiled by .git/info/exclude; whereas externals support I have semi-immediate use for.

-- 
Eric Wong
Previous: Chris ShoemakerNext: Karl Hasselström
Message 20 of 42 in “[RFC] CLI option parsing and usage generation for porcelains”
  1. Pierre HabouzitOct 13, 2007
  2. Wincent ColaiutaOct 13, 2007
  3. Eric WongOct 14, 2007
  4. Pierre HabouzitOct 14, 2007
  5. parse-options: Allow abbreviated options when unambiguousJohannes Schindelin, Oct 14, 2007
  6. Johannes SchindelinOct 14, 2007
  7. Pierre HabouzitOct 14, 2007
  8. Eric WongOct 14, 2007
  9. Johannes SchindelinOct 14, 2007
  10. Eric WongOct 14, 2007
  11. git-svn and submodules, was Re: [PATCH] parse-options: Allow abbreviated options when unambiguousJohannes Schindelin, Oct 14, 2007
  12. Benoit SIGOUREOct 15, 2007
  13. Andreas EricssonOct 15, 2007
  14. Benoit SIGOUREOct 15, 2007
  15. David KastrupOct 15, 2007
  16. Benoit SIGOUREOct 15, 2007
  17. Andreas EricssonOct 15, 2007
  18. Karl HasselströmOct 15, 2007
  19. .gitignore and svn:ignore [WAS: git-svn and submodules]Chris Shoemaker, Oct 15, 2007
  20. Eric WongOct 16, 2007
  21. Karl HasselströmOct 16, 2007
  22. Chris ShoemakerOct 16, 2007
  23. Linus TorvaldsOct 15, 2007
  24. Performance issue with excludes (was: Re: git-svn and submodules)Benoit SIGOURE, Oct 15, 2007
  25. Linus TorvaldsOct 15, 2007
  26. Benoit SIGOUREOct 15, 2007
  27. Linus TorvaldsOct 15, 2007
  28. Benoit SIGOUREOct 15, 2007
  29. Johannes SchindelinOct 13, 2007
  30. Pierre HabouzitOct 13, 2007
  31. Johannes SchindelinOct 13, 2007
  32. Pierre HabouzitOct 13, 2007
  33. Alex RiesenOct 13, 2007
  34. Pierre HabouzitOct 13, 2007
  35. Alex RiesenOct 13, 2007
  36. Pierre HabouzitOct 13, 2007
  37. Alex RiesenOct 13, 2007
  38. Pierre HabouzitOct 14, 2007
  39. Simplify usage string printingJonas Fonseca, Oct 14, 2007
  40. Pierre HabouzitOct 14, 2007
  41. Update manpages to reflect new short and long option aliasesJonas Fonseca, Oct 14, 2007
  42. Pierre HabouzitOct 14, 2007

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.