git/Documentation
Johannes Schindelin f30afdabbf mingw: introduce the 'core.hideDotFiles' setting
On Unix (and Linux), files and directories whose names start with a dot
are usually not shown by default. This convention is used by Git: the
.git/ directory should be left alone by regular users, and only accessed
through Git itself.

On Windows, no such convention exists. Instead, there is an explicit flag
to mark files or directories as hidden.

In the early days, Git for Windows did not mark the .git/ directory (or
for that matter, any file or directory whose name starts with a dot)
hidden. This lead to quite a bit of confusion, and even loss of data.

Consequently, Git for Windows introduced the core.hideDotFiles setting,
with three possible values: true, false, and dotGitOnly, defaulting to
marking only the .git/ directory as hidden.

The rationale: users do not need to access .git/ directly, and indeed (as
was demonstrated) should not really see that directory, either. However,
not all dot files should be hidden by default, as e.g. Eclipse does not
show them (and the user would therefore be unable to see, say, a
.gitattributes file).

In over five years since the last attempt to bring this patch into core
Git, a slightly buggy version of this patch has served Git for Windows'
users well: no single report indicated problems with the hidden .git/
directory, and the stream of problems caused by the previously non-hidden
.git/ directory simply stopped. The bugs have been fixed during the
process of getting this patch upstream.

Note that there is a funny quirk we have to pay attention to when
creating hidden files: we use Win32's _wopen() function which
transmogrifies its arguments and hands off to Win32's CreateFile()
function. That latter function errors out with ERROR_ACCESS_DENIED (the
equivalent of EACCES) when the equivalent of the O_CREAT flag was passed
and the file attributes (including the hidden flag) do not match an
existing file's. And _wopen() accepts no parameter that would be
transmogrified into said hidden flag. Therefore, we simply try again
without O_CREAT.

A slightly different method is required for our fopen()/freopen()
function as we cannot even *remove* the implicit O_CREAT flag.
Therefore, we briefly mark existing files as unhidden when opening them
via fopen()/freopen().

The ERROR_ACCESS_DENIED error can also be triggered by opening a file
that is marked as a system file (which is unlikely to be tracked in
Git), and by trying to create a file that has *just* been deleted and is
awaiting the last open handles to be released (which would be handled
better by the "Try again?" logic, a story for a different patch series,
though). In both cases, it does not matter much if we try again without
the O_CREAT flag, read: it does not hurt, either.

For details how ERROR_ACCESS_DENIED can be triggered, see
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858

Original-patch-by: Erik Faye-Lund <kusmabite@gmail.com>
Initial-Test-By: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-05-11 13:54:53 -07:00
..
RelNotes Git 2.8 2016-03-28 12:19:45 -07:00
howto
…
technical Merge branch 'jk/tighten-alloc' 2016-02-26 13:37:16 -08:00
.gitattributes
…
.gitignore
…
CodingGuidelines add DEVELOPER makefile knob to check for acknowledged warnings 2016-02-25 12:49:45 -08:00
Makefile
…
SubmittingPatches
…
asciidoc.conf
…
blame-options.txt Merge branch 'ea/blame-progress' 2016-01-12 15:16:54 -08:00
build-docdep.perl
…
cat-texi.perl
…
cmd-list.perl
…
config.txt mingw: introduce the 'core.hideDotFiles' setting 2016-05-11 13:54:53 -07:00
date-formats.txt
…
diff-config.txt
…
diff-format.txt
…
diff-generate-patch.txt
…
diff-options.txt Documentation/diff: give --word-diff-regex=. example 2015-11-24 18:38:46 -05:00
docbook-xsl.css
…
docbook.xsl
…
everyday.txto
…
fetch-options.txt Merge branch 'ew/force-ipv4' 2016-02-24 13:25:54 -08:00
fix-texi.perl
…
fmt-merge-msg-config.txt
…
git-add.txt git-add doc: do not say working directory when you mean working tree 2016-01-21 09:06:35 -08:00
git-am.txt Expand documentation describing --signoff 2016-01-05 13:42:39 -08:00
git-annotate.txt
…
git-apply.txt
…
git-archimport.txt
…
git-archive.txt
…
git-bisect-lk2009.txt Merge branch 'jk/asciidoctor-section-heading-markup-fix' into maint 2015-10-16 14:32:53 -07:00
git-bisect.txt Merge branch 'xf/user-manual-markup' into maint 2015-11-04 14:20:47 -08:00
git-blame.txt blame: add support for --[no-]progress option 2015-12-16 10:18:34 -08:00
git-branch.txt Merge branch 'kn/for-each-branch' 2015-10-15 15:43:38 -07:00
git-bundle.txt transport: drop support for git-over-rsync 2016-02-01 13:07:41 -08:00
git-cat-file.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-check-attr.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-check-ignore.txt Revert "Merge branch 'nd/exclusion-regression-fix'" 2016-03-18 11:06:15 -07:00
git-check-mailmap.txt
…
git-check-ref-format.txt Merge branch 'nd/doc-check-ref-format-typo' into maint 2015-12-11 11:14:15 -08:00
git-checkout-index.txt
…
git-checkout.txt checkout: add --progress option 2015-11-01 14:08:17 -08:00
git-cherry-pick.txt Expand documentation describing --signoff 2016-01-05 13:42:39 -08:00
git-cherry.txt
…
git-citool.txt
…
git-clean.txt Documentation/git-clean.txt: don't mention deletion of .git/modules/* 2016-02-09 10:07:34 -08:00
git-clone.txt Merge branch 'jk/drop-rsync-transport' 2016-02-17 10:13:28 -08:00
git-column.txt
…
git-commit-tree.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-commit.txt Expand documentation describing --signoff 2016-01-05 13:42:39 -08:00
git-config.txt Merge branch 'ls/config-origin' 2016-02-26 13:37:17 -08:00
git-count-objects.txt
…
git-credential-cache--daemon.txt
…
git-credential-cache.txt credential-cache--daemon: disallow relative socket path 2016-02-23 12:56:27 -08:00
git-credential-store.txt
…
git-credential.txt
…
git-cvsexportcommit.txt
…
git-cvsimport.txt
…
git-cvsserver.txt
…
git-daemon.txt
…
git-describe.txt Merge branch 'sg/describe-contains' 2015-08-31 15:39:10 -07:00
git-diff-files.txt
…
git-diff-index.txt
…
git-diff-tree.txt
…
git-diff.txt
…
git-difftool.txt
…
git-fast-export.txt
…
git-fast-import.txt Merge branch 'mh/fast-import-get-mark' 2015-08-03 11:01:23 -07:00
git-fetch-pack.txt
…
git-fetch.txt Merge branch 'jc/em-dash-in-doc' into maint 2015-11-04 14:20:45 -08:00
git-filter-branch.txt
…
git-fmt-merge-msg.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-for-each-ref.txt Merge branch 'kn/ref-filter-atom-parsing' 2016-02-26 13:37:10 -08:00
git-format-patch.txt Merge branch 'dw/signoff-doc' into maint 2016-02-05 14:54:09 -08:00
git-fsck-objects.txt
…
git-fsck.txt fsck: introduce `git fsck --connectivity-only` 2015-06-23 14:27:37 -07:00
git-gc.txt Merge branch 'jc/doc-gc-prune-now' into maint 2015-10-20 15:22:40 -07:00
git-get-tar-commit-id.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-grep.txt Merge branch 'tg/grep-no-index-fallback' 2016-01-20 11:43:39 -08:00
git-gui.txt
…
git-hash-object.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-help.txt
…
git-http-backend.txt Merge branch 'jk/http-backend-deadlock' into maint 2015-06-16 14:33:45 -07:00
git-http-fetch.txt
…
git-http-push.txt
…
git-imap-send.txt
…
git-index-pack.txt
…
git-init-db.txt
…
git-init.txt
…
git-instaweb.txt
…
git-interpret-trailers.txt interpret-trailers: add option for in-place editing 2016-01-14 12:22:17 -08:00
git-log.txt log: Update log.follow doc and add to config.txt 2015-10-07 10:37:48 -07:00
git-ls-files.txt documentation: fix some typos 2016-03-03 13:43:36 -08:00
git-ls-remote.txt ls-remote: add support for showing symrefs 2016-01-19 10:07:56 -08:00
git-ls-tree.txt
…
git-mailinfo.txt
…
git-mailsplit.txt
…
git-merge-base.txt
…
git-merge-file.txt merge-file: clamp exit code to maximum 127 2015-10-29 12:10:23 -07:00
git-merge-index.txt
…
git-merge-one-file.txt
…
git-merge-tree.txt
…
git-merge.txt Merge branch 'mm/keyid-docs' into maint 2015-10-16 14:32:33 -07:00
git-mergetool--lib.txt
…
git-mergetool.txt
…
git-mktag.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-mktree.txt
…
git-mv.txt
…
git-name-rev.txt
…
git-notes.txt Merge branch 'jk/notes-dwim-doc' into maint 2015-10-16 14:32:40 -07:00
git-p4.txt Documentation: fix git-p4 AsciiDoc formatting 2016-03-23 10:09:11 -07:00
git-pack-objects.txt
…
git-pack-redundant.txt
…
git-pack-refs.txt
…
git-parse-remote.txt
…
git-patch-id.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-prune-packed.txt
…
git-prune.txt worktree: new place for "git prune --worktrees" 2015-06-29 08:48:44 -07:00
git-pull.txt pull: allow interactive rebase with --rebase=interactive 2016-01-13 12:59:15 -08:00
git-push.txt Merge branch 'mm/push-simple-doc' into maint 2016-03-10 11:13:44 -08:00
git-quiltimport.txt git-quiltimport: add commandline option --series <file> 2015-09-01 11:10:07 -07:00
git-read-tree.txt
…
git-rebase.txt Documentation: reword rebase summary 2016-03-02 15:37:50 -08:00
git-receive-pack.txt
…
git-reflog.txt git-reflog: add exists command 2015-07-21 14:08:14 -07:00
git-relink.txt
…
git-remote-ext.txt
…
git-remote-fd.txt
…
git-remote-helpers.txto
…
git-remote-testgit.txt
…
git-remote.txt Merge branch 'xf/user-manual-markup' into maint 2015-11-04 14:20:47 -08:00
git-repack.txt transport: drop support for git-over-rsync 2016-02-01 13:07:41 -08:00
git-replace.txt
…
git-request-pull.txt doc: show usage of branch description 2015-09-14 12:50:33 -07:00
git-rerere.txt
…
git-reset.txt
…
git-rev-list.txt Merge branch 'jk/date-local' 2015-10-05 12:30:13 -07:00
git-rev-parse.txt rev-parse --parseopt: allow [*=?!] in argument hints 2015-07-15 10:30:54 -07:00
git-revert.txt Expand documentation describing --signoff 2016-01-05 13:42:39 -08:00
git-rm.txt
…
git-send-email.txt sendemail: teach git-send-email to dump alias names 2015-11-20 08:02:06 -05:00
git-send-pack.txt push: support signing pushes iff the server supports it 2015-08-19 12:58:45 -07:00
git-sh-i18n--envsubst.txt
…
git-sh-i18n.txt
…
git-sh-setup.txt
…
git-shell.txt
…
git-shortlog.txt
…
git-show-branch.txt
…
git-show-index.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-show-ref.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-show.txt
…
git-stage.txt
…
git-stash.txt stash: allow "stash show" diff output configurable 2015-08-31 11:29:04 -07:00
git-status.txt Documentation: explain optional arguments better 2015-09-21 10:48:23 -07:00
git-stripspace.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-submodule.txt document submodule sync --recursive 2015-12-04 13:08:05 -08:00
git-svn.txt git-svn: loosen config globs limitations 2016-03-15 01:35:38 +00:00
git-symbolic-ref.txt
…
git-tag.txt tag: do not show ambiguous tag names as "tags/foo" 2016-01-26 13:34:10 -08:00
git-tools.txt Documentation/git-tools: retire manually-maintained list 2015-07-28 13:21:59 -07:00
git-unpack-file.txt
…
git-unpack-objects.txt usage: do not insist that standard input must come from a file 2015-10-16 15:27:52 -07:00
git-update-index.txt config: add core.untrackedCache 2016-01-27 12:30:00 -08:00
git-update-ref.txt update-ref and tag: add --create-reflog arg 2015-07-21 14:08:35 -07:00
git-update-server-info.txt
…
git-upload-archive.txt Documentation: match underline with the text 2015-10-22 10:16:12 -07:00
git-upload-pack.txt
…
git-var.txt
…
git-verify-commit.txt verify-commit: add option to print raw gpg status information 2015-06-22 14:20:47 -07:00
git-verify-pack.txt
…
git-verify-tag.txt verify-tag: add option to print raw gpg status information 2015-06-22 14:20:47 -07:00
git-web--browse.txt
…
git-whatchanged.txt
…
git-worktree.txt worktree: stop supporting moving worktrees manually 2016-01-22 14:28:42 -08:00
git-write-tree.txt
…
git.txt Git 2.8 2016-03-28 12:19:45 -07:00
gitattributes.txt userdiff: add support for Fountain documents 2015-07-23 14:44:51 -07:00
gitcli.txt
…
gitcore-tutorial.txt transport: drop support for git-over-rsync 2016-02-01 13:07:41 -08:00
gitcredentials.txt
…
gitcvs-migration.txt
…
gitdiffcore.txt
…
giteveryday.txt Documentation/everyday: match undefline with the text 2015-10-22 10:14:44 -07:00
gitglossary.txt
…
githooks.txt Documentation: fix broken linkgit to git-config 2016-03-21 13:31:57 -07:00
gitignore.txt Revert "Merge branch 'nd/exclusion-regression-fix'" 2016-03-18 11:06:15 -07:00
gitk.txt
…
gitmodules.txt
…
gitnamespaces.txt
…
gitremote-helpers.txt gitremote-helpers.txt: document pushcert option 2015-08-19 12:41:38 -07:00
gitrepository-layout.txt Documentation/git-worktree: wordsmith worktree-related manpages 2015-07-20 11:07:18 -07:00
gitrevisions.txt Documentation: match underline with the text 2015-10-22 10:16:12 -07:00
gittutorial-2.txt
…
gittutorial.txt transport: drop support for git-over-rsync 2016-02-01 13:07:41 -08:00
gitweb.conf.txt Merge branch 'tf/gitweb-typofix' 2015-07-21 12:45:27 -07:00
gitweb.txt
…
gitworkflows.txt
…
glossary-content.txt Merge branch 'ss/user-manual' into maint 2016-02-05 14:54:19 -08:00
howto-index.sh
…
i18n.txt Documentation/i18n.txt: clarify character encoding support 2015-07-01 14:55:53 -07:00
install-doc-quick.sh
…
install-webdoc.sh
…
line-range-format.txt
…
mailmap.txt
…
manpage-1.72.xsl
…
manpage-base-url.xsl.in
…
manpage-base.xsl
…
manpage-bold-literal.xsl
…
manpage-normal.xsl
…
manpage-quote-apos.xsl
…
manpage-suppress-sp.xsl
…
merge-config.txt Merge branch 'sg/merge-summary-config' into maint 2015-06-25 11:02:17 -07:00
merge-options.txt
…
merge-strategies.txt merge-strategies.txt: fix typo 2016-02-22 10:42:52 -08:00
pretty-formats.txt rev-list: make it obvious that we do not support notes 2015-08-24 10:33:15 -07:00
pretty-options.txt notes: allow treeish expressions as notes ref 2016-01-12 15:10:01 -08:00
pull-fetch-param.txt
…
rev-list-options.txt Merge branch 'jk/date-local' 2015-10-05 12:30:13 -07:00
revisions.txt Merge branch 'wp/sha1-name-negative-match' 2016-02-10 14:20:10 -08:00
sequencer.txt
…
urls-remotes.txt Documentation: match underline with the text 2015-10-22 10:16:12 -07:00
urls.txt transport: drop support for git-over-rsync 2016-02-01 13:07:41 -08:00
user-manual.conf
…
user-manual.txt documentation: fix some typos 2016-03-03 13:43:36 -08:00