Commit graph

31027 commits

Author SHA1 Message Date
Johannes Schindelin bc9860d3d3 Give commit message reencoding for output on MinGW a chance
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:47:16 -05:00
Karsten Blees 841953a73e 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-10-08 14:47:15 -05:00
Karsten Blees 09a771abac 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-10-08 14:47:15 -05:00
Karsten Blees 465a4701bf 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-10-08 14:47:14 -05:00
Karsten Blees 97a83c468c 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-10-08 14:47:14 -05:00
Chris West (Faux) d30e0a1e17 Fix another invocation of git from gitk with an overly long command-line
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2011-10-08 14:47:13 -05:00
Johannes Schindelin 275b90bc5b git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:47:13 -05:00
Eric Sunshine a12bace006 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-10-08 14:47:13 -05:00
Erik Faye-Lund 9cc96c9646 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-10-08 14:47:12 -05:00
Cezary Zawadka e40fa94421 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-10-08 14:47:12 -05:00
Heiko Voigt af3889de8d 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-10-08 14:47:12 -05:00
Johannes Schindelin 587a406c4b 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-10-08 14:47:08 -05:00
Johannes Schindelin e40ee31109 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-10-08 14:45:38 -05:00
Johannes Schindelin eb8fa8ca2c Add a Windows-specific fallback to getenv("HOME");
This fixes msysGit issue 482 properly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:45:38 -05:00
bert Dvornik 9fa0780c54 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-10-08 14:45:37 -05:00
Erik Faye-Lund 6d95a38a36 send-email: accept absolute path even on Windows
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:45:37 -05:00
Johannes Schindelin f9ef98f9d3 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-10-08 14:45:37 -05:00
Johannes Schindelin c02d613e78 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-10-08 14:45:36 -05:00
Pat Thoyts 2a8e01a189 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-10-08 14:45:36 -05:00
Johannes Schindelin 647921ae42 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-10-08 14:45:36 -05:00
Heiko Voigt 73f8a642c9 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-10-08 14:45:35 -05:00
Heiko Voigt 8327b97723 Revert "git-gui: set GIT_DIR and GIT_WORK_TREE after setup"
This reverts commit a9fa11fe5b.
2011-10-08 14:45:35 -05:00
Johannes Sixt 8280446337 criss cross rename failure workaround
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2011-10-08 14:45:34 -05:00
Johannes Schindelin 39dbe990ed 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-10-08 14:45:34 -05:00
Erik Faye-Lund dab4396724 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-10-08 14:45:34 -05:00
Sebastian Schuberth 76cc4e01a0 MinGW: Add missing file mode bit defines
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2011-10-08 14:45:33 -05:00
Junio C Hamano 891b8b6e51 Merge branch 'ph/transport-with-gitfile' into next
* ph/transport-with-gitfile:
  Add test showing git-fetch groks gitfiles
  Teach transport about the gitfile mechanism
  Learn to handle gitfiles in enter_repo
  enter_repo: do not modify input
2011-10-06 15:42:04 -07:00
Junio C Hamano 998462b832 Merge branch 'rs/pending' into next
* rs/pending:
  commit: factor out clear_commit_marks_for_object_array
  checkout: use leak_pending flag
  bundle: use leak_pending flag
  bisect: use leak_pending flag
  revision: add leak_pending flag
  checkout: use add_pending_{object,sha1} in orphan check
  revision: factor out add_pending_sha1
  checkout: check for "Previous HEAD" notice in t2020

Conflicts:
	builtin/checkout.c
	revision.c
2011-10-06 15:42:04 -07:00
Junio C Hamano 46851fe105 Merge branch 'cb/do-not-pretend-to-hijack-long-help' into next
* cb/do-not-pretend-to-hijack-long-help:
  use -h for synopsis and --help for manpage consistently
2011-10-06 15:42:03 -07:00
Junio C Hamano de8f6f2f1f Merge branch 'js/log-show-children' into next
* js/log-show-children:
  log --children
2011-10-06 15:42:03 -07:00
Junio C Hamano 91f035fe99 Merge branch 'rs/diff-cleanup-records-fix' into next
* rs/diff-cleanup-records-fix:
  diff: resurrect XDF_NEED_MINIMAL with --minimal
  Revert removal of multi-match discard heuristic in 27af01
2011-10-06 15:42:02 -07:00
Junio C Hamano b8c26d2549 Merge branch 'rs/test-ctype' into next
* rs/test-ctype:
  test-ctype: add test for is_pathspec_magic
  test-ctype: macrofy
2011-10-06 15:42:02 -07:00
Junio C Hamano e51878e5e1 Merge branch 'rs/name-rev-usage' into next
* rs/name-rev-usage:
  name-rev: split usage string
2011-10-06 15:42:02 -07:00
Junio C Hamano 3d8567417d Merge branch 'jn/no-g-plus-s-on-bsd' into next
* jn/no-g-plus-s-on-bsd:
  Makefile: do not set setgid bit on directories on GNU/kFreeBSD
2011-10-06 15:42:02 -07:00
Junio C Hamano a68770d8f0 Merge branch 'jn/ident-from-etc-mailname' into next
* jn/ident-from-etc-mailname:
  ident: do not retrieve default ident when unnecessary
  ident: check /etc/mailname if email is unknown
2011-10-06 15:42:02 -07:00
Junio C Hamano d6c6741b2d Merge branch 'jc/is-url-simplify' into next
* jc/is-url-simplify:
  url.c: simplify is_url()
2011-10-06 15:42:01 -07:00
Junio C Hamano 209126d108 Merge branch 'nd/git-daemon-error-msgs' into next
* nd/git-daemon-error-msgs:
  daemon: return "access denied" if a service is not allowed
2011-10-06 15:42:01 -07:00
Junio C Hamano 0c5f5d073e Merge branch 'nd/document-err-packet' into next
* nd/document-err-packet:
  pack-protocol: document "ERR" line
2011-10-06 15:42:01 -07:00
Junio C Hamano 5f3630f46e Merge branch 'nd/daemon-log-sock-errors' into next
* nd/daemon-log-sock-errors:
  daemon: log errors if we could not use some sockets
2011-10-06 15:42:00 -07:00
Junio C Hamano 7e3083f3fe Merge branch 'il/archive-err-signal' into next
* il/archive-err-signal:
  Support ERR in remote archive like in fetch/push
2011-10-06 15:42:00 -07:00
Junio C Hamano da42ad07ec Merge branch 'cp/git-web-browse-browsers' into next
* cp/git-web-browse-browsers:
  git-web--browse: avoid the use of eval
2011-10-06 15:42:00 -07:00
Junio C Hamano b16cffe149 Merge branch 'jc/grep-untracked-exclude' into next
* jc/grep-untracked-exclude:
  grep: teach --untracked and --exclude-standard options
2011-10-06 15:41:59 -07:00
Junio C Hamano 69fe65d498 Merge branch 'jp/get-ref-dir-unsorted' into next
* jp/get-ref-dir-unsorted:
  refs: Use binary search to lookup refs faster
  Don't sort ref_list too early

Conflicts:
	refs.c
2011-10-06 15:41:59 -07:00
Junio C Hamano 33ac777f10 Merge branch 'ph/push-to-delete-nothing' into next
* ph/push-to-delete-nothing:
  receive-pack: don't pass non-existent refs to post-{receive,update} hooks

Conflicts:
	builtin/receive-pack.c
2011-10-06 15:41:59 -07:00
Junio C Hamano 64061aaf7f Merge branch 'jc/checkout-from-tree-keep-local-changes' into next
* jc/checkout-from-tree-keep-local-changes:
  checkout $tree $path: do not clobber local changes in $path not in $tree
2011-10-06 15:41:58 -07:00
Junio C Hamano 93c00f0373 Merge branch 'cs/perl-config-path-send-email' into next
* cs/perl-config-path-send-email:
  use new Git::config_path() for aliasesfile
  Add Git::config_path()
2011-10-06 15:41:58 -07:00
Junio C Hamano 78b31cdd9e Merge branch 'zj/send-email-authen-sasl' into next
* zj/send-email-authen-sasl:
  send-email: auth plain/login fix
2011-10-06 15:41:58 -07:00
Junio C Hamano dd4936cc3f Merge branch 'jc/parse-options-boolean' into next
* jc/parse-options-boolean:
  apply: use OPT_NOOP_NOARG
  revert: use OPT_NOOP_NOARG
  parseopt: add OPT_NOOP_NOARG
  archive.c: use OPT_BOOL()
  parse-options: deprecate OPT_BOOLEAN

Conflicts:
	builtin/revert.c
2011-10-06 15:41:57 -07:00
Junio C Hamano 76e90c3381 Merge branch 'dm/tree-walk' into next
* dm/tree-walk:
  tree-walk: micro-optimization in tree_entry_interesting
  tree-walk: drop unused parameter from match_dir_prefix
2011-10-06 15:41:57 -07:00
Junio C Hamano 9236f5e71f Merge branch 'ps/gitweb-js-with-lineno' into next
* ps/gitweb-js-with-lineno:
  gitweb: Fix links to lines in blobs when javascript-actions are enabled
2011-10-06 15:41:57 -07:00