Commit Graph

23489 Commits

Author SHA1 Message Date
Johannes Schindelin
3bb030015f Add a few more values for receive.denyCurrentBranch
For a long time, this developer thought that Git's insistence that
pushing into the current branch is evil was completely merited.

Just for fun, the original patch tried to show people that Git is right
there, and that it causes more trouble than it does good when Git allows
you to try to update the working tree for fast-forwards, or to detach the
HEAD, depending on some config settings.

Surprisingly, the opposite was shown.

So here is the support for two new options you can give the config
variable receive.denyCurrentBranch:

'updateInstead':
	Try to merge the working tree with the new tip of the branch
	(which can lead to really horrible merge conflicts).

'detachInstead':
	Detach the HEAD, thereby avoiding a disagreement between the
	HEAD and the index (as well as the working tree), possibly
	leaving the local user wondering how on earth her HEAD became
	so detached.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-04-08 19:38:07 +02:00
Johannes Schindelin
0fff3fe822 Replace obsolete 'diff' call with 'test_cmp'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-04-08 19:14:50 +02:00
Johannes Schindelin
65b2c099be Fix rebase of grep-O
grep no longer wants setup to be run already.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-04-08 19:13:36 +02:00
Johannes Schindelin
add8f7132e Merge remote branch 'origin/work/grep-O' into devel 2010-04-08 00:36:15 +02:00
Johannes Schindelin
4dc7d3b9f9 Work around funny CR issue
This is really a problem with shell scripts being called on msysGit,
but there are more important bugs to fix for the moment.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-04-08 00:32:36 +02:00
Johannes Schindelin
bd21d65fd3 git-am: fix absolute path logic on Windows
This fixes t4150 on msysGit.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-04-07 23:14:25 +02:00
Johannes Schindelin
890d9f2511 Rebasing merge to junio/next 2010-04-07 22:33:33 +02:00
Erik Faye-Lund
5bbaae2a6f 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-04-07 22:20:36 +02:00
Erik Faye-Lund
93c41c10cd 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-04-07 22:20:35 +02:00
Pat Thoyts
3a5cb16bc8 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-04-07 22:20:34 +02:00
Pat Thoyts
fa90864c14 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-04-07 22:20:34 +02:00
Pat Thoyts
aa2a0ce556 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-04-07 22:20:28 +02:00
Sebastian Schuberth
5756bfec1f 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-04-07 22:10:39 +02:00
Johannes Schindelin
56a4a1237f 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-04-07 22:10:39 +02:00
Pat Thoyts
c468c93eec 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-04-07 22:10:38 +02:00
Jens Lehmann
59a159417e gitk: Add shortcut Ctrl-W for closing the active window
To make the user experience between git gui and gitk more homogeneous, use
Ctrl-W in gitk too for closing the active window. When closing the main
window doquit is called for proper cleanup.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
2010-04-07 22:10:37 +02:00
Heiko Voigt
0648946884 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-04-07 22:10:37 +02:00
Heiko Voigt
cc0ee235d6 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-04-07 22:10:36 +02:00
Heiko Voigt
1095338b07 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-04-07 22:10:36 +02:00
Heiko Voigt
7aeb2e85ea 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-04-07 22:10:35 +02:00
Heiko Voigt
bee55df28b 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-04-07 22:10:34 +02:00
Heiko Voigt
661c668699 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-04-07 22:10:34 +02:00
Markus Heidelberg
b7bec05fca 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-04-07 22:09:01 +02:00
Heiko Voigt
5950d13b82 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-04-07 22:08:54 +02:00
Heiko Voigt
83338e1cba 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-04-07 22:08:54 +02:00
Pat Thoyts
eeb39261e1 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-04-07 22:08:53 +02:00
Heiko Voigt
e17d791256 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-04-07 22:08:53 +02:00
Heiko Voigt
a8a00c3393 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-04-07 22:08:50 +02:00
Heiko Voigt
1cce13c1fb Revert "git-gui: set GIT_DIR and GIT_WORK_TREE after setup"
This reverts commit a9fa11fe5b.
2010-04-07 22:07:43 +02:00
Pat Thoyts
125a0a151c 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-04-07 22:07:23 +02:00
Johannes Sixt
2b30504bf1 criss cross rename failure workaround
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-04-07 22:05:44 +02:00
Johannes Schindelin
fd198cb64c Revert "git am: accept patches downloaded from GMane"
This reverts commit 127aa63757.  As pointed
out by Junio, this patch was obsoleted by 0fcb2ca.
2010-04-07 22:02:11 +02:00
Johannes Schindelin
d6ffa16437 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-04-07 22:02:10 +02:00
Erik Faye-Lund
d4747054af 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-04-07 22:01:40 +02:00
Sebastian Schuberth
52522d24e4 MinGW: Add missing file mode bit defines
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2010-04-07 21:47:47 +02:00
Sebastian Schuberth
f2131a6dda MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2010-04-07 21:47:44 +02:00
Johannes Schindelin
10b6d8a414 Avoid TAGS/tags warning from GNU Make
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-04-07 21:43:26 +02:00
Johannes Schindelin
cf4df60f7a git am: accept patches downloaded from GMane
GMane has this wonderful feature that you can download the raw mails,
but the mails do not fully conform to the mbox format, as they do not
start with a "From ..." line.

But they start with another tell tale we can easily detect.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2010-04-07 21:41:25 +02:00
Junio C Hamano
bd88f9b107 Merge branch 'master' into next
* master:
  notes.h: declare bit field as unsigned to silence compiler complaints
2010-04-06 22:51:29 -07:00
Brandon Casey
a751b5cc96 notes.h: declare bit field as unsigned to silence compiler complaints
The IRIX MIPSPro compiler complains like this:

   cc-1107 c99: WARNING File = notes.h, Line = 215
     A signed bit field has a length of 1 bit.

           int suppress_default_notes:1;
               ^

'unsigned' is what was intended, so lets make it so.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-04-06 21:55:50 -07:00
Junio C Hamano
e6dad34530 Merge branch 'master' into next
* master:
  Git 1.7.1-rc0
2010-04-06 15:00:44 -07:00
Junio C Hamano
992c9add13 Merge branch 'sd/log-decorate' into next
* sd/log-decorate:
  log --pretty/--oneline: ignore log.decorate
2010-04-06 15:00:39 -07:00
Junio C Hamano
1b8066f52e Merge branch 'mg/notes-reflog' into next
* mg/notes-reflog:
  refs.c: Write reflogs for notes just like for branch heads
  t3301-notes: Test the creation of reflog entries
2010-04-06 15:00:39 -07:00
Junio C Hamano
537f6c7fb4 Git 1.7.1-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.1-rc0
2010-04-06 15:00:01 -07:00
Junio C Hamano
b807c524df Merge branch 'da/maint-python-startup'
* da/maint-python-startup:
  Makefile: Remove usage of deprecated Python "has_key" method
2010-04-06 14:50:47 -07:00
Junio C Hamano
4a8295f582 Merge branch 'ic/bash-completion-rpm'
* ic/bash-completion-rpm:
  RPM spec: include bash completion support
2010-04-06 14:50:47 -07:00
Junio C Hamano
ae722b4e27 Merge branch 'sb/fmt-merge-msg'
* sb/fmt-merge-msg:
  fmt-merge-msg: hide summary option
  fmt-merge-msg: remove custom string_list implementation
  string-list: add unsorted_string_list_lookup()
  fmt-merge-msg: use pretty.c routines
  t6200: test fmt-merge-msg more
  t6200: modernize with test_tick
  fmt-merge-msg: be quiet if nothing to merge
2010-04-06 14:50:46 -07:00
Junio C Hamano
3f3f8d9d09 Merge branch 'jc/conflict-marker-size'
* jc/conflict-marker-size:
  diff --check: honor conflict-marker-size attribute
2010-04-06 14:50:46 -07:00
Junio C Hamano
f9bdf9b210 Merge branch 'ef/maint-empty-commit-log'
* ef/maint-empty-commit-log:
  rev-list: fix --pretty=oneline with empty message
2010-04-06 14:50:46 -07:00
Junio C Hamano
15bf052416 Merge branch 'sg/bash-completion'
* sg/bash-completion:
  bash: completion for gitk aliases
  bash: support user-supplied completion scripts for aliases
  bash: support user-supplied completion scripts for user's git commands
  bash: improve aliased command recognition
2010-04-06 14:50:45 -07:00