git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Problem: staging of an alternative repository
@ 2014-04-30 21:22 Pasha Bolokhov
  2014-04-30 21:35 ` Jonathan Nieder
  0 siblings, 1 reply; 7+ messages in thread
From: Pasha Bolokhov @ 2014-04-30 21:22 UTC (permalink / raw)
  To: git

        Hi

    It turns out Git treats the directory '.git' differently enough
from everything else. That may be ok, but here's one place where I
encountered an unpleasant (and imho unexpected) behaviour:

    if you supply a different repository base name, say, '.git_new',
by either setting GIT_DIR or using the '--git-dir' option, Git 'add'
will not make any exception for it and think of it as a new (weird)
directory. In particular, 'git add -A' with a consequent commit will
add this repository into itself with all its guts.

    Now I know, the '--git-dir' option may usually be meant to use
when the repository is somewhere outside of the work tree, and such a
problem would not arise. And even if it is inside, sure enough, you
can add this '.git_new' to the ignores or excludes. But is this really
what you expect?

    I come forward to offer my own will to fix this behaviour (which
is rooted in 'dir.c'). However there are uncertainties, and I'm asking
for an opinion.

    Apparently, the assumption that the repository is in '.git' has
propagated far enough. In particular, every '.git' within the working
tree seems to be ignored for the purpose of staging. Is this a
consistent behaviour? And, perhaps there are a million more places
where the name '.git' is hard-coded, and it might be reasonable to
question the legitimacy for that. Or, in contrast, to what degree or
depth (in the source code) does one *expect* Git to rename all its
hard-coded '.git's into '.gut's when a "GIT_DIR=.gut" is supplied?

   cheers
Pavel

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

end of thread, other threads:[~2014-05-19 10:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-30 21:22 Problem: staging of an alternative repository Pasha Bolokhov
2014-04-30 21:35 ` Jonathan Nieder
2014-05-02  5:23   ` Pasha Bolokhov
2014-05-02  6:20   ` Duy Nguyen
2014-05-07 20:51     ` Pasha Bolokhov
2014-05-17 16:31     ` Pasha Bolokhov
2014-05-19 10:05       ` Duy Nguyen

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 NNTP newsgroup(s).