Commit Graph

25410 Commits

Author SHA1 Message Date
Johannes Schindelin
d73c3c04cf Let deny.currentBranch=updateInstead ignore submodules
They are not affected by the update anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:38 +01:00
Johannes Schindelin
2b04d7695e add -e: ignore dirty submodules
We cannot add untracked/modified files in submodules anyway.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:36 +01:00
Johannes Schindelin
36e409787c 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>
2011-04-25 00:42:35 +01:00
Johannes Schindelin
63d6dc6910 Gitweb: make line number toggling work for Firefox and Safari
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:34 +01:00
Johannes Schindelin
3f2dc6bd67 gitweb: Allow line number toggling with Javascript
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:33 +01:00
Johannes Schindelin
f403f7162c Give commit message reencoding for output on MinGW a chance
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:32 +01:00
Karsten Blees
de6df2fe4e Warn if the Windows console font doesn't support Unicode
Unicode console output won't display correctly with default settings
because the default console font ("Terminal") only supports the system's
OEM charset. Unfortunately, this is a user specific setting, so it cannot
be easily fixed by e.g. some registry tricks in the setup program.

This change prints a warning on exit if console output contained non-ascii
characters and the console font is supposedly not a TrueType font (which
usually have decent Unicode support).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:31 +01:00
Karsten Blees
95dc6b770d Detect console streams more reliably on Windows
GetStdHandle(STD_OUTPUT_HANDLE) doesn't work for stderr if stdout is
redirected. Use _get_osfhandle of the FILE* instead.

_isatty() is true for all character devices (including parallel and serial
ports). Check return value of GetConsoleScreenBufferInfo instead to
reliably detect console handles (also don't initialize internal state from
an uninitialized CONSOLE_SCREEN_BUFFER_INFO structure if the function
fails).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:30 +01:00
Karsten Blees
c2ba388343 Support Unicode console output on Windows
WriteConsoleW seems to be the only way to reliably print unicode to the
console (without weird code page conversions).

Also redirects vfprintf to the winansi.c version.

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:29 +01:00
Karsten Blees
5860fad896 Enable color output in Windows cmd.exe
Git requires the TERM environment variable to be set for all color*
settings. Simulate the TERM variable if it is not set (default on Windows).

Signed-off-by: Karsten Blees <blees@dcon.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:27 +01:00
Chris West (Faux)
364a83ca51 Fix another invocation of git from gitk with an overly long command-line
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2011-04-25 00:42:26 +01:00
Johannes Schindelin
b9d339eee8 git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:25 +01:00
Eric Sunshine
504c26dab5 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>
2011-04-25 00:42:24 +01:00
Erik Faye-Lund
6df8bcd8ab config.c: trivial fix for compile-time warning
The warning ("builtin/config.c:351: warning: initialization
discards qualifiers from pointer target type") was introduced
in commit 6754497c.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:23 +01:00
Cezary Zawadka
dba7984b59 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>
2011-04-25 00:42:22 +01:00
Heiko Voigt
12ac16c63f 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>
2011-04-25 00:42:20 +01:00
Johannes Schindelin
cc297b61c2 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>
2011-04-25 00:42:19 +01:00
Johannes Schindelin
4c50dd6d1b t7602: cope with CR/LF
The output of git-merge-octopus has CR/LF line endings, so let's just
strip the CR out.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:17 +01:00
Johannes Schindelin
fdf3b3f8a4 Add a Windows-specific fallback to getenv("HOME");
This fixes msysGit issue 482 properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:15 +01:00
bert Dvornik
3539d6e957 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>
2011-04-25 00:42:14 +01:00
Erik Faye-Lund
99bae50ab1 send-email: accept absolute path even on Windows
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-25 00:42:13 +01:00
Johannes Schindelin
ef0e50e064 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>
2011-04-25 00:42:12 +01:00
Johannes Schindelin
107e8b41c7 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>
2011-04-25 00:41:49 +01:00
Pat Thoyts
7bdd17d3d0 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>
2011-04-25 00:34:48 +01:00
Johannes Schindelin
f13b3a8048 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>
2011-04-24 22:23:40 +01:00
Heiko Voigt
9c4e0be61f 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>
2011-04-24 22:23:38 +01:00
Heiko Voigt
fdb2e9f2cf Revert "git-gui: set GIT_DIR and GIT_WORK_TREE after setup"
This reverts commit a9fa11fe5b.
2011-04-24 22:23:37 +01:00
Johannes Sixt
e10ee9ea43 criss cross rename failure workaround
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-04-24 22:23:36 +01:00
Johannes Schindelin
d86266d546 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>
2011-04-24 22:23:34 +01:00
Erik Faye-Lund
7c8b278d81 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>
2011-04-24 22:23:33 +01:00
Sebastian Schuberth
dc978147d8 MinGW: Add missing file mode bit defines
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2011-04-24 22:23:31 +01:00
Junio C Hamano
7fd54b9826 Merge branch 'master' into next
* master:
  Git 1.7.5
2011-04-23 23:37:13 -07:00
Junio C Hamano
ec014eac0e Git 1.7.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.5
2011-04-23 23:36:32 -07:00
Junio C Hamano
d1ff91a594 Merge branch 'ab/i18n-fixup' into next
* ab/i18n-fixup:
  i18n: use test_i18n{cmp,grep} in t7600, t7607, t7611 and t7811
  i18n: use test_i18n{grep,cmp} in t7508
  i18n: use test_i18ngrep in t7506
  i18n: use test_i18ngrep and test_i18ncmp in t7502
  i18n: use test_i18ngrep in t7501
  i18n: use test_i18ncmp in t7500
  i18n: use test_i18ngrep in t7201
  i18n: use test_i18ncmp and test_i18ngrep in t7102 and t7110
  i18n: use test_i18ncmp and test_i18ngrep in t5541, t6040, t6120, t7004, t7012 and t7060
  i18n: use test_i18ncmp and test_i18ngrep in t3700, t4001 and t4014
  i18n: use test_i18ncmp and test_i18ngrep in t3203, t3501 and t3507
  i18n: use test_i18ngrep in t2020, t2204, t3030, and t3200
  i18n: use test_i18ngrep in lib-httpd and t2019
  i18n: do not overuse C_LOCALE_OUTPUT (grep)
  i18n: use test_i18ncmp in t1200 and t2200
  i18n: .git file is not a human readable message (t5601)
2011-04-22 12:32:01 -07:00
Junio C Hamano
281bb9d6c9 Merge branch 'rj/sparse' into next
* rj/sparse:
  sparse: Fix some "symbol not declared" warnings
  sparse: Fix errors due to missing target-specific variables
  sparse: Fix an "symbol 'merge_file' not decared" warning
  sparse: Fix an "symbol 'format_subject' not declared" warning
  sparse: Fix some "Using plain integer as NULL pointer" warnings
  sparse: Fix an "symbol 'cmd_index_pack' not declared" warning
  Makefile: Use cgcc rather than sparse in the check target
2011-04-22 12:32:01 -07:00
Ramsay Jones
c51477229e sparse: Fix some "symbol not declared" warnings
In particular, sparse issues the "symbol 'a_symbol' was not declared.
Should it be static?" warnings for the following symbols:

    attr.c:468:12: 'git_etc_gitattributes'
    attr.c:476:5:  'git_attr_system'
    vcs-svn/svndump.c:282:6: 'svndump_read'
    vcs-svn/svndump.c:417:5: 'svndump_init'
    vcs-svn/svndump.c:432:6: 'svndump_deinit'
    vcs-svn/svndump.c:445:6: 'svndump_reset'

The symbols in attr.c only require file scope, so we add the static
modifier to their declaration.

The symbols in vcs-svn/svndump.c are external symbols, and they
already have extern declarations in the "svndump.h" header file,
so we simply include the header in svndump.c.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-22 10:04:27 -07:00
Ramsay Jones
0bcd9ae85d sparse: Fix errors due to missing target-specific variables
In particular, sparse issues the following errors:

    attr.c:472:43: error: undefined identifier 'ETC_GITATTRIBUTES'
    config.c:821:43: error: undefined identifier 'ETC_GITCONFIG'
    exec_cmd.c:14:37: error: undefined identifier 'PREFIX'
    exec_cmd.c:83:28: error: undefined identifier 'GIT_EXEC_PATH'
    builtin/help.c:328:46: error: undefined identifier 'GIT_MAN_PATH'
    builtin/help.c:374:40: error: undefined identifier 'GIT_INFO_PATH'
    builtin/help.c:382:45: error: undefined identifier 'GIT_HTML_PATH'
    git.c:96:42: error: undefined identifier 'GIT_HTML_PATH'
    git.c:241:35: error: invalid initializer
    http.c:293:43: error: undefined identifier 'GIT_HTTP_USER_AGENT'

which is caused by not passing the target-specific additions to
the EXTRA_CPPFLAGS variable to cgcc.

In order to fix the problem, we define a new sparse target which
depends on a set of non-existent "sparse object" files (*.sp)
which correspond to the set of C source files. In addition to the
new target, we also provide a new pattern rule for "creating" the
sparse object files from the source files by running cgcc.  This
allows us to add '*.sp' to the rules setting the target-specific
EXTRA_CPPFLAGS variable, which is then included in the new pattern
rule to run cgcc.

Also, we change the 'check' target to re-direct the user to the
new sparse target.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-22 10:03:47 -07:00
Junio C Hamano
63e4ee5f87 Merge branch 'master' into next
* master:
  Git 1.7.5-rc3
  Git 1.7.4.5
  git-svn.txt: Document --mergeinfo
2011-04-19 11:51:25 -07:00
Junio C Hamano
6ceb270ce6 Git 1.7.5-rc3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.5-rc3
2011-04-19 11:51:00 -07:00
Junio C Hamano
0e73bb4dfc Sync with 1.7.4.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-19 11:49:13 -07:00
Junio C Hamano
4fec83045b Git 1.7.4.5
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v1.7.4.5
2011-04-19 11:45:38 -07:00
Michael J Gruber
ccc2fcf54c git-svn.txt: Document --mergeinfo
6abd933 (git-svn: allow the mergeinfo property to be set, 2010-09-24)
introduced the --mergeinfo option. Document it.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-19 11:29:45 -07:00
Junio C Hamano
359ea0b923 Merge branch 'master' into next
* master:
  Revert "run-command: prettify -D_FORTIFY_SOURCE workaround"
2011-04-18 16:22:20 -07:00
Junio C Hamano
60e199c4d5 Revert "run-command: prettify -D_FORTIFY_SOURCE workaround"
This reverts commit ebec842773, which
somehow mistakenly thought that any non-zero return from write(2) is
an error.
2011-04-18 14:14:53 -07:00
Junio C Hamano
c9ea118e75 i18n: use test_i18n{cmp,grep} in t7600, t7607, t7611 and t7811
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-14 14:36:14 -07:00
Junio C Hamano
cc6658e7b4 i18n: use test_i18n{grep,cmp} in t7508
Two tests looked for "[Uu]sage" in the output, but we cannot expect the
l10n to use that phrase.  Mark them with test_i18ngrep so that in later
versions we can test truly localized versions with the same tests, not
just GETTEXT_POISON that happens to keep the original string in the
output.

Merge a few tests that were artificially split into "do" and "test output
under C_LOCALE_OUTPUT" in the original i18n patches back.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-14 14:24:02 -07:00
Junio C Hamano
7a23d2d28a i18n: use test_i18ngrep in t7506
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-14 13:37:54 -07:00
Junio C Hamano
b9f1b13437 Merge branch 'jk/notes-ui-updates' into next
* jk/notes-ui-updates:
  contrib/completion: --notes, --no-notes
2011-04-14 12:27:33 -07:00
Junio C Hamano
33634ef644 Merge branch 'master' into next
* master:
  archive: document limitation of tar.umask config setting
  t3306,t5304: avoid clock skew issues
  git.txt: fix list continuation
2011-04-14 12:26:57 -07:00
Junio C Hamano
4d8b32a2e1 Merge branch 'maint'
* maint:
  archive: document limitation of tar.umask config setting
  t3306,t5304: avoid clock skew issues
  git.txt: fix list continuation
2011-04-14 12:26:45 -07:00