Commit Graph

50472 Commits

Author SHA1 Message Date
Johannes Schindelin
af67c2f33e Merge 'gitk' into HEAD 2015-05-14 10:40:27 +02:00
Johannes Schindelin
b321da45a6 Merge 'git-gui' into HEAD 2015-05-14 10:40:27 +02:00
Johannes Schindelin
330284b44e Merge 'criss-cross-merge' into HEAD 2015-05-14 10:40:27 +02:00
Johannes Schindelin
62b82e7cb3 Merge 'hide-dotgit' into HEAD 2015-05-14 10:40:26 +02:00
Johannes Schindelin
09330d5a9a Merge 'unicode' into HEAD 2015-05-14 10:40:26 +02:00
Johannes Schindelin
a819199878 Merge pull request #138 from tboegi/150504_blame-resurrect-convert-to-git
blame: CRLF in the working tree and LF in the repo
2015-05-14 10:40:26 +02:00
Torsten Bögershausen
a11f184aab blame: CRLF in the working tree and LF in the repo
A typical setup under Windows is to set core.eol to CRLF, and text
files are marked as "text" in .gitattributes, or core.autocrlf is
set to true.

After 4d4813a5 "git blame" no longer works as expected for such a
set-up.  Every line is annotated as "Not Committed Yet", even though
the working directory is clean.  This is because the commit removed
the conversion in blame.c for all files, with or without CRLF in the
repo.

Having files with CRLF in the repo and core.autocrlf=input is a
temporary situation, and the files, if committed as is, will be
normalized in the repo, which _will_ be a notable change.  Blaming
them with "Not Committed Yet" is the right result.  Revert commit
4d4813a5 which was a misguided attempt to "solve" a non-problem.

Add two test cases in t8003 to verify the correct CRLF conversion.

Suggested-By: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-05-14 10:25:20 +02:00
Sebastian Schuberth
3209426cd2 gitk: Use an external icon file on Windows
Git for Windows now ships with the new Git icon from git-scm.com. Use that
icon file if it exists instead of the old procedurally drawn one.

This patch was sent upstream but so far no decision on its inclusion was
made, so commit it to our fork.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2015-05-14 10:05:52 +02:00
Chris West (Faux)
5c53c59d83 Fix another invocation of git from gitk with an overly long command-line
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
2015-05-14 10:05:52 +02:00
Johannes Schindelin
2274dc0570 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>
2015-05-14 10:05:52 +02:00
Johannes Schindelin
9c617fbd4c git gui: set GIT_ASKPASS=git-gui--askpass if not set yet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-14 10:05:51 +02:00
Heiko Voigt
be028b714d 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>
2015-05-14 10:05:51 +02:00
Heiko Voigt
4253aa7896 Revert "git-gui: set GIT_DIR and GIT_WORK_TREE after setup"
This reverts commit a9fa11fe5b.
2015-05-14 10:05:50 +02:00
Johannes Sixt
b3cd0f5f9e criss cross rename failure workaround
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-14 10:05:49 +02:00
Pat Thoyts
f078c010b3 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>
2015-05-14 10:05:49 +02:00
Johannes Schindelin
74c09179e2 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>
2015-05-14 10:05:48 +02:00
Erik Faye-Lund
3c21fbf5ed 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>
2015-05-14 10:05:48 +02:00
Karsten Blees
0a175acdfe git-gui:handle the encoding of Git's output correctly
If we use 'eval exec $opt $cmdp $args' to execute git command,
tcl engine will convert the output of the git comand with the rule
system default code page to unicode.

But cp936 -> unicode conversion implicitly done by exec is not reversible.
So we have to use git_read instead.

Bug report and an original reproducer by Cloud Chou:
https://github.com/msysgit/git/issues/302

Karsten Blees writes this code patch.
Cloud Chou find the reason of the bug.

Thanks-to: dscho
Thanks-to: patthoyts
Signed-off-by: Karsten Blees <blees@dcon.de>
Original-test-by: Cloud Chou <515312382@qq.com>
Signed-off-by: Cloud Chou <515312382@qq.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-14 10:05:47 +02:00
Karsten Blees
1a65c37ae5 Unicode file name support (gitk and git-gui)
Assumes file names in git tree objects are UTF-8 encoded.

On most unix systems, the system encoding (and thus the TCL system
encoding) will be UTF-8, so file names will be displayed correctly.

On Windows, it is impossible to set the system encoding to UTF-8. Changing
the TCL system encoding (via 'encoding system ...', e.g. in the startup
code) is explicitly discouraged by the TCL docs.

Change gitk and git-gui functions dealing with file names to always convert
from and to UTF-8.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-05-14 10:05:47 +02:00
Johannes Schindelin
b50c89ae8c Start the merging-rebase to v2.4.1
This commit starts the rebase of d74a85f to 2be062d
2015-05-14 10:05:46 +02:00
Junio C Hamano
aaa7e0d7f8 Git 2.4.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.4.1
2015-05-13 14:11:43 -07:00
Junio C Hamano
a379f25462 Merge branch 'sb/line-log-plug-pairdiff-leak' into maint
* sb/line-log-plug-pairdiff-leak:
  line-log.c: fix a memleak
2015-05-13 14:05:56 -07:00
Junio C Hamano
071e93a148 Merge branch 'sb/test-bitmap-free-at-end' into maint
* sb/test-bitmap-free-at-end:
  pack-bitmap.c: fix a memleak
2015-05-13 14:05:56 -07:00
Junio C Hamano
36ec67d1ea Merge branch 'nd/t1509-chroot-test' into maint
Correct test bitrot.

* nd/t1509-chroot-test:
  t1509: update prepare script to be able to run t1509 in chroot again
2015-05-13 14:05:55 -07:00
Junio C Hamano
c1c4a878bb Merge branch 'jk/type-from-string-gently' into maint
"git cat-file bl $blob" failed to barf even though there is no
object type that is "bl".

* jk/type-from-string-gently:
  type_from_string_gently: make sure length matches
2015-05-13 14:05:54 -07:00
Junio C Hamano
21b56b9259 Merge branch 'ep/fix-test-lib-functions-report' into maint
* ep/fix-test-lib-functions-report:
  test-lib-functions.sh: fix the second argument to some helper functions
2015-05-13 14:05:53 -07:00
Junio C Hamano
8a1d89745d Merge branch 'cn/bom-in-gitignore' into maint
Teach the codepaths that read .gitignore and .gitattributes files
that these files encoded in UTF-8 may have UTF-8 BOM marker at the
beginning; this makes it in line with what we do for configuration
files already.

* cn/bom-in-gitignore:
  attr: skip UTF8 BOM at the beginning of the input file
  config: use utf8_bom[] from utf.[ch] in git_parse_source()
  utf8-bom: introduce skip_utf8_bom() helper
  add_excludes_from_file: clarify the bom skipping logic
  dir: allow a BOM at the beginning of exclude files
2015-05-13 14:05:51 -07:00
Junio C Hamano
ebb464f0cb Merge branch 'jk/prune-mtime' into maint
Access to objects in repositories that borrow from another one on a
slow NFS server unnecessarily got more expensive due to recent code
becoming more cautious in a naive way not to lose objects to pruning.

* jk/prune-mtime:
  sha1_file: only freshen packs once per run
  sha1_file: freshen pack objects before loose
  reachable: only mark local objects as recent
2015-05-13 14:05:50 -07:00
Junio C Hamano
a60abe10f2 Merge branch 'jk/init-core-worktree-at-root' into maint
We avoid setting core.worktree when the repository location is the
".git" directory directly at the top level of the working tree, but
the code misdetected the case in which the working tree is at the
root level of the filesystem (which arguably is a silly thing to
do, but still valid).

* jk/init-core-worktree-at-root:
  init: don't set core.worktree when initializing /.git
2015-05-13 14:05:49 -07:00
Junio C Hamano
c99fec6e35 Sync with 2.3.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-05-11 14:39:28 -07:00
Junio C Hamano
9a3d637541 Git 2.3.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.3.8
2015-05-11 14:36:31 -07:00
Junio C Hamano
811ce1b47c Merge branch 'mm/usage-log-l-can-take-regex' into maint-2.3
Documentation fix.

* mm/usage-log-l-can-take-regex:
  log -L: improve error message on malformed argument
  Documentation: change -L:<regex> to -L:<funcname>
2015-05-11 14:34:01 -07:00
Junio C Hamano
cd0120857b Merge branch 'jc/diff-no-index-d-f' into maint-2.3
The usual "git diff" when seeing a file turning into a directory
showed a patchset to remove the file and create all files in the
directory, but "git diff --no-index" simply refused to work.  Also,
when asked to compare a file and a directory, imitate POSIX "diff"
and compare the file with the file with the same name in the
directory, instead of refusing to run.

* jc/diff-no-index-d-f:
  diff-no-index: align D/F handling with that of normal Git
  diff-no-index: DWIM "diff D F" into "diff D/F F"
2015-05-11 14:34:00 -07:00
Junio C Hamano
1add9aed85 Merge branch 'oh/fix-config-default-user-name-section' into maint-2.3
The default $HOME/.gitconfig file created upon "git config --global"
that edits it had incorrectly spelled user.name and user.email
entries in it.

* oh/fix-config-default-user-name-section:
  config: fix settings in default_user_config template
2015-05-11 14:33:59 -07:00
Junio C Hamano
13ec221d8c Merge branch 'jc/epochtime-wo-tz' into maint-2.3
"git commit --date=now" or anything that relies on approxidate lost
the daylight-saving-time offset.

* jc/epochtime-wo-tz:
  parse_date_basic(): let the system handle DST conversion
  parse_date_basic(): return early when given a bogus timestamp
2015-05-11 14:33:58 -07:00
dscho
243924a2ff Merge pull request #141 from kblees/kb/terminal-prompt
git_terminal_prompt fixes and Unicode support
2015-05-09 08:51:55 +02:00
dscho
975e780e6c Merge pull request #142 from kblees/kb/remove-chcp
git-wrapper: don't set the console input code page
2015-05-09 08:47:38 +02:00
Karsten Blees
9ed38942e0 git-wrapper: don't set the console input code page
Using different code pages for console input (SetConsoleCP()) and console
output (SetConsoleOutputCP()) doesn't make much sense and may be hazardous
for native Windows programs.

Git uses UTF-8 internally, so it actually needs 'SetConsoleCP(CP_UTF8)'
rather than 'SetConsoleCP(GetACP())'. However, ReadFile() / ReadConsoleA()
are broken with CP_UTF8 (and thus any higher level APIs such as fgetc(),
getchar() etc.). Unicode-aware console input would have to be implemented
via mingw_* wrappers using ReadConsoleW(). As Git typically launches an
editor for anything more complex than ASCII-only, yes/no-style questions,
this is currently not a problem.

Drop 'SetConsoleCP()' from the git-wrapper, so that input and output code
pages stay in sync.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-05-09 02:49:34 +02:00
Karsten Blees
761f1f546c compat/terminal.c: only use the Windows console if bash 'read -r' fails
Accessing the Windows console through the special CONIN$ / CONOUT$ devices
doesn't work properly for non-ASCII usernames an passwords.

It also doesn't work for terminal emulators that hide the native console
window (such as mintty), and 'TERM=xterm*' is not necessarily a reliable
indicator for such terminals.

The new shell_prompt() function, on the other hand, works fine for both
MSys1 and MSys2, in native console windows as well as mintty, and properly
supports Unicode. It just needs bash on the path (for 'read -s', which is
bash-specific).

On Windows, try to use the shell to read from the terminal. If that fails
with ENOENT (i.e. bash was not found), use CONIN/OUT as fallback.

Note: To test this, create a UTF-8 credential file with non-ASCII chars,
e.g. in git-bash: 'echo url=http://täst.com > cred.txt'. Then in git-cmd,
'git credential fill <cred.txt' works (shell version), while calling git
without the git-wrapper (i.e. 'mingw64\bin\git credential fill <cred.txt')
mangles non-ASCII chars in both console output and input.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-05-09 02:11:48 +02:00
Karsten Blees
bffea87550 fixup! mingw: Support git_terminal_prompt with more terminals
'xterm_prompt' is not xterm-specific, change function name and error
messages to reflect this.

'start_command' already prints an error message on failure, we don't need
another one.

Also print the script's exit code on failure.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-05-09 00:14:13 +02:00
Karsten Blees
297b780dc8 fixup! mingw: Support git_terminal_prompt with more terminals
Reduce shell invocations by chaining commands together.

Use 'echo' instead of 'printf \\n'.

Use 'read -s' instead of 'stty [-]echo', because we don't have 'stty'
in old msysgit.

Use 'bash' instead of 'sh' as 'read -s' is bash-specific (in case we
ever switch to dash or some other POSIX-only shell).

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-05-09 00:05:24 +02:00
Karsten Blees
03a9c6649b fixup! mingw: Support git_terminal_prompt with more terminals
Move 'close(child.out)' down.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-05-09 00:05:11 +02:00
Johannes Schindelin
438f3e75d1 fixup! git-wrapper: support the non-mintty fall-back for Git Bash
With this fix, SHOW_CONSOLE=1 will really force a new window to be
displayed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-07 15:49:43 +00:00
Johannes Schindelin
a5c8f5e40d Merge branch 'git-bash-wo-mintty'
This branch helps with installing a `git-bash.exe` that uses ConHost
(i.e. the default Windows console window) instead of MinTTY.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-07 15:27:45 +00:00
Karsten Blees
31741afb0c fixup! mingw: Support git_terminal_prompt with more terminals
Use strbuf_reset() instead of strbuf_setlen(..., 0).

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-05-07 14:18:28 +02:00
Karsten Blees
2b4d90fd47 fixup! mingw: Support git_terminal_prompt with more terminals
Also strip trailing CRLF instead of just LF or just CR.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-05-07 14:12:22 +02:00
Karsten Blees
dac3c16ec9 fixup! mingw: Support git_terminal_prompt with more terminals
Use 'read -r', so that '\' is interpreted verbatim rather than as escape
character.

Signed-off-by: Karsten Blees <blees@dcon.de>
2015-05-07 14:09:00 +02:00
Johannes Schindelin
27ae7e2b40 fixup! Git wrapper: allow overriding what executable is called
Avoid double initialization, pointed out by Eli Young.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-07 09:49:43 +00:00
dscho
2113021567 Merge pull request #138 from tboegi/150504_blame-resurrect-convert-to-git
blame: CRLF in the working tree and LF in the repo
2015-05-06 18:46:27 +02:00
dscho
b058360131 Merge pull request #140 from nalla/console-read-clarification
fixup! mingw: Support `git_terminal_prompt` with more terminals
2015-05-06 16:19:20 +02:00