Commit Graph

50454 Commits

Author SHA1 Message Date
Thomas Braun
b315e7d5d5 Config option to disable side-band-64k for transport
Since commit 0c499ea60f the send-pack builtin uses the side-band-64k
capability if advertised by the server.

Unfortunately this breaks pushing over the dump git protocol if used
over a network connection.

The detailed reasons for this breakage are (by courtesy of Jeff Preshing,
quoted from ttps://groups.google.com/d/msg/msysgit/at8D7J-h7mw/eaLujILGUWoJ):
----------------------------------------------------------------------------
MinGW wraps Windows sockets in CRT file descriptors in order to mimic the
functionality of POSIX sockets. This causes msvcrt.dll to treat sockets as
Installable File System (IFS) handles, calling ReadFile, WriteFile,
DuplicateHandle and CloseHandle on them. This approach works well in simple
cases on recent versions of Windows, but does not support all usage patterns.
In particular, using this approach, any attempt to read & write concurrently
on the same socket (from one or more processes) will deadlock in a scenario
where the read waits for a response from the server which is only invoked after
the write. This is what send_pack currently attempts to do in the use_sideband
codepath.
----------------------------------------------------------------------------

The new config option "sendpack.sideband" allows to override the side-band-64k
capability of the server, and thus makes the dump git protocol work.

Other transportation methods like ssh and http/https still benefit from
the sideband channel, therefore the default value of "sendpack.sideband"
is still true.

Signed-off-by: Thomas Braun <thomas.braun@byte-physics.de>
2015-05-14 10:22:31 +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
마누엘
358701671b fixup! mingw: Support git_terminal_prompt with more terminals
During the next rebase merge the clarification of the *read from the
console* command with the previous commits. Then get rid of this commit
message.

Signed-off-by: 마누엘 <nalla@hamal.uberspace.de>
2015-05-06 15:27:20 +02:00
Johannes Schindelin
d207cffe9b git-wrapper: support the non-mintty fall-back for Git Bash
When we fall back to starting the Git Bash in the regular Windows
console, we need to show said console's window... So let's introduce yet
another configuration knob for use via string resources.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-06 12:09:03 +00:00
Johannes Schindelin
d56d2f8c48 squash! mingw: Support git_terminal_prompt with more terminals
Adjust the commit message with the following paragraph:

The most prominent user of `git_terminal_prompt()` is certainly
`git-remote-https.exe`. It is an interesting use case because both
`stdin` and `stdout` are redirected when Git calls said executable, yet
it still wants to access the terminal.

When running inside a `mintty`, the terminal is not accessible to the
`git-remote-https.exe` program, though, because it is a MinGW program
and the `mintty` terminal is not backed by a Win32 console.

To solve that problem, we simply call out to the shell -- which is an
*MSys2* program and can therefore access `/dev/tty`.
2015-05-06 07:52:05 +00:00
Johannes Schindelin
a105bde8d3 Merge branch 'xp-console'
This branch wants to be merged into the git-wrapper branch; it fixes an
issue with the way we called the MSys2 terminal `mintty` from the GUI
application `git-bash.exe`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-04 16:24:35 +02:00
Johannes Schindelin
dbd0783837 git wrapper: allow _Git Bash_ to run with a newly allocated console
With a recent change in Cygwin (which is the basis of the msys2-runtime),
a GUI process desiring to launch an MSys2 executable needs to allocate a
console for the new process (otherwise the process will just hang on
Windows XP). _Git Bash_ is such a GUI process.

While at it, use correct handles when inheriting the stdin/stdout/stderr
handles: `GetStdHandle()` returns NULL for invalid handles, but the
STARTUPINFO must specify `INVALID_HANDLE_VALUE` instead.

Originally, the hope was that only this `NULL` => `INVALID_HANDLE_VALUE`
conversion would be required to fix the Windows XP issue mentioned above
(extensive debugging revealed that starting _Git Bash_ on Windows XP would
yield invalid handles for `stdin` and `stderr`, but *not* for `stdout`).

However, while _Git Bash_ eventually showed a `mintty` when not allocating
a new console, it took around one second to show it, and several seconds
to close it. So let's just include both fixes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-04 06:38:44 -07:00
Johannes Schindelin
ab5cce0ac8 git-wrapper: prepare to allow more options than MINIMAL_PATH
With the resource-driven command-line configuration, we introduced the
option to ensure that only the PATH environment variable is edited only
minimally, i.e. only /cmd/ is added (as appropriate for _Git CMD_).

We are about to add another option, so let's refactor the equivalent of
Git's `strip_prefix()` function; It is not *quite* the same because we
have to `memmove()` the remainder to the beginning of the buffer.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-04 06:34:52 -07:00
Johannes Schindelin
dd07b7d2c3 fixup! Git wrapper: allow overriding what executable is called 2015-05-04 06:34:15 -07:00
Torsten Bögershausen
8354b03718 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-04 05:26:05 +01:00
Johannes Schindelin
5294e722c6 Merge pull request #104 from dscho/super-config
Add support for %PROGRAMDATA%\Git\config

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-01 15:36:00 +02:00
Johannes Schindelin
80b9abc664 Merge pull request #60 from weakcamel/fscanf-64bit-constants
Correct fscanf formatting string for I64u values

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-01 15:36:00 +02:00
Johannes Schindelin
2050b50192 Merge pull request #98 from nalla/stdout-unbuffered
mingw: explicitly `fflush` stdout
2015-05-01 15:36:00 +02:00
Johannes Schindelin
571f886c69 Merge 'git-wrapper' into HEAD
Use msysGit's `git-wrapper` instead of the builtins. This works around
two issues:

- when the file system does not allow hard links, we would waste over
  800 megabyte by having 109 copies of a multi-megabyte executable

- even when the file system allows hard links, the Windows Explorer
  counts the disk usage as if it did not. Many users complained about
  Git for Windows using too much space (when it actually did not). We
  can easily avoid those user complaints by merging this branch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-01 15:36:00 +02:00
Johannes Schindelin
5d433b4d10 Merge 'poll_inftim' into HEAD
This was originally 'pull request #330 from ethomson/poll_inftim' in
msysgit/git.

poll: honor the timeout on Win32

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-01 15:35:59 +02:00
Johannes Schindelin
30bc1ec473 Merge 'non-win-fixes' into HEAD 2015-05-01 15:35:59 +02:00
Johannes Schindelin
0bb4374323 Merge 'sideband-bug' into HEAD
This works around the push-over-git-protocol issues pointed out in
https://github.com/msysgit/git/issues/101.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-01 15:35:59 +02:00
Johannes Schindelin
5d68b693b8 Merge 'readme' into HEAD
Add a README.md for GitHub goodness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2015-05-01 15:35:59 +02:00
Johannes Schindelin
586e4783d4 Merge 'fix-is-exe' into HEAD 2015-05-01 15:35:59 +02:00
Johannes Schindelin
40dc8e3160 Merge 'fix-externals' into HEAD 2015-05-01 15:35:58 +02:00