On Tue, Dec 15, 2009 at 9:57 PM, Junio C Hamano <
git...@pobox.com> wrote:
>
msy...@googlecode.com writes:
>
>> Comment #16 on issue 288 by kusmabite: git init should make .git
>> directory hidden
http://code.google.com/p/msysgit/issues/detail?id=288
>>
>> matthiasmueller75: We didn't ask you - it's not a bug. You don't agree
>> that it's a good feature, but I can assure you it was certainly made
>> intentionally
>>
>> First of all, this convention was borrowed from Unix, where all files
>> starting with a dot is invisible by default - so why is it all of a
>> sudden "never going to be ok" to do it on Windows (with an option to
>> disable it, might I add) when it's always done on Unix?
>>
>> Second, you're putting the blame at the wrong place - if your
>> development environment can't handle hidden files, then it's the one
>> that is broken (IMO). And again, we DO have a work-around -
>> core.hideDotFiles. It's not US "wasting" your time, it's the ones who
>> made your development environment.
>
> It may have been done intentionally, but this makes me
> suspect that it was a bad decision.
>
I'm not completely convinced making hiding dotfiles the default was
the best solution either, but complaints came from the other camp
before this change as well. I don't think this is something that
everyone will agree on, ever.
FWIW, SVN hides the .svn-folders, but not other dotfiles. Perhaps this
is a good thing to follow as a default?
> I am not sure that this statement
>
> 'ls' on Unix by default does not show .gitignore in its
> output; you have to ask for 'ls -a' to see it.
>
> should logically lead to
>
> hence we mark .gitigore hidden on Windows.
>
No, but it doesn't limit itself to 'ls' - at least also Nautilus does this.
> For people who live in the command line world, it literally
> is just a matter of three extra keystrokes " -a" (and you
> can even alias "ls" to "ls -A"). I don't know if you can
> equally easily defeat the "hidden-ness" of a file in the
> Windows world per-invocation basis. Can you?
>
Yes there is, "dir /h". It does the exact same thing as "ls -a" does.
I don't think e.g Nautilus has a simple way to show hidden files per
invocation either, but I might be wrong.
I'd also like to argue that any sane developer has "show hidden
files"-enabled... but then again, I write code with visible
white-space enabled. Perhaps I'm just a control-freak.
> If there isn't an easy way to do so, then "this was a
> convention borrowed from Unix" argument does not hold water.
> "We wanted to borrow the convention from Unix but couldn't
> do a good job due to platform limitations" may only hurt
> Windows users without giving real benefit of the convention
> Unix users enjoy.
>
> When I say "platform limitations" I don't necessarily mean
> to dis Windows. The native conventions used over there may
> be different from Unix conventions, and some development
> tools (like the one Matthias seems to be having trouble
> with) that follow the Windows conventions may not work well
> with the way you emulate "ls without -a hides .gitignore"
> on Unix with "mark files hidden" on Windows.
>
> That brings us to your second point. That way of emulating
> dotfile semantics was chosen by msysgit, not by Windows nor
> the development environment Matthias uses. It looks an
> msysgit issue to me.
>
There isn't any global "hidden files are special in any other way than
not visible from the user interface (unless overridden)"-semantic in
Windows, so I'm still thinking this is very much a development
environment issue. I'm assuming this is about the
Eclipse-won't-write-files-that-are-hidden crap that was reported just
a couple of days ago. Sorry, but the hidden flag and the read-only
flag is not the same thing in Windows - this one is on Eclipse's
hands. We have a work-around, so I'm not loosing much sleep about it,
at least not until anyone comes up with a compelling argument.
See
http://msdn.microsoft.com/en-us/library/ee332330(VS.85).aspx for
documentation on the attributes.
Of course, if I'm misunderstanding the issue and this isn't related to
Eclipse's brokenness, I'm sorry.
> Would it be an option not to emulate "'.gitignore' is not
> shown by ls without -a" on Windows at all? After all, it
> doesn't look like something msysgit _should_ be solving to
> begin with. Why should files starting with a dot that
> happen to be under source control by git be hidden, while
> the ones inside "C:\My Documents\" that is not under git are
> not hidden?
>
Personally, I'm not a big user of this feature - I have the "show
hidden files"-option enabled on all my machines. However, I do like
the ".git-folder's labels are grey instead of black"-effect in
explorer, as it makes easier for me to filter out what not to look at.
I'd say adding a "hide .git-folder" (and possibly also .gitignore etc)
setting to core.hidedotfiles and making that the new default would
make the most sense. That way, novice users won't start messing around
with the internal git-data structures (unless he really knows what
he's doing), and users get to see all their version-controlled files.
As a nice bonus for Eclipse-users, they won't have to learn how to
patch Eclipse in order to get real work done.
I'm guessing the ".git"-folder name was chosen because it's hidden in
Unix, right? At least the .git-folder is supposed to be completely
maintained by git (not that it really is in practice, at least not
yet), so it makes sense to me to hide it by default.
Perhaps this is a sensible middle-ground, hm?
--
Erik "kusma" Faye-Lund