Commit Graph

22444 Commits

Author SHA1 Message Date
Erik Faye-Lund
7b386a8a91 mingw: fix st_mode for symlink dirs
When encountering symlinks, do_lstat() currently overwrites
buf->st_mode with S_IFREG if follow is true. This is incorrect
when the symlink points to a directory.

get_file_attr calls GetFileAttributesExA, which follows symlinks
already. So our st_mode should already be correct at this point.

Tested-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2010-06-12 13:09:31 +02:00
Erik Faye-Lund
33bc9999e9 mingw: do not hide bare repositories
As reported in msysGit issue 450 the recent change to set the windows
hidden attribute on the .git directory is being applied to bare git
directories. This patch excludes bare repositories.

Tested-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
2010-06-12 13:09:31 +02:00
Pat Thoyts
f87956d1a5 mingw: add tests for the hidden attribute on the git directory
With msysGit the .git directory is supposed to be hidden, unless it is
a bare git repository. Test this.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-06-12 13:09:31 +02:00
Pat Thoyts
1b67fa3d98 Report errors when failing to launch the html browser in mingw.
The mingw function to launch the system html browser is silent if the
target file does not exist leaving the user confused. Make it display
something.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
2010-06-12 13:09:31 +02:00
Pat Thoyts
be8fa18ce3 fix mingw stat() and lstat() implementations for handling symlinks
In msysGit the stat() function has been implemented using mingw_lstat
which sets the st_mode member to S_IFLNK when a symbolic links is found.
This causes the is_executable function to return when git attempts to
build a list of available commands in the help code and we end up missing
most git commands. (msysGit issue #445)

This patch modifies the implementation so that lstat() will return the link
flag but if we are called as stat() we read the size of the target and set
the mode to that of a regular file.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-06-12 13:09:31 +02:00
Sebastian Schuberth
0e2ea4305f gitk: Second try to work around the command line limit on Windows
The first fix caused Tcl to fail to compile the regexp, see msysGit issue
427. Here is another fix without using regexp, and using a more relaxed
command line length limit to fix the original issue 387.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-06-12 13:09:31 +02:00
Johannes Schindelin
2d2cd7a2f7 gitk: work around ridiculous command line restriction on Windows
On Windows, there are dramatic problems when a command line grows
beyond PATH_MAX, which is restricted to 8191 characters on XP and
later (according to http://support.microsoft.com/kb/830473).

Work around this by just cutting off the command line at that length
(actually, at a space boundary) in the hope that only negative
refs are chucked: gitk will then do unnecessary work, but that is
still better than flashing the gitk window and exiting with exit
status 5 (which no Windows user is able to make sense of).

This fixes msysGit issue 387.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-06-12 13:09:31 +02:00
Pat Thoyts
2397cec9e6 git-gui: Avoid using the <<Copy>> binding as a menu accelerator on win32
On Windows the Control-C binding is used to copy and is mapped to the Tk
virtual event <<Copy>>. In the initial git-gui dialog this is also bound
as an accelerator for the Clone menu item. The effect is that both bindings
run, copying the text but resetting the clone page or switching to the clone
page when the user tries to copy text from one of the entry fields.
This patch avoids this by using Control-L instead for Windows only.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-06-12 13:09:31 +02:00
Heiko Voigt
494322d776 git-gui: provide question helper for retry fallback on Windows
Make use of the new environment variable GIT_ASK_YESNO to support the
recently implemented fallback in case unlink, rename or rmdir fail for
files in use on Windows. The added dialog will present a yes/no question
to the the user which will currently be used by the windows compat layer
to let the user retry a failed file operation.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2010-06-12 13:09:30 +02:00
Heiko Voigt
feb28d7bd6 mingw: add fallback for rmdir in case directory is in use
The same logic as for unlink and rename also applies to rmdir. For
example in case you have a shell open in a git controlled folder. This
will easily fail. So lets be nice for such cases as well.

Signed-off-by: Heiko Voigt <heiko.voigt@mahr.de>
2010-06-12 13:09:30 +02:00
Heiko Voigt
488606f88f mingw: make failures to unlink or move raise a question
On Windows in case a program is accessing a file unlink or
move operations may fail. To give the user a chance to correct
this we simply wait until the user asks us to retry or fail.

This is useful because of the following use case which seem
to happen rarely but when it does it is a mess:

After making some changes the user realizes that he was on the
incorrect branch. When trying to change the branch some file
is still in use by some other process and git stops in the
middle of changing branches. Now the user has lots of files
with changes mixed with his own. This is especially confusing
on repositories that contain lots of files.

Although the recent implementation of automatic retry makes
this scenario much more unlikely lets provide a fallback as
a last resort.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2010-06-12 13:09:30 +02:00
Heiko Voigt
7d634ec251 git-gui: fix shortcut creation on cygwin
When the user tried to create a desktop icon with git gui on cygwin
wscript was complaining about an unknown option and displaying the
non-native path as such.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-06-12 13:09:30 +02:00
Heiko Voigt
4805486fee git-gui: fix PATH environment for mingw development environment
When creating a desktop shortcut from the gui the shortcut directly
starts wish with the git-gui script. In the msysgit development
environment some dll's reside in the mingw/bin directory which causes
that git can not start because libiconv2.dll is not found.

When using such a link the error is even more cryptic stating:
"child killed: unknown signal"

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-06-12 13:09:30 +02:00
Heiko Voigt
8bbb69c2f4 git-gui: fix usage of _gitworktree when creating shortcut for windows
This fixes msysGit issue 425.

Signed-off-by: Heiko Voigt <heiko.voigt@mahr.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-06-12 13:09:30 +02:00
Markus Heidelberg
617d3353d6 git-gui: fix "Explore Working Copy" for Windows again
It has already been fixed in commit 454efb47 (git-gui (Win): make
"Explore Working Copy" more robust, 2009-04-01), but has been broken in
commit 21985a11 (git-gui: handle non-standard worktree locations,
2010-01-23) by accidentally replacing too much with a new variable.

The problem can be reproduced when starting git-gui from within a
subdirectory. The solution is to convert the path name, explorer.exe is
invoked with, to a platform native name.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
2010-06-12 13:09:30 +02:00
Heiko Voigt
d2a9997bbe git-gui: check whether systems nice command works or disable it
This fixes issue 394 from msysgit. It seems that the Gnuwin32 project
provides a nice command but it returns a "not implemented" error. To
help users we now try to execute once and disable it in case it fails.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2010-06-12 13:09:30 +02:00
Heiko Voigt
b26fe1769e git-gui: fix usage of themed widgets variable
There was one forgotten global so NS was not visible to the method
which resulted in an error.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2010-06-12 13:09:30 +02:00
Pat Thoyts
105cb7d1f0 Handle failure of core.worktree to identify the working directory.
Commit 21985a11 'git-gui: handle non-standard worktree locations' attempts
to use either GIT_WORK_TREE or core.worktree to set the _gitworktree
variable but these may not be set which leads to a failure to launch
gitk to review history. Use _gitdir to set the location for a standard
git layout where the parent of the .git directory is the working tree.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-06-12 13:09:30 +02:00
Heiko Voigt
4ba03bbfec mingw: work around irregular failures of unlink on windows
If a file is opened by another process (e.g. indexing of an IDE) for
reading it is not allowed to be deleted. So in case unlink fails retry
after waiting for some time. This extends the workaround from 6ac6f878.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2010-06-12 13:09:30 +02:00
Heiko Voigt
89983a08ad mingw: move unlink wrapper to mingw.c
The next patch implements a workaround in case unlink fails on Windows.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2010-06-12 13:09:29 +02:00
Heiko Voigt
690cabb2b0 Revert "git-gui: set GIT_DIR and GIT_WORK_TREE after setup"
This reverts commit a9fa11fe5b.
2010-06-12 13:09:29 +02:00
Pat Thoyts
62fc6e27c9 Skip t1300.70 and 71 on msysGit.
These two tests fail on msysGit because /dev/null is an alias for nul on
Windows and when reading the value back from git config the alias does
not match the real filename. Also the HOME environment variable has a
unix-style path but git returns a native equivalent path for '~'.  As
these are platform-dependent equivalent results it seems simplest to
skip the test entirely.

Signed-off-by: Pat Thoyts <patthoyts <at> users.sourceforge.net>
2010-06-12 13:09:29 +02:00
Johannes Sixt
e11b40abdc criss cross rename failure workaround
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-06-12 13:09:29 +02:00
Johannes Schindelin
50cb1bfbda When initializing .git/, record the current setting of core.hideDotFiles
This is on Windows only, of course.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-06-12 13:09:29 +02:00
Erik Faye-Lund
4fea848c1d core.hidedotfiles: hide '.git' dir by default
At least for cross-platform projects, it makes sense to hide the
files starting with a dot, as this is the behavior on Unix/MacOSX.

However, at least Eclipse has problems interpreting the hidden flag
correctly, so the default is to hide only the .git/ directory.

The config setting core.hideDotFiles therefore supports not only
'true' and 'false', but also 'dotGitOnly'.

[jes: clarified the commit message, made git init respect the setting
by marking the .git/ directory only after reading the config, and added
documentation, and rebased on top of current junio/next]

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-06-12 13:09:29 +02:00
Sebastian Schuberth
5d1d100a49 MinGW: Add missing file mode bit defines
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2010-06-12 13:09:29 +02:00
Sebastian Schuberth
be64d720a7 MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2010-06-12 13:09:29 +02:00
Johannes Schindelin
afd3af3258 Avoid TAGS/tags warning from GNU Make
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-06-12 13:09:29 +02:00
Junio C Hamano
9c3410c826 Merge branch 'ld/discovery-limit-to-fs' into next
* ld/discovery-limit-to-fs:
  Revert "write-index: check and warn when worktree crosses a filesystem boundary"
2010-06-11 22:31:23 -07:00
Jeff King
30a569d1a7 Revert "write-index: check and warn when worktree crosses a filesystem boundary"
This reverts commit 52b98a7d2f.

The goal of that commit was to warn users early when their
worktree crossed filesystem boundaries. It worked by
comparing the st_dev stat information in the index, and
warning when we had more than one device.

However, the stat information may come from multiple runs,
and the st_dev field is not necessarily stable. In
particular, st_dev will change on Linux across reboots.
Index entries from the previous reboot will appear to come
from a different device, triggering a false positive.

Since this message is really only an early warning for
people who will be bit by the new
GIT_DISCOVERY_ACROSS_FILESYSTEM behavior, and because they
will get an actual error later on (when we can't find their
cross-filesystem .git directory), we can just scrap the
early warning.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-11 22:30:48 -07:00
Junio C Hamano
0f8541ccd9 Merge branch 'master' into next
* master:
  t/README: document --root option
  Makefile: default pager on AIX to "more"
  merge-recursive: demonstrate an incorrect conflict with submodule
  Makefile: default pager on AIX to "more"
2010-06-11 22:06:09 -07:00
Junio C Hamano
3499cb1ae7 Merge branch 'maint'
* maint:
  t/README: document --root option
  Makefile: default pager on AIX to "more"
2010-06-11 22:05:58 -07:00
Thomas Rast
0d4dbcd35e t/README: document --root option
We've had this option since f423ef5 (tests: allow user to specify
trash directory location, 2009-08-09).  Make it easier to look up :-)

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-11 13:49:28 -07:00
Jeff King
f4c2eb8b34 Makefile: default pager on AIX to "more"
AIX doesn't ship with "less" by default, and their "more" is
more featureful than average, so the latter is a more
sensible choice.  People who really want less can set the
compile-time option themselves, or users can set $PAGER.

Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Tor Arntsen <tor@spacetec.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-11 09:05:34 -07:00
Johannes Sixt
7d82b06d2b merge-recursive: demonstrate an incorrect conflict with submodule
When one side of a merge turns a directory into a submodule, and the other
side does not touch that directory (but has other non-conflicting changes),
then a merge should succeed. But currently, it does not; it rather fails
with a file/directory conflict.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-11 09:01:07 -07:00
Jeff King
19b9b0b220 Makefile: default pager on AIX to "more"
AIX doesn't ship with "less" by default, and their "more" is
more featureful than average, so the latter is a more
sensible choice.  People who really want less can set the
compile-time option themselves, or users can set $PAGER.

Signed-off-by: Jeff King <peff@peff.net>
Tested-by: Tor Arntsen <tor@spacetec.no>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-06-10 07:56:11 -07:00
Junio C Hamano
23b4607a6a Merge branch 'em/checkout-orphan' into next
* em/checkout-orphan:
  bash completion: add --orphan to 'git checkout'
  t3200: test -l with core.logAllRefUpdates options
  checkout --orphan: respect -l option always
  refs: split log_ref_write logic into log_ref_setup
  Documentation: alter checkout --orphan description
2010-06-07 22:15:49 -07:00
Junio C Hamano
1a8bbbbd05 Merge branch 'cc/maint-diff-CC-binary' into next
* cc/maint-diff-CC-binary:
  diff: fix "git show -C -C" output when renaming a binary file

Conflicts:
	diff.c
2010-06-07 22:15:48 -07:00
Junio C Hamano
8771aaeb59 Merge branch 'by/diff-graph' into next
* by/diff-graph:
  Make --color-words work well with --graph
  graph.c: register a callback for graph output
  Emit a whole line in one go
  diff.c: Output the text graph padding before each diff line
  Output the graph columns at the end of the commit message
  Add a prefix output callback to diff output

Conflicts:
	diff.c
2010-06-07 22:15:48 -07:00
Junio C Hamano
9780e6291f Merge branch 'ld/discovery-limit-to-fs' into next
* ld/discovery-limit-to-fs:
  write-index: check and warn when worktree crosses a filesystem boundary
2010-06-07 22:15:48 -07:00
Junio C Hamano
89277b833b Merge branch 'cb/ls-files-cdup' into next
* cb/ls-files-cdup:
  ls-files: allow relative pathspec
  quote.c: separate quoting and relative path generation
2010-06-07 22:15:47 -07:00
Junio C Hamano
6f53da4c50 Merge branch 'jc/t9129-any-utf8' into next
* jc/t9129-any-utf8:
  t9129: fix UTF-8 locale detection
2010-06-07 22:15:47 -07:00
Junio C Hamano
12383bc63c Merge branch 'rr/am-help' into next
* rr/am-help:
  git am: Remove stray error message from sed
  git am: Display some help text when patch is empty
  git am: Set cmdline globally
2010-06-07 22:15:47 -07:00
Junio C Hamano
27a57c9317 Merge branch 'bc/portable' into next
* bc/portable:
  t/aggregate-results: accomodate systems with small max argument list length
  t/t7006: ignore return status of shell's unset builtin
  t/t5150: remove space from sed script
  git-request-pull.sh: remove -e switch to shell interpreter which breaks ksh
  t/t5800: skip if python version is older than 2.5
2010-06-07 22:15:47 -07:00
Junio C Hamano
a0fef35a7b Merge branch 'ps/gitweb--browse-chrome' into next
* ps/gitweb--browse-chrome:
  git-web--browse: Add support for google chrome and chromium
2010-06-07 22:15:47 -07:00
Junio C Hamano
5e6cffee37 Merge branch 'jn/rebase-cmdline-fix' into next
* jn/rebase-cmdline-fix:
  rebase: improve error message when upstream argument is missing
2010-06-07 22:15:46 -07:00
Junio C Hamano
93cc6a9511 Merge branch 'jn/checkout-doc' into next
* jn/checkout-doc:
  Documentation/checkout: clarify description
2010-06-07 22:15:46 -07:00
Junio C Hamano
f49577f385 Merge branch 'jk/am-skip-hint' into next
* jk/am-skip-hint:
  git-am: suggest what to do with superfluous patches
2010-06-07 22:15:46 -07:00
Junio C Hamano
194e9a9b53 Merge branch 'jh/diff-index-line-abbrev' into next
* jh/diff-index-line-abbrev:
  diff.c: Ensure "index $from..$to" line contains unambiguous SHA1s

Conflicts:
	diff.c
2010-06-07 22:15:46 -07:00
Junio C Hamano
83cf3b842d Merge branch 'ab/maint-perl-use-instlibdir' into next
* ab/maint-perl-use-instlibdir:
  Makefile: remove redundant munging of @@INSTLIBDIR@@
2010-06-07 22:15:46 -07:00