Commit Graph

35411 Commits

Author SHA1 Message Date
Johannes Schindelin
0fcec1c90d git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 23:25:47 -05:00
Heiko Voigt
b150e8cb1f 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>
2012-05-11 23:25:46 -05:00
Johannes Schindelin
6eae55b9ba git am: ignore dirty submodules
This fixes a rebase in the presence of dirty submodules. This is
orthogonal to the application of patches changing submodules.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 23:25:46 -05:00
Heiko Voigt
f474d924b3 Revert "git-gui: set GIT_DIR and GIT_WORK_TREE after setup"
This reverts commit a9fa11fe5b.
2012-05-11 23:25:46 -05:00
Johannes Sixt
50b7ec9795 criss cross rename failure workaround
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 23:25:46 -05:00
Matthieu Moy
cc36606c88 bash-completion: don't add quoted space for ZSH (fix regression)
Commit a31e626 (completion: optimize refs completion) introduced a
regression for ZSH users: ref names were completed with a quoted trailing
space (i.e. "git checkout ma" completes to "git checkout master\ "). The
space is convenient for bash users since we use "-o nospace", but a
quoted space is worse than nothing. The absence of trailing space for ZSH
is a long-standing issue, that this patch is not fixing. We just fix the
regression by not appending a space when the shell is ZSH.

Original-patch-by: SZEDER Gábor <szeder@ira.uka.de>
Reported-by: Stefan Haller <lists@haller-berlin.de>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-05-11 23:25:46 -05:00
Pat Thoyts
f13fa8757a 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>
2012-05-11 23:25:46 -05:00
Erik Faye-Lund
c96eaac51c 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>
2012-05-11 23:25:46 -05:00
Johannes Schindelin
724566976c 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>
2012-05-11 23:25:46 -05:00
Erik Faye-Lund
e384376961 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>
2012-05-11 23:25:46 -05:00
Johannes Schindelin
319c67e67f Define NO_GETTEXT for Git for Windows
The dreaded "your vnsprintf is broken (returned -1)" error is back. At
least with the libintl version we have. So for the moment, just work
around the issue by _not_ using gettext.

Ah, I wish that my attempt at implementing a custom strbuf_vaddf() would
not have been brushed aside so rashly. Oh well. Time saved on maintaining
that thing, I guess (although more time went into working around coping
with existing implementations).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 23:25:46 -05:00
Sebastian Schuberth
883ba42d61 Makefile: Do not use OLD_ICONV on MINGW anymore
We are building libiconv now the same way as upstream MinGW does, so we do
not need OLD_ICONV anymore when compiling Git either in msysGit or
mingwGitDevEnv.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2012-05-11 23:25:46 -05:00
Johannes Schindelin
13280df1dd Do not compile compat/**/*.c with -Wold-style-definition
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 23:25:46 -05:00
Johannes Schindelin
348cad8551 Make CFLAGS more strict
This is a gcc-ism, but as we use gcc exclusively, we can use them.

Taken from one of Junio's mails. (Reminded to cherry-pick this patch
by one of Karsten Blees' mails.)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 23:25:46 -05:00
Johannes Schindelin
692b345be3 Start the merging-rebase to junio/next
This commit starts the rebase of ec1752b to 830d0c2
using the rebasing merge dca8a93615.
2012-05-11 23:25:46 -05:00
Johannes Schindelin
ec1752b417 Fix invalid call to dd(1)
t4012 assumed that it is okay to seek beyond the end of stdin. It is not,
and leads to an access violation (Windows speak for: segmentation fault)
with MinGW's dd.exe iff run in non-verbose mode.

Further, for some reason 'echo X | dd bs=1k seek=1' resulted in 2050 bytes
in this developer's setup instead of 1026.

So let's use a valid technique to generate 1024 NULs followed by X and a
line feed: a good ole' Perl script.

This patch is dedicated to Randal "Merlyn" Schwartz.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 21:11:47 -05:00
Johannes Schindelin
dca8a93615 Rebasing merge to junio/next (830d0c2)
Previous rebasing merge: 33362bc4c7
2012-05-11 17:53:33 -05:00
Olivier Refalo
cb9077b049 POSIX style 2/2 2012-05-11 17:51:11 -05:00
Olivier Refalo
967b1b84bb POSIX style 1/2 2012-05-11 17:51:11 -05:00
Olivier Refalo
6cd0c5d1b3 fix build: compat/mingw.c:1236: error: conflicting types for 'mingw_execv'
compat/../compat/mingw.h:294: note: previous declaration of 'mingw_execv' was here
make: *** [compat/mingw.o] Error 1
2012-05-11 17:51:11 -05:00
Michael J Gruber
2f463713c6 t5801: skip without hg
The tests for remote-hg require hg, so skip them all when there is no
hg available.
2012-05-11 17:51:11 -05:00
Johannes Schindelin
5caafa8f5b fast-export: report SHA-1 instead of gibberish when marks exist already
Cc: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 17:51:11 -05:00
Johannes Schindelin
1542f51e1e Always auto-gc after calling a fast-import transport
After importing anything with fast-import, we should always let the
garbage collector do its job, since the objects are written to disk
inefficiently.

This brings down an initial import of http://selenic.com/hg from about
230 megabytes to about 14.

In the future, we may want to make this configurable on a per-remote
basis, or maybe teach fast-import about it in the first place.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 17:51:11 -05:00
Johannes Schindelin
e3705f658e remote-hg: do not interfer with hg's revs() method
Matt Mackall introduced a revs() method to the localrepo class on Wed
Nov 2 13:37:34 2011 in the commit 'localrepo: add revs helper method'.
It is used when constructing a commit in memory.

If we store the set of revs we want to handle under the same name, it
overrides that method, resulting in an unpleasant 'TypeError: 'set'
object is not callable' whenever we want to push (as we are constructing
commits in memory, then).

So let's work around that by renaming our field to 'revs_' and hope that
upstream Mercurial does not introduce a field of that name, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 17:50:55 -05:00
Johannes Schindelin
0dc6202322 remote-hg: handle another funny author line from http://scelenic.com/hg
In this case: David Soria Parra <dsp <at> php.net>.

With this last of three Postel patches, remote-hg can import the
Mercurial repository completely.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 17:50:05 -05:00
Johannes Schindelin
472200fa11 remote-hg: another case of Postel's law
This change allows invalid input from Mercurial repositories where the
author is recorded as 'Name <email@blah' (missing the closing '>').

With this change, importing http://scelenic.com/hg itself no longer fails
with:

	fatal: Missing > in ident string: Benoit Boissinot
	<benoit.boissinot@ens-lyon.org <none@none> 1129685868 -0700

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 17:50:05 -05:00
Johannes Schindelin
a67df35847 remote-hg: Postel's law dictates we should handle Author<author@mail>
We should handle a missing space before the email part of an author ident
gracefully. See for example the icedtea6 repository.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 17:50:05 -05:00
Sverre Rabbelier
d149b7ae6b git-remote-hg: add tests 2012-05-11 17:50:05 -05:00
Sverre Rabbelier
a29ee1b165 git-remote-hg: add the helper
The helper uses the previously added infrastructure.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
2012-05-11 17:50:05 -05:00
Michael J Gruber
22f72bb8d0 remote-hg: adjust to hg 1.9
hg 1.0 changed the signature of hg.clone(). Adjust to it.

A real fix would need to check the hg version or try/catch.
2012-05-11 17:50:05 -05:00
Sverre Rabbelier
92d64fd751 git-remote-hg: add GitExporter/GitImporter/NonLocalGit
This is inftrastructure required to implement git-remote-hg.
2012-05-11 17:50:05 -05:00
Sverre Rabbelier
12c225424e git-remote-hg: add hgexport, an hg-fast-export equivalent
This class will be used by git-remote-hg to do the heavy lifting.
2012-05-11 17:50:05 -05:00
Sverre Rabbelier
5077c76b08 git-remote-hg: add GitHg, a helper class for converting hg commits to git
This class will be used by HgExport.
2012-05-11 17:50:05 -05:00
Sverre Rabbelier
f6ae860587 git-remote-hg: add hgimport, an hg-fast-import equivalent
This class will be used by git-remote-hg to do the heavy lifting.
2012-05-11 17:50:05 -05:00
Sverre Rabbelier
6a0b2fd468 git_remote_helpers: add fastimport library 2012-05-11 17:50:05 -05:00
Sverre Rabbelier
1fc80e1c0d git-remote-testgit: make local a function
Other helpers (such as git-remote-hg) require that 'self.local' is a
function, rather than a variable.
2012-05-11 17:50:05 -05:00
Sverre Rabbelier
6ebecf6dab remote-testgit: factor out RemoteHelper class
Facilitate writing import-export based helpers in python by
refactoring common code to a base class.

[jes: rebased to newer upstream Git]

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
2012-05-11 17:50:05 -05:00
Sverre Rabbelier
e1aef60119 remote-helper: check helper status after import/export
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2012-05-11 17:50:05 -05:00
Sverre Rabbelier
7724ddc461 transport-helper: add trailing -- 2012-05-11 17:50:04 -05:00
Sverre Rabbelier
e9c6b8b2bc t5800: point out that deleting branches does not work
This test actually breaks the repositories involved somehow, so it is
not enabled by default.
2012-05-11 17:50:04 -05:00
Sverre Rabbelier
7255736c70 t5800: test pushing a new branch with old content
This works now that fast-export has been fixed to properly handle
refs that point to a commit that was not exported during the current
fast-export run.
2012-05-11 17:50:04 -05:00
Johannes Schindelin
c5aa22b7fe setup_revisions: remember whether a ref was positive or not
This will be required by fast-export, when no commits were
exported, but the refs should be set, of course.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2012-05-11 17:50:04 -05:00
Johannes Schindelin
9d4e684f32 fast-export: do not export negative refs
When calling `git fast-export master..next` we want to export
refs/heads/next, but not refs/heads/master.

Currently this is not a problem, because negative refs' commits
are never shown. In the next commit this will be changed in order
to make sure that 'master..master' does export master. I.e. even
refs whose commits are not shown are exported.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2012-05-11 17:50:04 -05:00
Johannes Schindelin
07d38c314e setup_revisions: remember whether a ref was positive or not
This will be required by fast-export, when no commits were
exported, but the refs should be set, of course.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2012-05-11 17:50:04 -05:00
Johannes Schindelin
c00fe59ae2 fast-export: do not refer to non-existing marks
When calling `git fast-export a..a b` when a and b refer to the same
commit, nothing would be exported, and an incorrect reset line would
be printed for b ('from :0').

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2012-05-11 17:50:04 -05:00
Erik Faye-Lund
34f1712f48 MSVC: require pton and ntop emulation
Without this, git-daemon cannot be built with Microsoft Visual C++.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 17:50:04 -05:00
Erik Faye-Lund
8efbce376b MSVC: fix poll-related macro redefines
This seems to be related to the poll-emulation... I see that these things
are guarded by an "#if(_WIN32_WINNT >= 0x0600)" in <winsock2.h>, which
means it's supported for Windows Vista and above... We still support
Windows XP, so it seems someone has set this too high :)

I'd prefer to set this from the Makefile, but this generates a warning in
compat/win32/poll.c about redefining a macro (poll.c wants it to be 0x502,
which is Windows XP with SP2, rather than 0x501 which is normal Windows
XP).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2012-05-11 17:50:04 -05:00
Karsten Blees
de8dec8c1b MSVC: link dynamically to the CRT
Dynamic linking is generally preferred over static linking, and MSVCRT.dll
has been integral part of Windows for a long time.

This also fixes linker warnings for _malloc and _free in zlib.lib, which
seems to be compiled for MSVCRT.dll already.

The DLL version also exports some of the CRT initialization functions,
which are hidden in the static libcmt.lib (e.g. __wgetmainargs, required by
subsequent Unicode patches).

Signed-off-by: Karsten Blees <blees@dcon.de>
2012-05-11 17:50:04 -05:00
Karsten Blees
1b12cb06ff Win32: fix broken pipe detection
As of "Win32: Thread-safe windows console output", git-log no longer
terminates when the pager process dies. This is due to disabling buffering
for the replaced stdout / stderr streams. Git-log will periodically fflush
stdout (see write_or_die.c/mayble_flush_or_die()), but with no buffering,
this is a NOP that always succeeds (so we never detect the EPIPE error).

Exchange the original console handles with our console thread pipe handles
by accessing the internal MSVCRT data structures directly (which are
exposed via __pioinfo for some reason).

Implement this with minimal assumptions about the actual data structure to
make it work with different (hopefully even future) MSVCRT versions.

While messing with internal data structures is ugly, this patch solves the
problem at the source instead of adding more workarounds. We no longer need
the special winansi_isatty override, and the limitations documented in
"Win32: Thread-safe windows console output" are gone (i.e. fdopen(1/2)
returns unbuffered streams now, and isatty() for duped console file
descriptors works as expected).

Signed-off-by: Karsten Blees <blees@dcon.de>
2012-05-11 17:50:04 -05:00
Karsten Blees
71178fe7e8 Win32: fix detection of empty directories in is_dir_empty
On Windows XP (not Win7), directories cannot be deleted while a find handle
is open, causing "Deletion of directory '...' failed. Should I try again?"
prompts.

Prior to 19d1e75d "Win32: Unicode file name support (except dirent)",
these failures were silently ignored due to strbuf_free in is_dir_empty
resetting GetLastError to ERROR_SUCCESS.

Close the find handle in is_dir_empty so that git doesn't block deletion
of the directory even after all other applications have released it.

Reported-by: John Chen <john0312@gmail.com>
Signed-off-by: Karsten Blees <blees@dcon.de>
2012-05-11 17:50:04 -05:00