[PATCH] Improved handling of git syntax names with no git repository

Dirk Hohndel dirk at hohndel.org
Fri Mar 14 21:01:52 PDT 2014


On Fri, 2014-03-14 at 18:00 -0700, Linus Torvalds wrote:
> From: Linus Torvalds <torvalds at linux-foundation.org>
> Date: Fri, 14 Mar 2014 17:55:07 -0700
> Subject: [PATCH] Improved handling of git syntax names with no git repository
> 
> This makes "is_git_repository()" return non-NULL for all file names that
> match the git name pattern, even if we don't find an actual git
> repository there.  That way, we won't fall back to writing out an XML
> file with an odd filename.
> 
> If there is no actual git repository, we return a special invalid dummy
> pointer, and then the git reading and writing routines will catch it and
> return the appropriate error.
> 
> Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
> ---
> 
> The 'dummy_git_repository' pointer is just so that any caller doesn't need 
> to know any internal details about git repositories etc. As far as callers 
> are concerned, the pattern is simply to call "is_git_repository()" and if 
> non-NULL pass it off to the reading/writing routines.

I'm surprised that you didn't revert e70bbb637e1d as part of your patch.
Your patch does a much better job of dealing with the case I was trying
to handle there.

/D




More information about the subsurface mailing list