1
0
mirror of https://github.com/git/git.git synced 2024-10-22 18:18:12 +02:00
Commit Graph

42701 Commits

Author SHA1 Message Date
Kazuki Yamaguchi
f292244c04 branch -d: refuse deleting a branch which is currently checked out
When a branch is checked out by current working tree, deleting the
branch is forbidden. However when the branch is checked out only by
other working trees, deleting incorrectly succeeds.
Use find_shared_symref() to check if the branch is in use, not just
comparing with the current working tree's HEAD.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Kazuki Yamaguchi <k@rhe.jp>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-29 13:05:53 -07:00
Junio C Hamano
90f7b16b3a Git 2.8
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.8.0
2016-03-28 12:19:45 -07:00
Pranit Bauva
c3f6b853bf api-parse-options.txt: document OPT_CMDMODE()
OPT_CMDMODE mechanism was introduced in the release of 1.8.5 to actively
notice when multiple "operation mode" options that specify mutually
incompatible operation modes are given.

Signed-off-by: Pranit Bauva <pranit.bauva@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-25 13:17:43 -07:00
Jean-Noël Avila
47caafddc3 Merge pull request #9 from vascool/fr
Fix inconsistencies
2016-03-25 17:11:20 +01:00
Vasco Almeida
bb31072246 l10n: fr: don't translate "merge" as a parameter
At builtin/checkout.c:1154, merge is a parameter to --conflict=<style>
(git checkout --conflict=merge).

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
2016-03-25 14:04:58 -01:00
Vasco Almeida
abf5795592 l10n: fr: change "id de clé" to match "id-clé"
At builtin/tag.c:23 French message translation, "<key-id>" was
translated to "<id-clé>", but at builtin/tag.c:355 "key-id" was
translated to "id de clé", hence an inconsistency in git tag -h output.

Translate "key-id" to "id-clé".
Alternatively, both places could use "id de clé" instead of "id-clé".

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
2016-03-25 14:04:58 -01:00
Vasco Almeida
a0f3d92b52 l10n: fr: fix wrongly translated option name
In the original source, tags and heads refer to that options (--head and
--tags) for git show-ref.

Don't translate that terms, since they refer to actual option names.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
2016-03-25 14:04:58 -01:00
Vasco Almeida
794b1d2ee1 l10n: fr: fix transcation of "dir"
"dir" was translated to the same string at builtin/log.c:1236,
but, also at that code line, "<dir>" was translate to "<répertoire>".

Before this commit, git format-patch -h would output "-o,
--output-directory <dir>" and <répertoire> in its description.

Use <répertoire> in both the parameter and description.

Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
2016-03-25 14:04:58 -01:00
Junio C Hamano
56331f8727 Merge branch 'ls/p4-doc-markup'
* ls/p4-doc-markup:
  Documentation: fix git-p4 AsciiDoc formatting
  Documentation: use ASCII quotation marks in git-p4
2016-03-24 12:28:06 -07:00
Junio C Hamano
269fe3aed4 Merge branch 'js/mingw-tests-2.8'
* js/mingw-tests-2.8:
  mingw: skip some tests in t9115 due to file name issues
  t1300: fix the new --show-origin tests on Windows
  t1300-repo-config: make it resilient to being run via 'sh -x'
  config --show-origin: report paths with forward slashes
2016-03-24 12:27:58 -07:00
Junio C Hamano
2a4c8c36a7 Merge branch 'sb/submodule-module-list-pathspec-fix'
A fix for a small regression in "module_list" helper that was
rewritten in C (also applies to 2.7.x).

* sb/submodule-module-list-pathspec-fix:
  submodule: fix regression for deinit without submodules
2016-03-24 12:27:13 -07:00
Nguyễn Thái Ngọc Duy
16a86d4329 git-apply.txt: mention the behavior inside a subdir
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-24 10:16:52 -07:00
Nguyễn Thái Ngọc Duy
d725fbde4f git-apply.txt: remove a space
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-24 10:16:50 -07:00
Alexander Kuleshov
01d98e8a5d submodule-config: use hashmap_iter_first()
The hashmap API provides hashmap_iter_first() helper for initialion
and getting the first entry of a hashmap. Let's use it instead of
doing initialization manually and then get the first entry.

There are no functional changes, just cleanup.

Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-23 13:39:13 -07:00
Junio C Hamano
7e4ba3686a Merge branch 'master' of git://github.com/git-l10n/git-po
* 'master' of git://github.com/git-l10n/git-po:
  l10n: pt_PT: Update and add new translations
  l10n: ca.po: update translation
  l10n: vi.po (2530t): Update translation
2016-03-23 12:22:42 -07:00
Junio C Hamano
b84e65d409 merge: fix NULL pointer dereference when merging nothing into void
When we are on an unborn branch and merging only one foreign parent,
we allow "git merge" to fast-forward to that foreign parent commit.

This codepath incorrectly attempted to dereference the list of
parents that the merge is going to record even when the list is
empty.  It must refuse to operate instead when there is no parent.

All other codepaths make sure the list is not empty before they
dereference it, and are safe.

Reported-by: Jose Ivan B. Vilarouca Filho
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-23 10:12:10 -07:00
Lars Schneider
887523ebb8 Documentation: fix git-p4 AsciiDoc formatting
Noticed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-23 10:09:11 -07:00
Johannes Schindelin
8257d3b458 mingw: skip some tests in t9115 due to file name issues
These two tests wanted to write file names which are incompatible with
Windows' file naming rules (even if they pass using Cygwin due to
Cygwin's magic path mangling).

While at it, skip the same tests also on MacOSX/HFS, as pointed out by
Torsten Bögershausen.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-23 10:03:37 -07:00
Johannes Schindelin
45bf32971c t1300: fix the new --show-origin tests on Windows
On Windows, we have that funny situation where the test script can refer
to POSIX paths because it runs in a shell that uses a POSIX emulation
layer ("MSYS2 runtime"). Yet, git.exe does *not* understand POSIX paths
at all but only pure Windows paths.

So let's just convert the POSIX paths to Windows paths before passing
them on to Git, using `pwd` (which is already modified on Windows to
output Windows paths).

While fixing the new tests on Windows, we also have to exclude the tests
that want to write a file with a name that is illegal on Windows
(unfortunately, there is more than one test trying to make use of that
file).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-23 10:02:46 -07:00
Johannes Schindelin
2ec20212c5 t1300-repo-config: make it resilient to being run via 'sh -x'
One way to diagnose broken regression tests is to run the test
script using 'sh -x t... -i -v' to find out which call actually
demonstrates the symptom.

Hence it is pretty counterproductive if the test script behaves
differently when being run via 'sh -x', in particular when using
test_cmp or test_i18ncmp on redirected stderr.  A more recent way
"sh tXXXX -i -v -x" has the same issue.

So let's use test_i18ngrep (as suggested by Jonathan Nieder) instead of
test_cmp/test_i18ncmp to verify that stderr looks as expected.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-23 09:59:21 -07:00
Johannes Schindelin
5ca6b7bb47 config --show-origin: report paths with forward slashes
On Windows, the backslash is the native directory separator, but all
supported Windows versions also accept the forward slash in most
circumstances.

Our tests expect forward slashes.

Relative paths are generated by Git using forward slashes.

So let's try to be consistent and use forward slashes in the $HOME part
of the paths reported by `git config --show-origin`, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-23 09:58:48 -07:00
Jiang Xin
103ee5c21e Merge branch 'master' of https://github.com/vnwildman/git
* 'master' of https://github.com/vnwildman/git:
  l10n: vi.po (2530t): Update translation
2016-03-23 23:01:51 +08:00
Jiang Xin
70749562fb Merge branch 'master' of git://github.com/alexhenrie/git-po
* 'master' of git://github.com/alexhenrie/git-po:
  l10n: ca.po: update translation
2016-03-23 22:48:14 +08:00
Stefan Beller
84ba959bbd submodule: fix regression for deinit without submodules
Per Cederqvist wrote:
> It used to be possible to run
>
>    git submodule deinit -f .
>
> to remove any submodules, no matter how many submodules you had.  That
> is no longer possible in projects that don't have any submodules at
> all.  The command will fail with:
>
>     error: pathspec '.' did not match any file(s) known to git.

This regression was introduced in 74703a1e4dfc (submodule: rewrite
`module_list` shell function in C, 2015-09-02), as we changed the
order of checking in new module listing to first check whether it is
a gitlin before feeding it to match_pathspec().  It used to be that
a pathspec that does not match any path were diagnosed as an error,
but the new code complains for a pathspec that does not match any
submodule path.

Arguably the new behaviour may give us a better diagnosis, but that
is inconsistent with the suggestion "deinit" gives, and also this
was an unintended accident.  The new behaviour hopefully can be
redesigned and implemented better in future releases, but for now,
switch these two checks to restore the same behavior as before.  In
an empty repository, giving the pathspec '.' will still get the same
"did not match" error, but that is the same bug we had before 1.7.0.

Reported-by: Per Cederqvist <cederp@opera.com>
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-22 19:26:43 -07:00
Junio C Hamano
db354b7f1b apply: remove unused call to free() in gitdiff_{old,new}name()
These two functions keep a copy of filename it was given, let
gitdiff_verify_name() to rewrite it to a new filename and then free
the original if they receive a newly minted filename.

However

 (1) when the original name is NULL, gitdiff_verify_name() returns
     either NULL or a newly minted value.  Either case, we do not
     have to worry about calling free() on the original NULL.

 (2) when the original name is not NULL, gitdiff_verify_name()
     either returns that as-is, or calls die() when it finds
     inconsistency in the patch.  When the function returns, we know
     that "if ()" statement always is false.

Noticed by Christian Couder.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-22 14:41:08 -07:00
Christian Couder
fda3e2cf01 builtin/apply: get rid of useless 'name' variable
While at it put an 'else' on the same line as the previous '}'.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-22 14:21:07 -07:00
Vasco Almeida
b3076a0920 l10n: pt_PT: Update and add new translations
Signed-off-by: Vasco Almeida <vascomalmeida@sapo.pt>
2016-03-22 16:23:56 -01:00
Alex Henrie
4ee278bb34 l10n: ca.po: update translation
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2016-03-21 23:04:22 -06:00
Sven Strickroth
b64c1e0718 commit: do not lose SQUASH_MSG contents
When concluding a conflicted "git merge --squash", the command
failed to read SQUASH_MSG that was prepared by "git merge", and
showed only the "# Conflicts:" list of conflicted paths.

Place the contents from SQUASH_MSG at the beginning, just like we
show the commit log skeleton first when concluding a normal merge,
and then show the "# Conflicts:" list, to help the user write the
log message for the resulting commit.

Test by Junio C Hamano <gitster@pobox.com>.

Signed-off-by: Sven Strickroth <sven@cs-ware.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-21 15:32:24 -07:00
Junio C Hamano
808ecd4cca Git 2.8-rc4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.8.0-rc4
2016-03-21 13:41:37 -07:00
Junio C Hamano
fb238fb4ba Sync with maint
* maint:
  Documentation: fix broken linkgit to git-config
  git-compat-util: st_add4: work around gcc 4.2.x compiler crash
2016-03-21 13:32:42 -07:00
Junio C Hamano
a0feb1b187 Merge branch 'mm/doc-hooks-linkgit-fix' into maint
* mm/doc-hooks-linkgit-fix:
  Documentation: fix broken linkgit to git-config
2016-03-21 13:32:18 -07:00
Matthieu Moy
ad52148a7d Documentation: fix broken linkgit to git-config
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-21 13:31:57 -07:00
Lars Schneider
c6a896b65e Documentation: use ASCII quotation marks in git-p4
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-21 11:14:24 -07:00
Junio C Hamano
074677315c Merge branch 'tb/avoid-gcc-on-darwin-10-6'
* tb/avoid-gcc-on-darwin-10-6:
  Revert "config.mak.uname: use clang for Mac OS X 10.6"
2016-03-21 09:20:13 -07:00
Eric Sunshine
c0ed7590ce Revert "config.mak.uname: use clang for Mac OS X 10.6"
This reverts commit 7b6daf8d2fee1a9866b1d4eddbfaa5dbc42c5dbb.

Now that st_add4() has been patched to work around the gcc 4.2.x
compiler crash, revert the sledge-hammer approach of forcing Mac OS X
10.6 to unconditionally use 'clang' rather than the default compiler
(gcc).

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-21 09:20:02 -07:00
Junio C Hamano
2ab5c88642 Merge branch 'es/st-add4-gcc-4.2-workaround' into maint
* es/st-add4-gcc-4.2-workaround:
  git-compat-util: st_add4: work around gcc 4.2.x compiler crash
2016-03-21 09:19:27 -07:00
Eric Sunshine
d616fbf256 git-compat-util: st_add4: work around gcc 4.2.x compiler crash
Although changes by 5b442c4 (tree-diff: catch integer overflow in
combine_diff_path allocation, 2016-02-19) are perfectly valid, they
unfortunately trigger an internal compiler error in gcc 4.2.x:

    combine-diff.c: In function 'diff_tree_combined':
    combine-diff.c:1391: internal compiler error: Segmentation fault: 11

Experimentation reveals that changing st_add4()'s argument evaluation
order is sufficient to sidestep this problem.

Although st_add3() does not trigger the compiler bug, for style
consistency, change its argument evaluation order to match.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-21 09:18:07 -07:00
Junio C Hamano
b552ff8c67 l10n-2.8.0-rnd3
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJW7oL/AAoJEMek6Rt1RHooLCYP/2VFyDz9HHqMD6/qARnlbN8M
 4b5BbBjrvfEyeuVh3u6ACdfjpBOgTwsR0HiKjflSdkt8oz9sMHMNYGp6HjjIoRDd
 SVkYvfJalT7nGdHV3BbUMccLxzy8Vc9Df2usBYQC3Xl2xqcTVsiJJs0JYp1VKZxd
 tEvDa/q2sIh/j4sD5lZSq7Kf456xFGl3UljUlEEwf5dAs+2DHN1GzOt/8Rw4yV3M
 XZLxfnAnQWKNOi6+XSxPAysSClOnjbO9igPhWSWmKm7/vtoklNAVPGIN+dlvSvZD
 ixNJWyfgfD/4/RbfC0+VTIojloA0a4iigb3J9B/+zdv3NDPjwxISgTTaTVKYSgbn
 YPTKedKmCNpQe2dsJRawLxzi62tW57eB2oHZhrhACBHobYTF0BU/XusP6bkpVBqH
 xcBQc+lvrNgWsualCnNYdl3dIMHkEJg/UxVDyLHXVi9yDrrdp3m9x12LNn3serNd
 CRlds4B8UIlp8A1DxR3PonXm06JmumZP05GhjXhRCgWPt8MFg28VifRmgKISAk6Q
 OWaC721i1lq23BZy+iyvpcadSZpEl/p3zHw4lvIMH/Mhpat0Q/EYM4h0N7dkyp+U
 JKrGbd4IJrVoVBd79SijIb8muO7UwVLzDwqd/NLvapLp7UrRIDrOKz5xTtO9QZhU
 llz0WX9hJyjv5bTHrB4y
 =o2YU
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.8.0-rnd3' of git://github.com/git-l10n/git-po

l10n-2.8.0-rnd3

* tag 'l10n-2.8.0-rnd3' of git://github.com/git-l10n/git-po:
  l10n: zh_CN: review for git v2.8.0 l10n round 2
  l10n: de.po: add missing newlines
  l10n: de.po: translate 22 new messages
  l10n: ko.po: Update Korean translation
  l10n: fr.po v2.8.0 round 3
  l10n: sv.po: Update Swedish translation (2530t0f0u)
  l10n: ru.po: update Russian translation
2016-03-20 18:06:05 -07:00
Junio C Hamano
257000c617 Merge branch 'master' of git://ozlabs.org/~paulus/gitk
* 'master' of git://ozlabs.org/~paulus/gitk:
  gitk: Follow themed bgcolor in help dialogs
  gitk: fr.po: Sync translations with git
  gitk: Update French translation (311t)
  gitk: Update German translation
  gitk: Update Bulgarian translation (311t)
2016-03-20 18:05:10 -07:00
Tran Ngoc Quan
c2d674031f l10n: vi.po (2530t): Update translation
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2016-03-21 07:21:04 +07:00
Ray Chen
26e4cbec45 l10n: zh_CN: review for git v2.8.0 l10n round 2
Signed-off-by: Ray Chen <oldsharp@gmail.com>
2016-03-20 18:46:02 +08:00
Guillermo S. Romero
22a713c72d gitk: Follow themed bgcolor in help dialogs
Make Help > About & Key bindings dialogs readable if theme
has changed font color to something incompatible with white.

Signed-off-by: Guillermo S. Romero <gsromero@infernal-iceberg.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2016-03-19 14:12:21 +11:00
Jean-Noel Avila
ffbd0d77eb gitk: fr.po: Sync translations with git
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2016-03-19 14:08:52 +11:00
Jean-Noel Avila
3782d70676 gitk: Update French translation (311t)
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2016-03-19 14:08:52 +11:00
Ralf Thielow
fec7b51ec4 gitk: Update German translation
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2016-03-19 14:07:34 +11:00
Alexander Shopov
37afa4010f gitk: Update Bulgarian translation (311t)
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2016-03-19 14:06:37 +11:00
Jeff King
1fad5033ad t/lib-httpd: pass through GIT_CONFIG_NOSYSTEM env
We set GIT_CONFIG_NOSYSTEM in our test scripts so that we do
not accidentally read /etc/gitconfig and have it influence
the outcome of the tests. But when running smart-http tests,
Apache will clean the environment, including this variable,
and the "server" side of our http operations will read it.

You can see this breakage by doing something like:

  make
  ./git config --system http.getanyfile false
  make test

which will cause t5561 to fail when it tests the
fallback-to-dumb operation.

We can fix this by instructing Apache to pass through the
variable. Unlike with other variables (e.g., 89c57ab3's
GIT_TRACE), we don't need to set a dummy value to prevent
warnings from Apache. test-lib.sh already makes sure that
GIT_CONFIG_NOSYSTEM is set and exported.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-18 15:37:58 -07:00
Jeff King
7d5e9c9849 credential-cache--daemon: clarify "exit" action semantics
When this code was originally written, there wasn't much
thought given to the timing between a client asking for
"exit", the daemon signaling that the action is done (with
EOF), and the actual cleanup of the socket.

However, we need to care about this so that our test scripts
do not end up racy (e.g., by asking for an exit and checking
that the socket was cleaned up). The code that is already
there happens to behave very reasonably; let's add a comment
to make it clear that any changes should retain the same
behavior.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-18 14:48:36 -07:00
Jeff King
a277d1efa3 send-email: ignore trailing whitespace in mailrc alias file
The regex for parsing mailrc considers everything after the
second whitespace to be the email address, up to the end of
the line. We have to include whitespace there, because you
may have multiple space-separated addresses, each with their
own internal quoting.

But if there is trailing whitespace, we include that, too.
This confuses quotewords() when we try to split the
individual addresses, and we end up storing "undef" in our
alias list. Later parts of the code then access that,
generating perl warnings.

Let's tweak our regex to throw away any trailing whitespace
on each line.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-03-18 14:47:10 -07:00