summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2017-06-15date: use localtime() for "-local" time formatsLibravatar Jeff King2-2/+13
When we convert seconds-since-epochs timestamps into a broken-down "struct tm", we do so by adjusting the timestamp according to the known offset and then using gmtime() to break down the result. This means that the resulting struct "knows" that it's in GMT, even though the time it represents is adjusted for a different zone. The fields where it stores this data are not portably accessible, so we have no way to override them to tell them the real zone info. For the most part, this works. Our date-formatting routines don't pay attention to these inaccessible fields, and use the same tz info we provided for adjustment. The one exception is when we call strftime(), whose %Z format reveals this hidden timezone data. We solved that by always showing the empty string for %Z. This is allowed by POSIX, but not very helpful to the user. We can't make this work in the general case, as there's no portable function for setting an arbitrary timezone (and anyway, we don't have the zone name for the author zones, only their offsets). But for the special case of the "-local" formats, we can just skip the adjustment and use localtime() instead of gmtime(). This makes --date=format-local:%Z work correctly, showing the local timezone instead of an empty string. The new test checks the result for "UTC", our default test-lib value for $TZ. Using something like EST5 might be more interesting, but the actual zone string is system-dependent (for instance, on my system it expands to just EST). Hopefully "UTC" is vanilla enough that every system treats it the same. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-15t0006: check --date=format zone offsetsLibravatar Jeff King1-2/+7
We already test that "%z" and "%Z" show the right thing, but we don't actually check that the time we display is the correct one. Let's add two new tests: 1. Test that "format:" shows the time in the author's timezone, just like the other time formats. 2. Test that "format-local:" shows time in the local timezone. We don't want to use our normal UTC for this, because its offset is zero (so the result would be "correct" even if the code forgot to apply the offset or applied it in the wrong direction). We'll use the EST5 zone, which is already used elsewhere in the script (and so is assumed to be available everywhere). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-06-15strbuf: let strbuf_addftime handle %z and %Z itselfLibravatar René Scharfe5-8/+54
There is no portable way to pass timezone information to strftime. Add parameters for timezone offset and name to strbuf_addftime and let it handle the timezone-related format specifiers %z and %Z internally. Callers can opt out for %Z by passing NULL as timezone name. %z is always handled internally -- this helps on Windows, where strftime would expand it to a timezone name (same as %Z), in violation of POSIX. Modifiers are not handled, e.g. %Ez is still passed to strftime. Use an empty string as timezone name in show_date (the only current caller) for now because we only have the timezone offset in non-local mode. POSIX allows %Z to resolve to an empty string in case of missing information. Helped-by: Ulrich Mueller <ulm@gentoo.org> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-09Git 2.13Libravatar Junio C Hamano3-1/+14
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-09Merge tag 'l10n-2.13.0-rnd2.1' of git://github.com/git-l10n/git-poLibravatar Junio C Hamano9-19174/+23732
l10n for Git 2.13.0 round 2.1 * tag 'l10n-2.13.0-rnd2.1' of git://github.com/git-l10n/git-po: l10n: zh_CN: for git v2.13.0 l10n round 2 l10n: sv.po: Update Swedish translation (3195t0f0u) l10n: zh_CN: review for git v2.13.0 l10n round 1 l10n: Update Catalan translation l10n: bg.po: Updated Bulgarian translation (3195t) l10n: fr.po v2.13 rnd 2 l10n: de.po: translate 4 new messages l10n: de.po: update German translation l10n: de.po: lower case after semi-colon l10n: vi.po(3195t): Update translation for v2.13.0 round 2 l10n: git.pot: v2.13.0 round 2 (4 new, 7 removed) l10n: zh_CN: for git v2.13.0 l10n round 1 l10n: fr.po v2.13 round 1 l10n: pt_PT: update Portuguese translation l10n: bg.po: Updated Bulgarian translation (3201t) l10n: vi.po(3198t): Updated Vietnamese translation for v2.13.0-rc0 l10n: sv.po: Update Swedish translation (3199t0f0u) l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)
2017-05-09Merge branch 'master' of git://github.com/nafmo/git-l10n-svLibravatar Jiang Xin1-434/+439
* 'master' of git://github.com/nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (3195t0f0u)
2017-05-09l10n: zh_CN: for git v2.13.0 l10n round 2Libravatar Jiang Xin1-429/+436
Translate 4 messages (3195t0f0u) for git v2.13.0-rc2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2017-05-09l10n: sv.po: Update Swedish translation (3195t0f0u)Libravatar Peter Krefting1-434/+439
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2017-05-08Sync with v2.12.3Libravatar Junio C Hamano11-11/+116
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-09Merge branch 'jh/verify-index-checksum-only-in-fsck'Libravatar Junio C Hamano1-8/+26
* jh/verify-index-checksum-only-in-fsck: t1450: avoid use of "sed" on the index, which is a binary file
2017-05-09l10n: zh_CN: review for git v2.13.0 l10n round 1Libravatar Ray Chen1-17/+17
Signed-off-by: Ray Chen <oldsharp@gmail.com>
2017-05-09Merge branch 'master' of https://github.com/vnwildman/gitLibravatar Jiang Xin1-431/+438
* 'master' of https://github.com/vnwildman/git: l10n: vi.po(3195t): Update translation for v2.13.0 round 2
2017-05-09l10n: Update Catalan translationLibravatar Jordi Mas1-2126/+2491
Signed-off-by: Jordi Mas <jmas@softcatala.org>
2017-05-09l10n: bg.po: Updated Bulgarian translation (3195t)Libravatar Alexander Shopov1-85/+61
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2017-05-09Merge branch 'fr_l10n_v2.13_rnd2' of git://github.com/jnavila/gitLibravatar Jiang Xin1-448/+478
* 'fr_l10n_v2.13_rnd2' of git://github.com/jnavila/git: l10n: fr.po v2.13 rnd 2
2017-05-06l10n: fr.po v2.13 rnd 2Libravatar Jean-Noel Avila1-448/+478
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
2017-05-05l10n: de.po: translate 4 new messagesLibravatar Ralf Thielow1-440/+465
Translate 4 new messages came from git.pot update in 28e1aaa48 (l10n: git.pot: v2.13.0 round 2 (4 new, 7 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
2017-05-05l10n: de.po: update German translationLibravatar Ralf Thielow1-1989/+2381
Translate 96 new messages came from git.pot update in dfc182b (l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)). Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Acked-by: Matthias Rüster <matthias.ruester@gmail.com>
2017-05-05l10n: de.po: lower case after semi-colonLibravatar Michael J Gruber1-1/+1
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2017-05-05l10n: vi.po(3195t): Update translation for v2.13.0 round 2Libravatar Tran Ngoc Quan1-431/+438
Signed-off-by: Tran Ngoc Quan <vnwildman@gmail.com>
2017-05-05Git 2.12.3Libravatar Junio C Hamano3-4/+12
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-05Merge branch 'maint-2.11' into maintLibravatar Junio C Hamano10-8/+105
2017-05-05Git 2.11.2Libravatar Junio C Hamano4-3/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-05Merge branch 'maint-2.10' into maint-2.11Libravatar Junio C Hamano9-8/+92
2017-05-05Git 2.10.3Libravatar Junio C Hamano3-2/+10
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-05Merge branch 'maint-2.9' into maint-2.10Libravatar Junio C Hamano8-7/+83
2017-05-05Git 2.9.4Libravatar Junio C Hamano3-2/+11
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-05Merge branch 'maint-2.8' into maint-2.9Libravatar Junio C Hamano7-6/+74
2017-05-05Git 2.8.5Libravatar Junio C Hamano4-3/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-05Merge branch 'maint-2.7' into maint-2.8Libravatar Junio C Hamano6-5/+60
2017-05-05Git 2.7.5Libravatar Junio C Hamano4-3/+19
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-05Merge branch 'maint-2.6' into maint-2.7Libravatar Junio C Hamano5-4/+43
2017-05-05Git 2.6.7Libravatar Junio C Hamano4-3/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-05Merge branch 'maint-2.5' into maint-2.6Libravatar Junio C Hamano4-3/+29
2017-05-05Git 2.5.6Libravatar Junio C Hamano4-3/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-05Merge branch 'maint-2.4' into maint-2.5Libravatar Junio C Hamano3-2/+15
2017-05-05Git 2.4.12Libravatar Junio C Hamano4-3/+16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-05Merge branch 'jk/shell-no-repository-that-begins-with-dash' into maint-2.4Libravatar Junio C Hamano1-1/+1
* jk/shell-no-repository-that-begins-with-dash: shell: disallow repo names beginning with dash
2017-05-05shell: disallow repo names beginning with dashLibravatar Jeff King1-1/+1
When a remote server uses git-shell, the client side will connect to it like: ssh server "git-upload-pack 'foo.git'" and we literally exec ("git-upload-pack", "foo.git"). In early versions of upload-pack and receive-pack, we took a repository argument and nothing else. But over time they learned to accept dashed options. If the user passes a repository name that starts with a dash, the results are confusing at best (we complain of a bogus option instead of a non-existent repository) and malicious at worst (the user can start an interactive pager via "--help"). We could pass "--" to the sub-process to make sure the user's argument is interpreted as a branch name. I.e.: git-upload-pack -- -foo.git But adding "--" automatically would make us inconsistent with a normal shell (i.e., when git-shell is not in use), where "-foo.git" would still be an error. For that case, the client would have to specify the "--", but they can't do so reliably, as existing versions of git-shell do not allow more than a single argument. The simplest thing is to simply disallow "-" at the start of the repo name argument. This hasn't worked either with or without git-shell since version 1.0.0, and nobody has complained. Note that this patch just applies to do_generic_cmd(), which runs upload-pack, receive-pack, and upload-archive. There are two other types of commands that git-shell runs: - do_cvs_cmd(), but this already restricts the argument to be the literal string "server" - admin-provided commands in the git-shell-commands directory. We'll pass along arbitrary arguments there, so these commands could have similar problems. But these commands might actually understand dashed arguments, so we cannot just block them here. It's up to the writer of the commands to make sure they are safe. With great power comes great responsibility. Reported-by: Timo Schmid <tschmid@ernw.de> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-05l10n: git.pot: v2.13.0 round 2 (4 new, 7 removed)Libravatar Jiang Xin1-428/+417
Generate po/git.pot from v2.13.0-rc2 for git v2.13.0 l10n round 2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2017-05-05Merge branch 'master' of git://github.com/git-l10n/git-poLibravatar Jiang Xin7-14167/+17929
* 'master' of git://github.com/git-l10n/git-po: l10n: zh_CN: for git v2.13.0 l10n round 1 l10n: fr.po v2.13 round 1 l10n: pt_PT: update Portuguese translation l10n: bg.po: Updated Bulgarian translation (3201t) l10n: vi.po(3198t): Updated Vietnamese translation for v2.13.0-rc0 l10n: sv.po: Update Swedish translation (3199t0f0u) l10n: git.pot: v2.13.0 round 1 (96 new, 37 removed)
2017-05-05l10n: zh_CN: for git v2.13.0 l10n round 1Libravatar Jiang Xin1-1947/+2303
Translate 96 messages (3198t0f0u) for git v2.13.0-rc0. Reviewed-by: 依云 <lilydjwg@gmail.com> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2017-05-05Merge branch 'fr_l10n_v2.13_rnd1' of git://github.com/jnavila/gitLibravatar Jiang Xin1-1943/+2285
* 'fr_l10n_v2.13_rnd1' of git://github.com/jnavila/git: l10n: fr.po v2.13 round 1
2017-05-04Git 2.13-rc2Libravatar Junio C Hamano2-1/+4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-04Merge branch 'rg/a-the-typo'Libravatar Junio C Hamano4-5/+5
Typofix. * rg/a-the-typo: fix minor typos
2017-05-04Merge branch 'sr/hooks-cwd-doc'Libravatar Junio C Hamano1-2/+4
* sr/hooks-cwd-doc: githooks.txt: clarify push hooks are always executed in $GIT_DIR
2017-05-04Merge branch 'rg/doc-submittingpatches-wordfix'Libravatar Junio C Hamano1-6/+6
* rg/doc-submittingpatches-wordfix: doc: update SubmittingPatches
2017-05-04Merge branch 'rg/doc-pull-typofix'Libravatar Junio C Hamano1-2/+3
* rg/doc-pull-typofix: doc: git-pull.txt use US spelling, fix minor typo
2017-05-04Merge branch 'ja/i18n-cleanup'Libravatar Junio C Hamano2-7/+7
* ja/i18n-cleanup: i18n: read-cache: typofix i18n: remove i18n from tag reflog message
2017-05-02l10n: fr.po v2.13 round 1Libravatar Jean-Noel Avila1-1943/+2285
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>