Commit Graph

41124 Commits

Author SHA1 Message Date
Johannes Schindelin
af8a1e1e58 Windows: make sure that merge-octopus only outputs LF line endings
This happens to shut up t7602 on Windows which would otherwise take
the different line endings for a sign that the merge failed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 13:36:36 +01:00
Sverre Rabbelier
124efa8c6d t9350: point out that refs are not updated correctly
This happens only when the corresponding commits are not exported in
the current fast-export run. This can happen either when the relevant
commit is already marked, or when the commit is explicitly marked
as UNINTERESTING with a negative ref by another argument.

This breaks fast-export basec remote helpers.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
2013-05-25 13:34:15 +01:00
Johannes Schindelin
b9cfcdd8f6 t030[02]: work around CR/LF issue
It is the old shell-script issue we had in a few other tests already.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 13:33:20 +01:00
Pat Thoyts
ac432dfad5 t5407: Fix line-ending dependency in post-rewrite.args
On msysGit creating the post-rewrite.args file using 'echo' has different
line endings from the expected comparison. Using perl normalizes the line
endings for each generated file.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-05-25 13:33:19 +01:00
Pat Thoyts
b198ce3fc1 t3102: Windows filesystems may not use a literal asterisk in filenames.
Exclude these tests when using MINGW.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-05-25 13:33:17 +01:00
Johannes Schindelin
4f7a600a6b MinGW: Skip test redirecting to fd 4
... because that does not work in MinGW.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 13:33:16 +01:00
Johannes Schindelin
698acb9019 Handle new t1501 test case properly with MinGW
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 13:33:15 +01:00
Heiko Voigt
6517f8c799 work around misdetection of stdin attached to a tty
Git on Windows was made aware of the fact that sometimes a file may be
used by another process and so an operation may fail but the user might
be able to fix it and is asking for confirmation whether it should
retry.

This is implemented in a way that git only asks in case stdin and stderr
are attached to a tty. Unfortunately this seems to be misdetected
sometimes causing the testsuite to hang when git is waiting for a user
answer.

This patch works around the situation.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
2013-05-25 13:33:14 +01:00
Johannes Schindelin
13cf625100 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>
2013-05-25 13:33:12 +01:00
Johannes Schindelin
5a53cc7e15 Teach 'git remote' that the config var branch.*.rebase can be 'interactive'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 13:33:11 +01:00
Johannes Schindelin
a624a0607d Handle the branch.<name>.rebase value 'interactive'
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 13:33:10 +01:00
Johannes Schindelin
a2554097f5 Teach 'git pull' to handle --rebase=interactive
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 13:33:00 +01:00
Sebastian Schuberth
aa76e26f87 am: Use cat instead of echo to avoid DOS line-endings (fixes t4150)
Along the lines of 05d0e3b and f33946d, use cat instead of echo to avoid
line ending mismatches in the test result of "am empty-file does not
infloop" which make the test fail.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2013-05-25 13:31:12 +01:00
Sebastian Schuberth
31203f2281 submodule: Fix t7400, t7405, t7406 for msysGit
Again, avoid using echo (which issues DOS line endings on msysGit) to not mix
with Unix line-endings issued by git built-ins, even if this is at the cost of
calling an external executable (cat) instead of a shell built-in (echo).
2013-05-25 13:31:11 +01:00
Johannes Schindelin
2e53f0696a grep -I: do not bother to read known-binary files
Incidentally, this makes grep -I respect the "binary" attribute (actually,
the "-text" attribute, but "binary" implies that).

Since the attributes are not thread-safe, we now need to switch off
threading if -I was passed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:29:49 +01:00
Johannes Schindelin
cbc982bfcf git grep -O -i: if the pager is 'less', pass the '-i' option
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:29:48 +01:00
Johannes Schindelin
cfd56ab3a6 gitweb (SyntaxHighlighter): interpret #l<line-number>
It is pretty convenient to refer to a line number by appending, say,
highlighter, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:29:47 +01:00
Johannes Schindelin
0698f300f0 Only switch on the line number toggle when highlighting is activated
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:29:45 +01:00
Johannes Schindelin
9778f2eeec Gitweb: add support for Alex Gorbatchev's SyntaxHighlighter in Javascript
Gitweb is not exactly what you would call server-friendly, so let's
offload one more task onto the client.

To enable this, put something like this into your gitweb_config.perl:

	$feature{'syntaxhighlighter_js'}{'default'} = [{
		url => '/SyntaxHighlighter/',
		style => 'Django',
		theme => 'FadeToGrey'
	}];

and clone git://github.com/alexgorbatchev/SyntaxHighlighter into the
directory you specified via the 'url' parameter.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:29:44 +01:00
Johannes Schindelin
588028a914 Gitweb: make line number toggling work for Firefox and Safari
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:29:43 +01:00
Johannes Schindelin
1618a4eebb gitweb: Allow line number toggling with Javascript
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:29:41 +01:00
Heiko Voigt
d281ca1639 Windows: Always normalize paths to Windows-style
It appears that `pwd` returns the POSIX-style or the DOS-style path
depending which style the previous `cd` used. To normalize, enforce `pwd
-W` in scripts.

From the original e-mail exchange:

On Thu, Mar 22, 2012 at 11:13:37AM +0100, Sebastian Schuberth wrote:
> On Wed, Mar 21, 2012 at 22:21, Johannes Sixt <j6t@kdbg.org> wrote:
>
> > I build git and run its tests outside the msysgit environment. Does that
> > explain the difference? (And I use CMD.)
>
> It does not make a difference for me. I started cmd.exe at
> c:\msysgit\git\t, added c:\msysgit\bin temporarily to PATH, and ran
> "sh t5526-fetch-submodules.sh -i -v", and the test still fails.

Yes it probably does. Johannes said that he runs the tests outside of
the msysgit folder. That way there is only one path the submodule script
gets reported and not two like '/c/msysgit/git' and '/git'.

That would explain to me why it is passing.

I am afraid that the only solution is to patch msys itself to report the
long absolute path when passing window style paths to cd. Currently when
I do

	cd c:/msysgit/git

I will end up in '/git' instead of the long path.

I found that there is a -W option to pwd in msys bash which makes it
always return the real windows path. A normalization in that direction
is unique and thus might be more robust. Have a look at the attached
patch. With this at least t5526 passes. I was not able to run the whole
testsuite properly at the moment. I can have a look at that tomorrow.

What do you think?

Cheers Heiko

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:29:40 +01:00
Evgeny Pashkin
437c34a2c4 Fixed wrong path delimiter in exe finding
On Windows XP3 in git bash
git clone git@github.com:octocat/Spoon-Knife.git
cd Spoon-Knife
git gui
menu Remote\Fetch from\origin
error: cannot spawn git: No such file or directory
error: could not run rev-list

if u run
git fetch --all
it worked normal in git bash or gitgui tools

In second version CreateProcess get 'C:\Git\libexec\git-core/git.exe' in
first version - C:/Git/libexec/git-core/git.exe and not executes (unix
slashes)

after fixing C:\Git\libexec\git-core\git.exe or
C:/Git/libexec/git-core\git.exe it works normal

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:29:39 +01:00
Johannes Schindelin
11c1331c98 Handle http.* config variables pointing to files gracefully on Windows
On Windows, we would like to be able to have a default http.sslCAinfo
that points to an MSys path (i.e. relative to the installation root of
Git).  As Git is a MinGW program, it has to handle the conversion
of the MSys path into a MinGW32 path itself.

Since system_path() considers paths starting with '/' as absolute, we
have to convince it to make a Windows path by stripping the leading
slash.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:29:22 +01:00
Eric Sunshine
fc45e0478c Make mingw_offset_1st_component() behave consistently for all paths.
mingw_offset_1st_component() returns "foo" for inputs "/foo" and
"c:/foo", but inconsistently returns "/foo" for UNC input
"/machine/share/foo".  Fix it to return "foo" for all cases.

Reference: http://groups.google.com/group/msysgit/browse_thread/thread/c0af578549b5dda0

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:26:45 +01:00
Cezary Zawadka
d599693e0a Allow using UNC path for git repository
[efl: moved MinGW-specific part to compat/]

[jes: fixed compilation on non-Windows]

Signed-off-by: Cezary Zawadka <czawadka@gmail.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:26:44 +01:00
Johannes Schindelin
30cbede80a Add a Windows-specific fallback to getenv("HOME");
This fixes msysGit issue 482 properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:26:42 +01:00
bert Dvornik
258862a267 send-email: handle Windows paths for display just like we do for processing
In git-send-email.perl, here are two checks to determine if
$smtp_server is an absolute path (so it'll be treated as a mailer) or
not (so it'll be treated as a hostname).  The one that handles actual
mail processing has been taught to recognize Windows pathnames by
commit 33b2e81f.

The other check is just to tell the user what happened, so it's far
less important, but the current state is that we will still claim to
the user that c:/foo/bar is a server. =)  This makes the second check
consistent with the first.

Signed-off-by: bert Dvornik <dvornik+git@gmail.com>
2013-05-25 11:26:41 +01:00
Erik Faye-Lund
ed4b4cc562 send-email: accept absolute path even on Windows
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:26:40 +01:00
Johannes Schindelin
14c0123df1 Let deny.currentBranch=updateInstead ignore submodules
They are not affected by the update anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:26:39 +01:00
Johannes Schindelin
6cb13764b2 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>
2013-05-25 11:26:37 +01:00
Chris West (Faux)
a5825e6f37 Fix another invocation of git from gitk with an overly long command-line
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2013-05-25 11:26:36 +01:00
Johannes Schindelin
dee17475da Work around the command line limit 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).

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>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:26:35 +01:00
Karsten Blees
a7e00b419c gitk: fix file name encoding in diff hunk headers
Decode file names from system encoding in all diff hunk header lines, not
just the first (i.e. print nice file names in 'rename from' / 'rename to' /
'Binary files' lines, too).

Signed-off-by: Karsten Blees <blees@dcon.de>
2013-05-25 11:26:33 +01:00
Karsten Blees
8d6901f756 git-gui: fix encoding in git-gui file browser
Assume git tree objects (i.e. output of git-ls-tree) are encoded in system
encoding, for display in the git-gui file browser.

Signed-off-by: Karsten Blees <blees@dcon.de>
2013-05-25 11:26:32 +01:00
Johannes Schindelin
5b016ecef9 git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:26:31 +01:00
Heiko Voigt
70b11a3aff 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>
2013-05-25 11:26:30 +01:00
Johannes Schindelin
9d468d9805 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>
2013-05-25 11:26:28 +01:00
Heiko Voigt
d21630186c Revert "git-gui: set GIT_DIR and GIT_WORK_TREE after setup"
This reverts commit a9fa11fe5b.
2013-05-25 11:26:27 +01:00
Johannes Sixt
acb4624dc8 criss cross rename failure workaround
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 11:26:25 +01:00
Pat Thoyts
211beeab56 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>
2013-05-25 11:10:55 +01:00
Erik Faye-Lund
444ac5cd1a 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>
2013-05-25 11:10:54 +01:00
Johannes Schindelin
472503ae68 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>
2013-05-25 11:10:53 +01:00
Erik Faye-Lund
1c9839d87f 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>
2013-05-25 11:10:45 +01:00
Pierre le Riche
2eda2386f1 msysgit: Add the --large-address-aware linker directive to the makefile.
This has the effect of increasing the address space from 2GB to 4GB under
64-bit Windows, reducing the likelihood of an "out of memory" error when
e.g.  repacking a large repository.  The test suite passes with this
patch, with and without the MEM_TOP_DOWN flag added to all VirtualAlloc
calls.  While this is no guarantee that there are no issues with large
memory support (it could break Git on other setups than mine, for
example), it at least increases the chance that nothing obvious goes wrong
(such as errors introduced by faulty sign extension, say, with ssize_t).

[PT: Resolves github issue #12]

Signed-off-by: Pierre le Riche <github@pleasedontspam.me>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2013-05-25 10:56:52 +01:00
Johannes Schindelin
b731cd89c5 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>
2013-05-25 10:51:31 +01:00
Sebastian Schuberth
02170e0dc6 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>
2013-05-25 10:47:50 +01:00
Johannes Schindelin
fb1d48aaee Do not compile compat/**/*.c with -Wold-style-definition
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-05-25 10:42:03 +01:00
Johannes Schindelin
58d1eb7812 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>
2013-05-25 10:42:02 +01:00
Pat Thoyts
5485785660 Start the merging-rebase to v1.8.3
This commit starts the rebase of 694fb72 to 8af0605
using 191fb70eb6 as base.
2013-05-25 10:42:00 +01:00