Compare commits

..

41 Commits

Author SHA1 Message Date
6ebdac1bab Git 2.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-02 09:05:47 -07:00
dd39dfcf8a Merge tag 'l10n-2.10.0-rnd2.2' of git://github.com/git-l10n/git-po
l10n-2.10.0-rnd2.2

* tag 'l10n-2.10.0-rnd2.2' of git://github.com/git-l10n/git-po:
  l10n: Updated Vietnamese translation for v2.10.0-rc2 (2757t)
2016-09-02 08:48:14 -07:00
e8e349249c Merge branch 'master' of https://github.com/vnwildman/git
* 'master' of https://github.com/vnwildman/git:
  l10n: Updated Vietnamese translation for v2.10.0-rc2 (2757t)
2016-09-02 21:29:48 +08:00
5b18e70009 A few more fixes before the final 2.10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-31 10:21:05 -07:00
934b1caa7a Merge tag 'l10n-2.10.0-rnd2' of git://github.com/git-l10n/git-po
l10n-2.10.0-rnd2

* tag 'l10n-2.10.0-rnd2' of git://github.com/git-l10n/git-po:
  l10n: zh_CN: for git v2.10.0 l10n round 2
  l10n: ca.po: update translation
  l10n: fr.po v2.10.0-rc2
  l10n: sv.po: Update Swedish translation (2757t0f0u)
  l10n: git.pot: v2.10.0 round 2 (12 new, 44 removed)
  l10n: Updated Vietnamese translation for v2.10.0 (2789t)
  l10n: pt_PT: update Portuguese translation
  l10n: pt_PT: merge git.pot
  l10n: ko.po: Update Korean translation
  l10n: git.pot: v2.10.0 round 1 (248 new, 56 removed)
2016-08-31 10:04:14 -07:00
58e72a2179 Merge branch 'ls/packet-line-protocol-doc-fix'
Correct an age-old calco (is that a typo-like word for calc)
in the documentation.

* ls/packet-line-protocol-doc-fix:
  pack-protocol: fix maximum pkt-line size
2016-08-31 10:03:51 -07:00
4762bf36d9 Merge branch 'mh/blame-worktree'
* mh/blame-worktree:
  blame: fix segfault on untracked files
2016-08-31 10:03:50 -07:00
9010077be2 Merge branch 'kw/patch-ids-optim'
* kw/patch-ids-optim:
  p3400: make test script executable
2016-08-31 10:03:49 -07:00
7841c4801c pack-protocol: fix maximum pkt-line size
According to LARGE_PACKET_MAX in pkt-line.h the maximal length of a
pkt-line packet is 65520 bytes. The pkt-line header takes 4 bytes and
therefore the pkt-line data component must not exceed 65516 bytes.

Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-30 11:00:29 -07:00
5c57d7622e l10n: zh_CN: for git v2.10.0 l10n round 2
Update 215 translations (2757t0f0u) for git v2.10.0-rc2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2016-08-31 00:11:13 +08:00
ba67504fa8 p3400: make test script executable
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-29 12:57:16 -07:00
bc6b13a7d2 blame: fix segfault on untracked files
Since 3b75ee9 ("blame: allow to blame paths freshly added to the index",
2016-07-16) git blame also looks at the index to determine if there is a
file that was freshly added to the index.

cache_name_pos returns -pos - 1 in case there is no match is found, or
if the name matches, but the entry has a stage other than 0.  As git
blame should work for unmerged files, it uses strcmp to determine
whether the name of the returned position matches, in which case the
file exists, but is merely unmerged, or if the file actually doesn't
exist in the index.

If the repository is empty, or if the file would lexicographically be
sorted as the last file in the repository, -cache_name_pos - 1 is
outside of the length of the active_cache array, causing git blame to
segfault.  Guard against that, and die() normally to restore the old
behaviour.

Reported-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-29 11:57:33 -07:00
63b8265402 l10n: ca.po: update translation
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2016-08-28 10:32:56 -06:00
b67e63067d l10n: fr.po v2.10.0-rc2
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
2016-08-28 11:36:14 +02:00
800d88e2b3 l10n: Updated Vietnamese translation for v2.10.0-rc2 (2757t)
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2016-08-28 07:23:30 +07:00
8ed2d3fb15 l10n: sv.po: Update Swedish translation (2757t0f0u)
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2016-08-27 20:42:50 +01:00
b30eec1a69 Merge branch 'master' of https://github.com/vnwildman/git
* 'master' of https://github.com/vnwildman/git:
  l10n: Updated Vietnamese translation for v2.10.0 (2789t)
2016-08-27 23:36:16 +08:00
5bd166d8af l10n: git.pot: v2.10.0 round 2 (12 new, 44 removed)
Generate po/git.pot from v2.10.0-rc2 for git v2.10.0 l10n round 2.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2016-08-27 23:23:26 +08:00
fe1280decc Merge branch 'master' of git://github.com/git-l10n/git-po
* 'master' of git://github.com/git-l10n/git-po:
  l10n: pt_PT: update Portuguese translation
  l10n: pt_PT: merge git.pot
  l10n: ko.po: Update Korean translation
  l10n: git.pot: v2.10.0 round 1 (248 new, 56 removed)
2016-08-27 23:14:27 +08:00
b9252573c4 l10n: Updated Vietnamese translation for v2.10.0 (2789t)
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2016-08-27 09:15:28 +07:00
d5cb9cbd64 Git 2.10-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-26 13:59:20 -07:00
e28eae3184 gitattributes: Document the unified "auto" handling
Update the documentation about text=auto:
text=auto now follows the core.autocrlf handling when files are not
normalized in the repository.

For a cross platform project recommend the usage of attributes for
line-ending conversions.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-26 13:54:16 -07:00
5cb0d5ad05 Prepare for 2.10.0-rc2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-25 13:56:51 -07:00
0fd6c99bdf Merge branch 'ja/i18n'
The recent i18n patch we added during this cycle did a bit too much
refactoring of the messages to avoid word-legos; the repetition has
been reduced to help translators.

* ja/i18n:
  i18n: simplify numeric error reporting
  i18n: fix git rebase interactive commit messages
  i18n: fix typos for translation
2016-08-25 13:55:07 -07:00
3dc01702df Merge branch 'bw/mingw-avoid-inheriting-fd-to-lockfile'
The tempfile (hence its user lockfile) API lets the caller to open
a file descriptor to a temporary file, write into it and then
finalize it by first closing the filehandle and then either
removing or renaming the temporary file.  When the process spawns a
subprocess after obtaining the file descriptor, and if the
subprocess has not exited when the attempt to remove or rename is
made, the last step fails on Windows, because the subprocess has
the file descriptor still open.  Open tempfile with O_CLOEXEC flag
to avoid this (on Windows, this is mapped to O_NOINHERIT).

* bw/mingw-avoid-inheriting-fd-to-lockfile:
  mingw: ensure temporary file handles are not inherited by child processes
  t6026-merge-attr: child processes must not inherit index.lock handles
2016-08-25 13:55:07 -07:00
a8998453be Merge branch 'dg/document-git-c-in-git-config-doc'
The "git -c var[=val] cmd" facility to append a configuration
variable definition at the end of the search order was described in
git(1) manual page, but not in git-config(1), which was more likely
place for people to look for when they ask "can I make a one-shot
override, and if so how?"

* dg/document-git-c-in-git-config-doc:
  doc: mention `git -c` in git-config(1)
2016-08-25 13:55:07 -07:00
13e11ff707 Merge branch 'js/no-html-bypass-on-windows'
On Windows, help.browser configuration variable used to be ignored,
which has been corrected.

* js/no-html-bypass-on-windows:
  Revert "display HTML in default browser using Windows' shell API"
2016-08-25 13:55:06 -07:00
a1f0b4e286 Merge branch 'hv/doc-commit-reference-style'
A small doc update.

* hv/doc-commit-reference-style:
  SubmittingPatches: document how to reference previous commits
2016-08-25 13:55:06 -07:00
41a616dada git ls-files: text=auto eol=lf is supported in Git 2.10
The man page for `git ls-files --eol` mentions the combination
of text attributes "text=auto eol=lf" or "text=auto eol=crlf" as not
supported yet, but may be in the future.

Now they are supported.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-25 13:38:18 -07:00
9d83143621 l10n: pt_PT: update Portuguese translation
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
2016-08-25 13:33:17 +00:00
587dae416d l10n: pt_PT: merge git.pot
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
2016-08-25 13:33:17 +00:00
078fe30523 i18n: simplify numeric error reporting
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-24 08:47:20 -07:00
8aa6dc1d9e i18n: fix git rebase interactive commit messages
For proper i18n, the logic cannot embed english specific processing.

Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-24 08:43:27 -07:00
cd3e4677cf i18n: fix typos for translation
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-24 08:41:22 -07:00
ae1f7094f7 doc: mention git -c in git-config(1)
Signed-off-by: David Glasser <glasser@davidglasser.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-23 10:55:58 -07:00
05d1ed6148 mingw: ensure temporary file handles are not inherited by child processes
When the index is locked and child processes inherit the handle to
said lock and the parent process wants to remove the lock before the
child process exits, on Windows there is a problem: it won't work
because files cannot be deleted if a process holds a handle on them.
The symptom:

    Rename from 'xxx/.git/index.lock' to 'xxx/.git/index' failed.
    Should I try again? (y/n)

Spawning child processes with bInheritHandles==FALSE would not work
because no file handles would be inherited, not even the hStdXxx
handles in STARTUPINFO (stdin/stdout/stderr).

Opening every file with O_NOINHERIT does not work, either, as e.g.
git-upload-pack expects inherited file handles.

This leaves us with the only way out: creating temp files with the
O_NOINHERIT flag. This flag is Windows-specific, however. For our
purposes, it is equivalent to O_CLOEXEC (which does not exist on
Windows), so let's just open temporary files with the O_CLOEXEC flag and
map that flag to O_NOINHERIT on Windows.

As Eric Wong pointed out, we need to be careful to handle the case where
the Linux headers used to compile Git support O_CLOEXEC but the Linux
kernel used to run Git does not: it returns an EINVAL.

This fixes the test that we just introduced to demonstrate the problem.

Signed-off-by: Ben Wijen <ben@wijen.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-23 09:09:55 -07:00
ec584cd69a l10n: ko.po: Update Korean translation
Signed-off-by: Changwoo Ryu <cwryu@debian.org>
2016-08-22 00:41:23 +09:00
6db5967d4e Revert "display HTML in default browser using Windows' shell API"
Since 4804aab (help (Windows): Display HTML in default browser using
Windows' shell API, 2008-07-13), Git for Windows used to call
`ShellExecute()` to launch the default Windows handler for `.html`
files.

The idea was to avoid going through a shell script, for performance
reasons.

However, this change ignores the `help.browser` config setting. Together
with browsing help not being a performance-critical operation, let's
just revert that patch.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-19 13:47:28 -07:00
ad65f7e3b7 t6026-merge-attr: child processes must not inherit index.lock handles
On Windows, a file cannot be removed unless all file handles to it have
been released. Hence it is particularly important to close handles when
spawning children (which would probably not even know that they hold on
to those handles).

The example chosen for this test is a custom merge driver that indeed
has no idea that it blocks the deletion of index.lock. The full use case
is a daemon that lives on after the merge, with subsequent invocations
handing off to the daemon, thereby avoiding hefty start-up costs. We
simulate this behavior by simply sleeping one second.

Note that the test only fails on Windows, due to the file locking issue.
Since we have no way to say "expect failure with MINGW, success
otherwise", we simply skip this test on Windows for now.

Signed-off-by: Ben Wijen <ben@wijen.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-18 13:56:45 -07:00
175d38ca23 SubmittingPatches: document how to reference previous commits
To reference previous commits people used to put just the
abbreviated SHA-1 into commit messages.  This is what has evolved as
a more stable format for referencing commits.  So lets document it
for everyone to look-up when needed.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-08-17 10:47:33 -07:00
9fa976fffe l10n: git.pot: v2.10.0 round 1 (248 new, 56 removed)
Generate po/git.pot from v2.10.0-rc0 for git v2.10.0 l10n round 1.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2016-08-15 22:45:20 +08:00
30 changed files with 24978 additions and 15415 deletions

View File

@ -77,7 +77,8 @@ UI, Workflows & Features
* "git archive" learned to handle files that are larger than 8GB and
commits far in the future than expressible by the traditional US-TAR
format.
(merge 5caeeb8 jk/big-and-future-archive-tar later to maint).
(merge 560b0e8 jk/big-and-future-archive-tar later to maint).
* A new configuration variable core.sshCommand has been added to
specify what value for GIT_SSH_COMMAND to use per repository.
@ -179,7 +180,7 @@ Performance, Internal Implementation, Development Support etc.
the standard output and the standard error of an external process,
which is cumbersome to hand-roll correctly without deadlocking.
The codepath to sign data in a prepared buffer with GPG has been
* The codepath to sign data in a prepared buffer with GPG has been
updated to use this API to read from the status-fd to check for
errors (instead of relying on GPG's exit status).
(merge efee955 jk/gpg-interface-cleanup later to maint).
@ -252,6 +253,9 @@ Performance, Internal Implementation, Development Support etc.
combination has been fixed to be equivalent to doing
$ git config core.autocrlf true
* Documentation has been updated to show better example usage
of the updated "text=auto" attribute.
* A few tests that specifically target "git rebase -i" have been
added.
@ -303,11 +307,15 @@ Performance, Internal Implementation, Development Support etc.
changes and attempts to find matches. This has been optimized by
lazily computing the full patch-id (which is expensive) to be
compared only for changes that touch the same set of paths.
(merge b3dfeeb kw/patch-ids-optim later to maint).
(merge ba67504 kw/patch-ids-optim later to maint).
* A handful of tests that were broken under gettext-poison build have
been fixed.
* The recent i18n patch we added during this cycle did a bit too much
refactoring of the messages to avoid word-legos; the repetition has
been reduced to help translators.
Also contains various documentation updates and code clean-ups.
@ -563,7 +571,7 @@ notes for details).
caused tests in t7063 to fail because it wanted to verify the
behaviour of the fast-path.
* Squelch compiler warnings for netmalloc (in compat/) library.
* Squelch compiler warnings for nedmalloc (in compat/) library.
* A small memory leak in the command line parsing of "git blame"
has been plugged.
@ -631,6 +639,32 @@ notes for details).
taught to notice these exit status codes.
(merge 45a4f5d jk/difftool-command-not-found later to maint).
* On Windows, help.browser configuration variable used to be ignored,
which has been corrected.
(merge 6db5967 js/no-html-bypass-on-windows later to maint).
* The "git -c var[=val] cmd" facility to append a configuration
variable definition at the end of the search order was described in
git(1) manual page, but not in git-config(1), which was more likely
place for people to look for when they ask "can I make a one-shot
override, and if so how?"
(merge ae1f709 dg/document-git-c-in-git-config-doc later to maint).
* The tempfile (hence its user lockfile) API lets the caller to open
a file descriptor to a temporary file, write into it and then
finalize it by first closing the filehandle and then either
removing or renaming the temporary file. When the process spawns a
subprocess after obtaining the file descriptor, and if the
subprocess has not exited when the attempt to remove or rename is
made, the last step fails on Windows, because the subprocess has
the file descriptor still open. Open tempfile with O_CLOEXEC flag
to avoid this (on Windows, this is mapped to O_NOINHERIT).
(merge 05d1ed6 bw/mingw-avoid-inheriting-fd-to-lockfile later to maint).
* Correct an age-old calco (is that a typo-like word for calc)
in the documentation.
(merge 7841c48 ls/packet-line-protocol-doc-fix later to maint).
* Other minor clean-ups and documentation updates
(merge 02a8cfa rs/merge-add-strategies-simplification later to maint).
(merge af4941d rs/merge-recursive-string-list-init later to maint).
@ -638,3 +672,4 @@ notes for details).
(merge ddd0bfa jk/tighten-alloc later to maint).
(merge ecf30b2 rs/mailinfo-lib later to maint).
(merge 0eb75ce sg/reflog-past-root later to maint).
(merge 4369523 hv/doc-commit-reference-style later to maint).

View File

@ -121,6 +121,11 @@ its behaviour. Try to make sure your explanation can be understood
without external resources. Instead of giving a URL to a mailing list
archive, summarize the relevant points of the discussion.
If you want to reference a previous commit in the history of a stable
branch use the format "abbreviated sha1 (subject, date)". So for example
like this: "Commit f86a374 (pack-bitmap.c: fix a memleak, 2015-03-30)
noticed [...]".
(3) Generate your patch using Git tools out of your commits.

View File

@ -263,6 +263,9 @@ The files are read in the order given above, with last value found taking
precedence over values read earlier. When multiple values are taken then all
values of a key from all files will be used.
You may override individual configuration parameters when running any git
command by using the `-c` option. See linkgit:git[1] for details.
All writing options will per default write to the repository specific
configuration file. Note that this also affects options like `--replace-all`
and `--unset`. *'git config' will only ever change one file at a time*.

View File

@ -159,8 +159,7 @@ not accessible in the working tree.
+
<eolattr> is the attribute that is used when checking out or committing,
it is either "", "-text", "text", "text=auto", "text eol=lf", "text eol=crlf".
Note: Currently Git does not support "text=auto eol=lf" or "text=auto eol=crlf",
that may change in the future.
Since Git 2.10 "text=auto eol=lf" and "text=auto eol=crlf" are supported.
+
Both the <eolinfo> in the index ("i/<eolinfo>")
and in the working tree ("w/<eolinfo>") are shown for regular files,

View File

@ -43,6 +43,11 @@ unreleased) version of Git, that is available from the 'master'
branch of the `git.git` repository.
Documentation for older releases are available here:
* link:v2.10.0/git.html[documentation for release 2.10]
* release notes for
link:RelNotes/2.10.0.txt[2.10].
* link:v2.9.3/git.html[documentation for release 2.9.3]
* release notes for

View File

@ -182,6 +182,30 @@ While Git normally leaves file contents alone, it can be configured to
normalize line endings to LF in the repository and, optionally, to
convert them to CRLF when files are checked out.
If you simply want to have CRLF line endings in your working directory
regardless of the repository you are working with, you can set the
config variable "core.autocrlf" without using any attributes.
------------------------
[core]
autocrlf = true
------------------------
This does not force normalization of text files, but does ensure
that text files that you introduce to the repository have their line
endings normalized to LF when they are added, and that files that are
already normalized in the repository stay normalized.
If you want to ensure that text files that any contributor introduces to
the repository have their line endings normalized, you can set the
`text` attribute to "auto" for _all_ files.
------------------------
* text=auto
------------------------
The attributes allow a fine-grained control, how the line endings
are converted.
Here is an example that will make Git normalize .txt, .vcproj and .sh
files, ensure that .vcproj files have CRLF and .sh files have LF in
the working directory, and prevent .jpg files from being normalized
@ -195,48 +219,14 @@ regardless of their content.
*.jpg -text
------------------------
Other source code management systems normalize all text files in their
repositories, and there are two ways to enable similar automatic
normalization in Git.
NOTE: When `text=auto` conversion is enabled in a cross-platform
project using push and pull to a central repository the text files
containing CRLFs should be normalized.
If you simply want to have CRLF line endings in your working directory
regardless of the repository you are working with, you can set the
config variable "core.autocrlf" without using any attributes.
------------------------
[core]
autocrlf = true
------------------------
This does not force normalization of all text files, but does ensure
that text files that you introduce to the repository have their line
endings normalized to LF when they are added, and that files that are
already normalized in the repository stay normalized.
If you want to interoperate with a source code management system that
enforces end-of-line normalization, or you simply want all text files
in your repository to be normalized, you should instead set the `text`
attribute to "auto" for _all_ files.
------------------------
* text=auto
------------------------
This ensures that all files that Git considers to be text will have
normalized (LF) line endings in the repository. The `core.eol`
configuration variable controls which line endings Git will use for
normalized files in your working directory; the default is to use the
native line ending for your platform, or CRLF if `core.autocrlf` is
set.
NOTE: When `text=auto` normalization is enabled in an existing
repository, any text files containing CRLFs should be normalized. If
they are not they will be normalized the next time someone tries to
change them, causing unfortunate misattribution. From a clean working
directory:
From a clean working directory:
-------------------------------------------------
$ echo "* text=auto" >>.gitattributes
$ echo "* text=auto" >.gitattributes
$ rm .git/index # Remove the index to force Git to
$ git reset # re-scan the working directory
$ git status # Show files that will be normalized

View File

@ -67,9 +67,9 @@ with non-binary data the same whether or not they contain the trailing
LF (stripping the LF if present, and not complaining when it is
missing).
The maximum length of a pkt-line's data component is 65520 bytes.
Implementations MUST NOT send pkt-line whose length exceeds 65524
(65520 bytes of payload + 4 bytes of length data).
The maximum length of a pkt-line's data component is 65516 bytes.
Implementations MUST NOT send pkt-line whose length exceeds 65520
(65516 bytes of payload + 4 bytes of length data).
Implementations SHOULD NOT send an empty pkt-line ("0004").

View File

@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
DEF_VER=v2.10.0-rc1
DEF_VER=v2.10.0
LF='
'

View File

@ -2244,7 +2244,8 @@ static void verify_working_tree_path(struct commit *work_tree, const char *path)
pos = cache_name_pos(path, strlen(path));
if (pos >= 0)
; /* path is in the index */
else if (!strcmp(active_cache[-1 - pos]->name, path))
else if (-1 - pos < active_nr &&
!strcmp(active_cache[-1 - pos]->name, path))
; /* path is in the index, unmerged */
else
die("no such path '%s' in HEAD", path);

View File

@ -379,17 +379,10 @@ static void get_html_page_path(struct strbuf *page_path, const char *page)
free(to_free);
}
/*
* If open_html is not defined in a platform-specific way (see for
* example compat/mingw.h), we use the script web--browse to display
* HTML.
*/
#ifndef open_html
static void open_html(const char *path)
{
execl_git_cmd("web--browse", "-c", "help.browser", path, (char *)NULL);
}
#endif
static void show_html_page(const char *git_cmd)
{

View File

@ -1930,48 +1930,6 @@ int mingw_raise(int sig)
}
}
static const char *make_backslash_path(const char *path)
{
static char buf[PATH_MAX + 1];
char *c;
if (strlcpy(buf, path, PATH_MAX) >= PATH_MAX)
die("Too long path: %.*s", 60, path);
for (c = buf; *c; c++) {
if (*c == '/')
*c = '\\';
}
return buf;
}
void mingw_open_html(const char *unixpath)
{
const char *htmlpath = make_backslash_path(unixpath);
typedef HINSTANCE (WINAPI *T)(HWND, const char *,
const char *, const char *, const char *, INT);
T ShellExecute;
HMODULE shell32;
int r;
shell32 = LoadLibrary("shell32.dll");
if (!shell32)
die("cannot load shell32.dll");
ShellExecute = (T)GetProcAddress(shell32, "ShellExecuteA");
if (!ShellExecute)
die("cannot run browser");
printf("Launching default browser to display HTML ...\n");
r = HCAST(int, ShellExecute(NULL, "open", htmlpath,
NULL, "\\", SW_SHOWNORMAL));
FreeLibrary(shell32);
/* see the MSDN documentation referring to the result codes here */
if (r <= 32) {
die("failed to launch browser for %.*s", MAX_PATH, unixpath);
}
}
int link(const char *oldpath, const char *newpath)
{
typedef BOOL (WINAPI *T)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);

View File

@ -67,6 +67,10 @@ typedef int pid_t;
#define F_SETFD 2
#define FD_CLOEXEC 0x1
#if !defined O_CLOEXEC && defined O_NOINHERIT
#define O_CLOEXEC O_NOINHERIT
#endif
#ifndef EAFNOSUPPORT
#define EAFNOSUPPORT WSAEAFNOSUPPORT
#endif
@ -417,9 +421,6 @@ int mingw_offset_1st_component(const char *path);
#include <inttypes.h>
#endif
void mingw_open_html(const char *path);
#define open_html mingw_open_html
/**
* Converts UTF-8 encoded string to UTF-16LE.
*

View File

@ -652,46 +652,34 @@ int git_parse_ulong(const char *value, unsigned long *ret)
NORETURN
static void die_bad_number(const char *name, const char *value)
{
const char * error_type = (errno == ERANGE)? _("out of range"):_("invalid unit");
if (!value)
value = "";
if (!(cf && cf->name))
die(errno == ERANGE
? _("bad numeric config value '%s' for '%s': out of range")
: _("bad numeric config value '%s' for '%s': invalid unit"),
value, name);
die(_("bad numeric config value '%s' for '%s': %s"),
value, name, error_type);
switch (cf->origin_type) {
case CONFIG_ORIGIN_BLOB:
die(errno == ERANGE
? _("bad numeric config value '%s' for '%s' in blob %s: out of range")
: _("bad numeric config value '%s' for '%s' in blob %s: invalid unit"),
value, name, cf->name);
die(_("bad numeric config value '%s' for '%s' in blob %s: %s"),
value, name, cf->name, error_type);
case CONFIG_ORIGIN_FILE:
die(errno == ERANGE
? _("bad numeric config value '%s' for '%s' in file %s: out of range")
: _("bad numeric config value '%s' for '%s' in file %s: invalid unit"),
value, name, cf->name);
die(_("bad numeric config value '%s' for '%s' in file %s: %s"),
value, name, cf->name, error_type);
case CONFIG_ORIGIN_STDIN:
die(errno == ERANGE
? _("bad numeric config value '%s' for '%s' in standard input: out of range")
: _("bad numeric config value '%s' for '%s' in standard input: invalid unit"),
value, name);
die(_("bad numeric config value '%s' for '%s' in standard input: %s"),
value, name, error_type);
case CONFIG_ORIGIN_SUBMODULE_BLOB:
die(errno == ERANGE
? _("bad numeric config value '%s' for '%s' in submodule-blob %s: out of range")
: _("bad numeric config value '%s' for '%s' in submodule-blob %s: invalid unit"),
value, name, cf->name);
die(_("bad numeric config value '%s' for '%s' in submodule-blob %s: %s"),
value, name, cf->name, error_type);
case CONFIG_ORIGIN_CMDLINE:
die(errno == ERANGE
? _("bad numeric config value '%s' for '%s' in command line %s: out of range")
: _("bad numeric config value '%s' for '%s' in command line %s: invalid unit"),
value, name, cf->name);
die(_("bad numeric config value '%s' for '%s' in command line %s: %s"),
value, name, cf->name, error_type);
default:
die(errno == ERANGE
? _("bad numeric config value '%s' for '%s' in %s: out of range")
: _("bad numeric config value '%s' for '%s' in %s: invalid unit"),
value, name, cf->name);
die(_("bad numeric config value '%s' for '%s' in %s: %s"),
value, name, cf->name, error_type);
}
}

View File

@ -667,6 +667,10 @@ void *gitmemmem(const void *haystack, size_t haystacklen,
#define getpagesize() sysconf(_SC_PAGESIZE)
#endif
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif
#ifdef FREAD_READS_DIRECTORIES
#ifdef fopen
#undef fopen

View File

@ -404,51 +404,12 @@ pick_one_preserving_merges () {
this_nth_commit_message () {
n=$1
case "$n" in
1) gettext "This is the 1st commit message:";;
2) gettext "This is the 2nd commit message:";;
3) gettext "This is the 3rd commit message:";;
4) gettext "This is the 4th commit message:";;
5) gettext "This is the 5th commit message:";;
6) gettext "This is the 6th commit message:";;
7) gettext "This is the 7th commit message:";;
8) gettext "This is the 8th commit message:";;
9) gettext "This is the 9th commit message:";;
10) gettext "This is the 10th commit message:";;
# TRANSLATORS: if the language you are translating into
# doesn't allow you to compose a sentence in this fashion,
# consider translating as if this and the following few strings
# were "This is the commit message ${n}:"
*1[0-9]|*[04-9]) eval_gettext "This is the \${n}th commit message:";;
*1) eval_gettext "This is the \${n}st commit message:";;
*2) eval_gettext "This is the \${n}nd commit message:";;
*3) eval_gettext "This is the \${n}rd commit message:";;
*) eval_gettext "This is the commit message \${n}:";;
esac
eval_gettext "This is the commit message #\${n}:"
}
skip_nth_commit_message () {
n=$1
case "$n" in
1) gettext "The 1st commit message will be skipped:";;
2) gettext "The 2nd commit message will be skipped:";;
3) gettext "The 3rd commit message will be skipped:";;
4) gettext "The 4th commit message will be skipped:";;
5) gettext "The 5th commit message will be skipped:";;
6) gettext "The 6th commit message will be skipped:";;
7) gettext "The 7th commit message will be skipped:";;
8) gettext "The 8th commit message will be skipped:";;
9) gettext "The 9th commit message will be skipped:";;
10) gettext "The 10th commit message will be skipped:";;
# TRANSLATORS: if the language you are translating into
# doesn't allow you to compose a sentence in this fashion,
# consider translating as if this and the following few strings
# were "The commit message ${n} will be skipped:"
*1[0-9]|*[04-9]) eval_gettext "The \${n}th commit message will be skipped:";;
*1) eval_gettext "The \${n}st commit message will be skipped:";;
*2) eval_gettext "The \${n}nd commit message will be skipped:";;
*3) eval_gettext "The \${n}rd commit message will be skipped:";;
*) eval_gettext "The commit message \${n} will be skipped:";;
esac
eval_gettext "The commit message #\${n} will be skipped:"
}
update_squash_messages () {

View File

@ -55,6 +55,10 @@
* * calling `fdopen_lock_file()` to get a `FILE` pointer for the
* open file and writing to the file using stdio.
*
* Note that the file descriptor returned by hold_lock_file_for_update()
* is marked O_CLOEXEC, so the new contents must be written by the
* current process, not a spawned one.
*
* When finished writing, the caller can:
*
* * Close the file descriptor and rename the lockfile to its final

6157
po/ca.po

File diff suppressed because it is too large Load Diff

5000
po/fr.po

File diff suppressed because it is too large Load Diff

4521
po/git.pot

File diff suppressed because it is too large Load Diff

4785
po/ko.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

4950
po/sv.po

File diff suppressed because it is too large Load Diff

4958
po/vi.po

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -702,7 +702,7 @@ static struct commit *parse_insn_line(char *bol, char *eol, struct replay_opts *
if (action != opts->action) {
if (action == REPLAY_REVERT)
error((opts->action == REPLAY_REVERT)
? _("Cannot revert during a another revert.")
? _("Cannot revert during another revert.")
: _("Cannot revert during a cherry-pick."));
else
error((opts->action == REPLAY_REVERT)

0
t/perf/p3400-rebase.sh Normal file → Executable file
View File

View File

@ -181,4 +181,17 @@ test_expect_success 'up-to-date merge without common ancestor' '
)
'
test_expect_success 'custom merge does not lock index' '
git reset --hard anchor &&
write_script sleep-one-second.sh <<-\EOF &&
sleep 1 &
EOF
test_write_lines >.gitattributes \
"* merge=ours" "text merge=sleep-one-second" &&
test_config merge.ours.driver true &&
test_config merge.sleep-one-second.driver ./sleep-one-second.sh &&
git merge master
'
test_done

View File

@ -6,6 +6,11 @@ test_description='git blame'
PROG='git blame -c'
. "$TEST_DIRECTORY"/annotate-tests.sh
test_expect_success 'blame untracked file in empty repo' '
>untracked &&
test_must_fail git blame untracked
'
PROG='git blame -c -e'
test_expect_success 'blame --show-email' '
check_count \

View File

@ -120,7 +120,12 @@ int create_tempfile(struct tempfile *tempfile, const char *path)
prepare_tempfile_object(tempfile);
strbuf_add_absolute_path(&tempfile->filename, path);
tempfile->fd = open(tempfile->filename.buf, O_RDWR | O_CREAT | O_EXCL, 0666);
tempfile->fd = open(tempfile->filename.buf,
O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC, 0666);
if (O_CLOEXEC && tempfile->fd < 0 && errno == EINVAL)
/* Try again w/o O_CLOEXEC: the kernel might not support it */
tempfile->fd = open(tempfile->filename.buf,
O_RDWR | O_CREAT | O_EXCL, 0666);
if (tempfile->fd < 0) {
strbuf_reset(&tempfile->filename);
return -1;

View File

@ -33,6 +33,10 @@
* * calling `fdopen_tempfile()` to get a `FILE` pointer for the
* open file and writing to the file using stdio.
*
* Note that the file descriptor returned by create_tempfile()
* is marked O_CLOEXEC, so the new contents must be written by
* the current process, not any spawned one.
*
* When finished writing, the caller can:
*
* * Close the file descriptor and remove the temporary file by