summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* compat/mingw.h: define PRId64jk/config-int-range-checkJohannes Sixt2013-09-191-0/+1
| | | | | | | Provide PRId64 alongside PRIuMAX. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* git-config: always treat --int as 64-bit internallyJeff King2013-09-094-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you run "git config --int", the maximum size of integer you get depends on how git was compiled, and what it considers to be an "int". This is almost useful, because your scripts calling "git config" will behave similarly to git internally. But relying on this is dubious; you have to actually know how git treats each value internally (e.g., int versus unsigned long), which is not documented and is subject to change. And even if you know it is "unsigned long", we do not have a git-config option to match that behavior. Furthermore, you may simply be asking git to store a value on your behalf (e.g., configuration for a hook). In that case, the relevant range check has nothing at all to do with git, but rather with whatever scripting tools you are using (and git has no way of knowing what the appropriate range is there). Not only is the range check useless, but it is actively harmful, as there is no way at all for scripts to look at config variables with large values. For instance, one cannot reliably get the value of pack.packSizeLimit via git-config. On an LP64 system, git happily uses a 64-bit "unsigned long" internally to represent the value, but the script cannot read any value over 2G. Ideally, the "--int" option would simply represent an arbitrarily large integer. For practical purposes, however, a 64-bit integer is large enough, and is much easier to implement (and if somebody overflows it, we will still notice the problem, and not simply return garbage). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* config: make numeric parsing errors more clearJeff King2013-09-093-9/+16
| | | | | | | | | | | | | | | | | | | | | | If we try to parse an integer config argument and get a number outside of the representable range, we die with the cryptic message: "bad config value for '%s'". We can improve two things: 1. Show the value that produced the error (e.g., bad config value '3g' for 'foo.bar'). 2. Mention the reason the value was rejected (e.g., "invalid unit" versus "out of range"). A few tests need to be updated with the new output, but that should not be representative of real-world breakage, as scripts should not be depending on the exact text of our stderr output, which is subject to i18n anyway. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* config: set errno in numeric git_parse_* functionsJeff King2013-09-091-4/+14
| | | | | | | | | | | | | | | | | When we are parsing an integer or unsigned long, we use the strto*max functions, which properly set errno to ERANGE if we get a large value. However, we also do further range checks after applying our multiplication factor, but do not set ERANGE. This means that a caller cannot tell if an error was caused by ERANGE or if the input was simply not a valid number. This patch teaches git_parse_signed and git_parse_unsigned to set ERANGE for range errors, and EINVAL for other errors, so that the caller can reliably tell these cases apart. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* config: properly range-check integer valuesJeff King2013-09-091-6/+6
| | | | | | | | | | | | | | | | | | | | | | | When we look at a config value as an integer using the git_config_int function, we carefully range-check the value we get and complain if it is out of our range. But the range we compare to is that of a "long", which we then cast to an "int" in the function's return value. This means that on systems where "int" and "long" have different sizes (e.g., LP64 systems), we may pass the range check, but then return nonsense by truncating the value as we cast it to an int. We can solve this by converting git_parse_long into git_parse_int, and range-checking the "int" range. Nobody actually cared that we used a "long" internally, since the result was truncated anyway. And the only other caller of git_parse_long is git_config_maybe_bool, which should be fine to just use int (though we will now forbid out-of-range nonsense like setting "merge.ff" to "10g" to mean "true", which is probably a good thing). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* config: factor out integer parsing from range checksJeff King2013-09-091-6/+22
| | | | | | | | | | | | | | | When we are parsing integers for config, we use an intmax_t (or uintmax_t) internally, and then check against the size of our result type at the end. We can parameterize the maximum representable value, which will let us re-use the parsing code for a variety of range checks. Unfortunately, we cannot combine the signed and unsigned parsing functions easily, as we have to rely on the signed and unsigned C types internally. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Git 1.8.4-rc4v1.8.4-rc4Junio C Hamano2013-08-192-10/+1
| | | | | | | | As we had to revert two topics at the last minute, let's have another (hopefully short) round of rc to make sure the final release will be sound. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Revert "Add new @ shortcut for HEAD"Junio C Hamano2013-08-145-28/+0
| | | | | | | | | | | This reverts commit cdfd94837b27c220f70f032b596ea993d195488f, as it does not just apply to "@" (and forms with modifiers like @{u} applied to it), but also affects e.g. "refs/heads/@/foo", which it shouldn't. The basic idea of giving a short-hand might be good, and the topic can be retried later, but let's revert to avoid affecting existing use cases for now for the upcoming release.
* Revert "git stash: avoid data loss when "git stash save" kills a directory"Junio C Hamano2013-08-143-40/+2
| | | | | | | | | | This reverts commit a73653130edd6a8977106d45a8092c09040f9132, as it has been reported that "ls-files --killed" is too time-consuming in a deep directory with too many untracked crufts (e.g. $HOME/.git tracking only a few files). We'd need to revisit it later but "ls-files --killed" needs to be optimized before it happens.
* Git 1.8.4-rc3v1.8.4-rc3Junio C Hamano2013-08-131-1/+1
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge git://github.com/git-l10n/git-poJunio C Hamano2013-08-132-0/+9672
|\ | | | | | | | | | | * git://github.com/git-l10n/git-po: l10n: Add reference for french translation team l10n: fr.po: 821/2112 messages translated
| * l10n: Add reference for french translation teamJean-Noel Avila2013-08-111-0/+4
| | | | | | | | Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
| * l10n: fr.po: 821/2112 messages translatedJean-Noel Avila2013-08-111-0/+9668
| | | | | | | | | | | | Trying to focus on most useful phrases. Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
* | Merge branch 'sb/mailmap-updates'Junio C Hamano2013-08-131-2/+16
|\ \ | | | | | | | | | | | | | | | * sb/mailmap-updates: .mailmap: Combine more (name, email) to individual persons .mailmap: update long-lost friends with multiple defunct addresses
| * | .mailmap: Combine more (name, email) to individual personssb/mailmap-updatesStefan Beller2013-08-131-1/+3
| | | | | | | | | | | | | | | Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | .mailmap: update long-lost friends with multiple defunct addressesJunio C Hamano2013-08-131-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A handful of past contributors are recorded with multiple e-mail addresses, all of which are undeliverable. With a lot of help from Jonathan, we located all of them except for one person, and a pair of addresses we suspect belong to a single person but we are not certain. Update the found ones with their currently preferred address, and use the last known address to consolidate contributions by the lost one. Helped-by: Stefan Beller <stefanbeller@googlemail.com> Helped-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | git-remote-mediawiki: ignore generated git-mwMatthieu Moy2013-08-131-0/+1
| |/ |/| | | | | | | Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2013-08-091-1/+1
|\ \ | | | | | | | | | | | | * maint: parse-options: fix clang opterror() -Wunused-value warning
| * | parse-options: fix clang opterror() -Wunused-value warningEric Sunshine2013-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a469a1019352b8ef (silence some -Wuninitialized false positives; 2012-12-15) triggered "unused value" warnings when the return value of opterror() and several other error-related functions was not used. 5ded807f7c0be10e (fix clang -Wunused-value warnings for error functions; 2013-01-16) applied a fix by adding #if !defined(__clang__) in cache.h and git-compat-util.h, but misspelled it as #if !defined(clang) in parse-options.h. Fix this. This mistake went unnoticed because existing callers of opterror() utilize its return value. 1158826394e162c5 (parse-options: add OPT_CMDMODE(); 2013-07-30), however, adds a new invocation of opterror() which ignores the return value, thus triggering the "unused value" warning. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'master' of git://github.com/git-l10n/git-poJunio C Hamano2013-08-095-4414/+5144
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'master' of git://github.com/git-l10n/git-po: l10n: de.po: translate 5 messages l10n: de.po: translate 99 new messages l10n: de.po: switch from pure German to German+English l10n: de.po: Fix a typo l10n: Update Swedish translation (2135t0f0u) l10n: zh_CN.po: translate 5 messages (2135t0f0u) l10n: vi.po(2135t): v1.8.4 round 2 l10n: git.pot: v1.8.4 round 2 (5 new, 3 removed)
| * | | l10n: de.po: translate 5 messagesRalf Thielow2013-08-091-188/+243
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Translate 5 new messages came from git.pot update in b8ecf23 (l10n: git.pot: v1.8.4 round 2 (5 new, 3 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
| * | | l10n: de.po: translate 99 new messagesRalf Thielow2013-08-091-1638/+1954
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Translate 99 new messages came from git.pot update in 28b3cff (l10n: git.pot: v1.8.4 round 1 (99 new, 46 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Thomas Rast <trast@inf.ethz.ch>
| * | | l10n: de.po: switch from pure German to German+EnglishRalf Thielow2013-08-081-922/+909
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches the translation from pure German to German+English. Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Thomas Rast <trast@inf.ethz.ch>
| * | | l10n: de.po: Fix a typoWieland Hoffmann2013-08-081-1/+1
| | | | | | | | | | | | | | | | Signed-off-by: Wieland Hoffmann <themineo@gmail.com>
| * | | l10n: Update Swedish translation (2135t0f0u)Peter Krefting2013-08-061-1521/+1844
| | | | | | | | | | | | | | | | | | | | | | | | Fix some incorrect translations in existing messages while at it. Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
| * | | l10n: zh_CN.po: translate 5 messages (2135t0f0u)Jiang Xin2013-08-061-164/+182
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Translate 5 new messages came from git.pot update in b8ecf23 (l10n: git.pot: v1.8.4 round 2 (5 new, 3 removed)). Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
| * | | l10n: vi.po(2135t): v1.8.4 round 2Tran Ngoc Quan2013-08-061-169/+187
| | | | | | | | | | | | | | | | Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
| * | | l10n: git.pot: v1.8.4 round 2 (5 new, 3 removed)Jiang Xin2013-08-061-161/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate po/git.pot from v1.8.4-rc1-21-gfb56570 for git v1.8.4 l10n round 2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
* | | | Merge branch 'jk/submodule-subdirectory-ok'Junio C Hamano2013-08-091-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * jk/submodule-subdirectory-ok: t/t7407: fix two typos in submodule tests
| * | | | t/t7407: fix two typos in submodule testsjk/submodule-subdirectory-okPhil Hord2013-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In t/t7407-submodule-foreach.sh there is a typo in one of the path names given for a test step. The correct path is nested1/nested2/.git, but nested1/nested1/nested2/.git is given instead. The typo is hidden because this line also accidentally omits the && chain operator. The omitted chain also means the return values of all the previous commands in this test are also being ignored. Fix the path and add the chain operator so the entire test sequence can be properly validated. Signed-off-by: Phil Hord <hordp@cisco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge branch 'sb/mailmap-updates'Junio C Hamano2013-08-091-2/+7
|\ \ \ \ \ | | |_|_|/ | |/| | | | | | | | | | | | | * sb/mailmap-updates: .mailmap: fixup entries
| * | | | .mailmap: fixup entriesStefan Beller2013-08-091-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds no new names, but fixes the mistakes I made in the previous commits. (94b410bba8, f4f49e225, c07a6bc57, 2013-07-12, .mailmap: Map email addresses to names). These mistakes are double white spaces between name and surname, different capitalization in email address, or just the email address set as name. Also I forgot to include James Knight to the mailmap file. Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Git 1.8.4-rc2v1.8.4-rc2Junio C Hamano2013-08-082-1/+8
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | This is with mostly minor documentation and test updates, nothing spectacular except for removal of funky lstat(2) emulation on Cygwin. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Sync with maint to grab trivial doc fixesJunio C Hamano2013-08-054-4/+4
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | * maint: fix typo in documentation of git-svn Documentation/rev-list-options: add missing word in --*-parents log doc: the argument to --encoding is not optional
| * | | fix typo in documentation of git-svnFelix Gruber2013-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Felix Gruber <felgru@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | Documentation/rev-list-options: add missing word in --*-parentsTorstein Hegge2013-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A commit has "parent commits" or "parents", not "commits". Signed-off-by: Torstein Hegge <hegge@resisty.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | log doc: the argument to --encoding is not optionalJonathan Nieder2013-08-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $ git log --encoding fatal: Option '--encoding' requires a value $ git rev-list --encoding fatal: Option '--encoding' requires a value The argument to --encoding has always been mandatory. Unfortunately manpages like git-rev-list(1), git-log(1), and git-show(1) have described the option's syntax as "--encoding[=<encoding>]" since it was first documented. Clarify by removing the extra brackets. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'es/blame-L-breakage'Junio C Hamano2013-08-051-2/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * es/blame-L-breakage: t8001, t8002: fix "blame -L :literal" test on NetBSD
| * | | | t8001, t8002: fix "blame -L :literal" test on NetBSDes/blame-L-breakageRené Scharfe2013-08-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sub-test 42 of t8001 and t8002 ("blame -L :literal") fails on NetBSD with the following verbose output: git annotate -L:main hello.c Author F (expected 4, attributed 3) bad Author G (expected 1, attributed 1) good This is not caused by different behaviour of git blame or annotate on that platform, but by different test input, in turn caused by a sed command that forgets to add a newline on NetBSD. Here's the diff of the commit that adds "goodbye" to hello.c, for Linux: @@ -1,4 +1,5 @@ int main(int argc, const char *argv[]) { puts("hello"); + puts("goodbye"); } We see that it adds an extra TAB, but that's not a problem. Here's the same on NetBSD: @@ -1,4 +1,4 @@ int main(int argc, const char *argv[]) { puts("hello"); -} + puts("goodbye");} It also adds an extra TAB, but it is missing the newline character after the semicolon. The following patch gets rid of the extra TAB at the beginning, but more importantly adds the missing newline at the end in a (hopefully) portable way, mentioned in http://sed.sourceforge.net/sedfaq4.html. The diff becomes this, on both Linux and NetBSD: @@ -1,4 +1,5 @@ int main(int argc, const char *argv[]) { puts("hello"); + puts("goodbye"); } Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Merge git://github.com/git-l10n/git-poJunio C Hamano2013-08-053-4352/+5403
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://github.com/git-l10n/git-po: l10n: zh_CN.po: translate 99 messages (2133t0f0u) l10n: vi.po (2133t) l10n: git.pot: v1.8.4 round 1 (99 new, 46 removed)
| * | | | | l10n: zh_CN.po: translate 99 messages (2133t0f0u)Jiang Xin2013-08-031-1449/+1851
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Translate 99 new messages came from git.pot update in 28b3cff (l10n: git.pot: v1.8.4 round 1 (99 new, 46 removed)). Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
| * | | | | l10n: vi.po (2133t)Tran Ngoc Quan2013-07-271-1507/+1876
| | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
| * | | | | l10n: git.pot: v1.8.4 round 1 (99 new, 46 removed)Jiang Xin2013-07-261-1396/+1676
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate po/git.pot from v1.8.4-rc0 for git v1.8.4 l10n round 1. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
* | | | | | Merge branch 'sb/mailmap-updates'Junio C Hamano2013-08-051-0/+3
|\ \ \ \ \ \ | | |_|_|/ / | |/| | | | | | | | | | | | | | | | * sb/mailmap-updates: .mailmap: Multiple addresses of Michael S. Tsirkin
| * | | | | .mailmap: Multiple addresses of Michael S. TsirkinStefan Beller2013-08-051-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Stefan Beller <stefanbeller@googlemail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | Merge branch 'dn/test-reject-utf-16'Junio C Hamano2013-08-052-2/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * dn/test-reject-utf-16: t3900: test rejecting log message with NULs correctly Add missing test file for UTF-16.
| * | | | | | t3900: test rejecting log message with NULs correctlydn/test-reject-utf-16Junio C Hamano2013-08-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not like that our longer term desire is to someday start accept log messages with NULs in them, so it is wrong to mark a test that demonstrates "git commit" that correctly fails given such an input as "expect-failure". "git commit" should fail today, and it should fail the same way in the future given a message with NUL in it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | Add missing test file for UTF-16.Brian M. Carlson2013-08-051-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test file that the UTF-16 rejection test looks for is missing, but this went unnoticed because the test is expected to fail anyway; as a consequence, the test fails because the file containing the commit message is missing, and not because the test file contains a NUL byte. Fix this by including a sample text file containing a commit message encoded in UTF-16. Signed-off-by: Brian M. Carlson <sandals@crustytoothpaste.net> Tested-by: Duy Nguyen <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | Merge branch 'bc/commit-invalid-utf8'Junio C Hamano2013-08-051-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bc/commit-invalid-utf8: commit: typofix for xxFFF[EF] check
| * | | | | | | commit: typofix for xxFFF[EF] checkbc/commit-invalid-utf8Junio C Hamano2013-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We wanted to catch all codepoints that ends with FFFE and FFFF, not with 0FFFE and 0FFFF. Noticed and corrected by Peter Krefting. Signed-off-by: Junio C Hamano <gitster@pobox.com>