git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Empty directories in Git: Current guidance for historical commits?
@ 2017-09-05 12:47 wafflecode
  2017-09-05 17:58 ` Torsten Bögershausen
  2017-09-05 20:31 ` Jeff King
  0 siblings, 2 replies; 4+ messages in thread
From: wafflecode @ 2017-09-05 12:47 UTC (permalink / raw)
  To: git


Hello,

Per the FAQ it's clear that Git (by current design) does not track  
empty directories:   
https://git.wiki.kernel.org/index.php/GitFaq#Can_I_add_empty_directories.3F

That's fine and I can fix that for my code going forward via the build  
system, as needed.

However I'm looking to import a fairly deep (10k+ commits) svn history  
in to Git and I'm wondering what the current best practices are for  
dealing with empty folders?   Meaning to say, I'd like to be able to  
check out an older revision of the code and have it build correctly  
using the older build system which expects certain folders to exist.

There are a few different answers floating around the net, so I  
figured I'd confirm via the mailing list.

Is just dropping a ".gitignore" or "README" file in the empty  
directories during conversion still the most reasonable approach?  If  
so, is there a way to do this automatically during the conversion  
using "git svn" or the like?


Thank you
David



-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Empty directories in Git: Current guidance for historical commits?
  2017-09-05 12:47 Empty directories in Git: Current guidance for historical commits? wafflecode
@ 2017-09-05 17:58 ` Torsten Bögershausen
  2017-09-05 22:17   ` wafflecode
  2017-09-05 20:31 ` Jeff King
  1 sibling, 1 reply; 4+ messages in thread
From: Torsten Bögershausen @ 2017-09-05 17:58 UTC (permalink / raw)
  To: wafflecode, git

On 2017-09-05 14:47, wafflecode@openmail.cc wrote:
> 
> Hello,
> 
> Per the FAQ it's clear that Git (by current design) does not track empty
> directories: 
> https://git.wiki.kernel.org/index.php/GitFaq#Can_I_add_empty_directories.3F
> 
> That's fine and I can fix that for my code going forward via the build system,
> as needed.
> 
> However I'm looking to import a fairly deep (10k+ commits) svn history in to Git
> and I'm wondering what the current best practices are for dealing with empty
> folders?   Meaning to say, I'd like to be able to check out an older revision of
> the code and have it build correctly using the older build system which expects
> certain folders to exist.
> 
> There are a few different answers floating around the net, so I figured I'd
> confirm via the mailing list.
> 
> Is just dropping a ".gitignore" or "README" file in the empty directories during
> conversion still the most reasonable approach? 

A .gitignore will, but may cost 0.001% CPU time when running "git status".
I have seen systems that create a file called ".empty" in every directory.

> If so, is there a way to do this
> automatically during the conversion using "git svn" or the like?

Not what I am aware of.
And even if, the .empty files need to be removed, once the directory is
removed.
And we don't have logic for that, as far as I know.

That would be by suggestion:
convert the repo "as is", with the tools we have.

If you need to continue to work on an old branch (or the master branch),
add the .empty file, where needed, and continue to work in Git, on
a branch as usual.


> 
> 
> Thank you
> David
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Empty directories in Git: Current guidance for historical commits?
  2017-09-05 12:47 Empty directories in Git: Current guidance for historical commits? wafflecode
  2017-09-05 17:58 ` Torsten Bögershausen
@ 2017-09-05 20:31 ` Jeff King
  1 sibling, 0 replies; 4+ messages in thread
From: Jeff King @ 2017-09-05 20:31 UTC (permalink / raw)
  To: wafflecode; +Cc: git

On Tue, Sep 05, 2017 at 12:47:43PM +0000, wafflecode@openmail.cc wrote:

> Is just dropping a ".gitignore" or "README" file in the empty directories
> during conversion still the most reasonable approach?

Yes, I think so.

> If so, is there a way
> to do this automatically during the conversion using "git svn" or the like?

I haven't used git-svn in years, but the manpage says:

  --preserve-empty-dirs
      Create a placeholder file in the local Git repository for each
      empty directory fetched from Subversion. This includes directories
      that become empty by removing all entries in the Subversion
      repository (but not the directory itself). The placeholder files
      are also tracked and removed when no longer necessary.

-Peff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Empty directories in Git: Current guidance for historical commits?
  2017-09-05 17:58 ` Torsten Bögershausen
@ 2017-09-05 22:17   ` wafflecode
  0 siblings, 0 replies; 4+ messages in thread
From: wafflecode @ 2017-09-05 22:17 UTC (permalink / raw)
  To: Torsten Bögershausen; +Cc: git


Quoting Torsten Bögershausen <tboegi@web.de>:

>> Is just dropping a ".gitignore" or "README" file in the empty  
>> directories during
>> conversion still the most reasonable approach?
>
> A .gitignore will, but may cost 0.001% CPU time when running "git status".
> I have seen systems that create a file called ".empty" in every directory.
>
>> If so, is there a way to do this
>> automatically during the conversion using "git svn" or the like?
>
> Not what I am aware of.
> And even if, the .empty files need to be removed, once the directory is
> removed.
> And we don't have logic for that, as far as I know.
>

So upon re-reading the git-svn docs, there apparently _are_  
"--preserve-empty-dirs" and "--placeholder-filename=<filename>" options.

I'm not sure how I missed these.  :-/

If I understand correctly, it sounds like exactly what I want.  i.e. a  
placeholder file being added (and tracked) to each empty folder.  Are  
there known issues or limitations to be aware of?


Thank you,
David


-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features!  
15GB disk! No bandwidth quotas!
Commercial and Bulk Mail Options!  

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-09-06  0:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-05 12:47 Empty directories in Git: Current guidance for historical commits? wafflecode
2017-09-05 17:58 ` Torsten Bögershausen
2017-09-05 22:17   ` wafflecode
2017-09-05 20:31 ` Jeff King

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).