summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-01-12checkout,clone: check return value of create_symrefLibravatar Jeff King3-5/+15
It's unlikely that we would fail to create or update a symbolic ref (especially HEAD), but if we do, we should notice and complain. Note that there's no need to give more details in our error message; create_symref will already have done so. While we're here, let's also fix a minor memory leak in clone. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-29create_symref: write reflog while holding lockLibravatar Jeff King1-1/+2
We generally hold a lock on the matching ref while writing to its reflog; this prevents two simultaneous writers from clobbering each other's reflog lines (it does not even have to be two symref updates; because we don't hold the lock, we could race with somebody writing to the pointed-to ref via HEAD, for example). We can fix this by writing the reflog before we commit the lockfile. This runs the risk of writing the reflog but failing the final rename(), but at least we now err on the same side as the rest of the ref code. Noticed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-29create_symref: use existing ref-lock codeLibravatar Jeff King2-55/+62
The create_symref() function predates the existence of "struct lock_file", let alone the more recent "struct ref_lock". Instead, it just does its own manual dot-locking. Besides being more code, this has a few downsides: - if git is interrupted while holding the lock, we don't clean up the lockfile - we don't do the usual directory/filename conflict check. So you can sometimes create a symref "refs/heads/foo/bar", even if "refs/heads/foo" exists (namely, if the refs are packed and we do not hit the d/f conflict in the filesystem). This patch refactors create_symref() to use the "struct ref_lock" interface, which handles both of these things. There are a few bonus cleanups that come along with it: - we leaked ref_path in some error cases - the symref contents were stored in a fixed-size buffer, putting an artificial (albeit large) limitation on the length of the refname. We now write through fprintf, and handle refnames of any size. - we called adjust_shared_perm only after the file was renamed into place, creating a potential race with readers in a shared repository. The lockfile code now handles this when creating the lockfile, making it atomic. - the legacy prefer_symlink_refs path did not do any locking at all. Admittedly, it is not atomic from a reader's perspective (as it unlinks and re-creates the symlink to overwrite), but at least it cannot conflict with other writers now. - the result of this patch is hopefully more readable. It eliminates three goto labels. Two were for error checking that is now simplified, and the third was to reach shared code that has been pulled into its own function. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-29create_symref: modernize variable namesLibravatar Jeff King2-22/+21
Once upon a time, create_symref() was used only to point HEAD at a branch name, and the variable names reflect that (e.g., calling the path git_HEAD). However, it is much more generic these days (and has been for some time). Let's update the variable names to make it easier to follow: - `ref_target` is now just `refname`. This is closer to the `ref` that is already in `cache.h`, but with the extra twist that "name" makes it clear this is the name and not a ref struct. Dropping "target" hopefully makes it clear that we are talking about the symref itself, not what it points to. - `git_HEAD` is now `ref_path`; the on-disk path corresponding to `ref`. - `refs_heads_master` is now just `target`; i.e., what the symref points at. This term also matches what is in the symlink(2) manpage (at least on Linux). - the buffer to hold the symref file's contents was simply called `ref`. It's now `buf` (admittedly also generic, but at least not actively introducing confusion with the other variable holding the refname). Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-28Merge branch 'jk/symbolic-ref-maint'Libravatar Junio C Hamano2-1/+23
"git symbolic-ref" forgot to report a failure with its exit status. * jk/symbolic-ref-maint: t1401: test reflog creation for git-symbolic-ref symbolic-ref: propagate error code from create_symref()
2015-12-28Merge tag 'l10n-2.7.0-rnd2' of git://github.com/git-l10n/git-poLibravatar Junio C Hamano8-12723/+14731
l10n-2.7.0-rnd2 * tag 'l10n-2.7.0-rnd2' of git://github.com/git-l10n/git-po: l10n: ru.po: update Russian translation l10n: Updated Bulgarian translation of git (2477t,0f,0u) l10n: ca.po: update translation l10n: zh_CN: for git v2.7.0 l10n round 2 l10n: sv.po: Update Swedish translation (2477t0f0u) l10n: sv: Fix bad translation l10n: fr.po v2.7.0 round 2 (2477t) l10n: git.pot: v2.7.0 round 2 (2 new, 2 removed) l10n: zh_CN: for git v2.7.0 l10n round 1 l10n: ca.po: update translation l10n: fr v2.7.0 round 1 (2477t) l10n: Updated Bulgarian translation of git (2477t,0f,0u) l10n: sv.po: Update Swedish translation (2477t0f0u) l10n: vi.po: Updated translation (2477t) l10n: git.pot: v2.7.0 round 1 (66 new, 29 removed) l10n: fr.po: Fix typo l10n: fr.po: Fix typo
2015-12-28l10n: ru.po: update Russian translationLibravatar Dimitriy Ryazantcev1-1492/+1663
Signed-off-by: Dimitriy Ryazantcev <dimitriy.ryazantcev@gmail.com>
2015-12-28Merge branch 'master' of git://github.com/alshopov/git-poLibravatar Jiang Xin1-120/+119
* 'master' of git://github.com/alshopov/git-po: l10n: Updated Bulgarian translation of git (2477t,0f,0u)
2015-12-28l10n: Updated Bulgarian translation of git (2477t,0f,0u)Libravatar Alexander Shopov1-120/+119
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2015-12-27l10n: ca.po: update translationLibravatar Alex Henrie1-118/+117
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2015-12-26l10n: zh_CN: for git v2.7.0 l10n round 2Libravatar Jiang Xin1-118/+124
Update 2 translations (2477t0f0u) for git v2.7.0-rc1. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2015-12-26Merge branch 'master' of git://github.com/nafmo/git-l10n-svLibravatar Jiang Xin1-120/+125
* 'master' of git://github.com/nafmo/git-l10n-sv: l10n: sv.po: Update Swedish translation (2477t0f0u) l10n: sv: Fix bad translation
2015-12-26l10n: sv.po: Update Swedish translation (2477t0f0u)Libravatar Peter Krefting1-119/+124
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2015-12-26l10n: sv: Fix bad translationLibravatar Peter Krefting1-1/+1
Found-by: Sebastian Rasmussen <sebras@gmail.com> Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2015-12-24l10n: fr.po v2.7.0 round 2 (2477t)Libravatar Jean-Noel Avila1-128/+148
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
2015-12-22Git 2.7-rc2Libravatar Junio C Hamano2-1/+4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-22Merge branch 'js/emu-write-epipe-on-windows'Libravatar Junio C Hamano2-0/+20
The write(2) emulation for Windows learned to set errno to EPIPE when necessary. * js/emu-write-epipe-on-windows: mingw: emulate write(2) that fails with a EPIPE
2015-12-22push: don't mark options of recurse-submodules for translationLibravatar Ralf Thielow1-1/+1
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-22l10n: git.pot: v2.7.0 round 2 (2 new, 2 removed)Libravatar Jiang Xin1-117/+116
Generate po/git.pot from v2.7.0-rc1-44-g1d88dab for git v2.7.0 l10n round 2. Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2015-12-22Merge branch 'master' of git://github.com/git-l10n/git-poLibravatar Jiang Xin7-11022/+12831
* 'master' of git://github.com/git-l10n/git-po: l10n: zh_CN: for git v2.7.0 l10n round 1 l10n: ca.po: update translation l10n: fr v2.7.0 round 1 (2477t) l10n: Updated Bulgarian translation of git (2477t,0f,0u) l10n: sv.po: Update Swedish translation (2477t0f0u) l10n: vi.po: Updated translation (2477t) l10n: git.pot: v2.7.0 round 1 (66 new, 29 removed) l10n: fr.po: Fix typo l10n: fr.po: Fix typo
2015-12-21t1401: test reflog creation for git-symbolic-refLibravatar Jeff King1-0/+16
The current code writes a reflog entry whenever we update a symbolic ref, but we never test that this is so. Let's add a test to make sure upcoming refactoring doesn't cause a regression. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-21symbolic-ref: propagate error code from create_symref()Libravatar Jeff King2-1/+7
If create_symref() fails, git-symbolic-ref will still exit with code 0, and our caller has no idea that the command did nothing. This appears to have been broken since the beginning of time (e.g., it is not a regression where create_symref() stopped calling die() or something similar). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-21Update release notes to 2.7Libravatar Junio C Hamano1-2/+29
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-21Merge branch 'bc/format-patch-null-from-line'Libravatar Junio C Hamano7-1/+28
"format-patch" has learned a new option to zero-out the commit object name on the mbox "From " line. * bc/format-patch-null-from-line: format-patch: check that header line has expected format format-patch: add an option to suppress commit hash sha1_file.c: introduce a null_oid constant
2015-12-21Merge branch 'jk/ident-loosen-getpwuid'Libravatar Junio C Hamano3-24/+40
When getpwuid() on the system returned NULL (e.g. the user is not in the /etc/passwd file or other uid-to-name mappings), the codepath to find who the user is to record it in the reflog barfed and died. Loosen the check in this codepath, which already accepts questionable ident string (e.g. host part of the e-mail address is obviously bogus), and in general when we operate fmt_ident() function in non-strict mode. * jk/ident-loosen-getpwuid: ident: loosen getpwuid error in non-strict mode ident: keep a flag for bogus default_email ident: make xgetpwuid_self() a static local helper
2015-12-21Merge branch 'jk/send-email-ssl-errors'Libravatar Junio C Hamano1-0/+7
Improve error reporting when SMTP TLS fails. * jk/send-email-ssl-errors: send-email: enable SSL level 1 debug output
2015-12-21Merge branch 'sg/completion-no-column'Libravatar Junio C Hamano1-0/+1
The completion script (in contrib/) used to list "git column" (which is not an end-user facing command) as one of the choices * sg/completion-no-column: completion: remove 'git column' from porcelain commands
2015-12-21Merge branch 'mc/push-recurse-submodules-config'Libravatar Junio C Hamano7-27/+294
Add new config to avoid typing "--recurse-submodules" on each push. * mc/push-recurse-submodules-config: push: follow the "last one wins" convention for --recurse-submodules push: test that --recurse-submodules on command line overrides config push: add recurseSubmodules config option
2015-12-21mingw: emulate write(2) that fails with a EPIPELibravatar Johannes Schindelin2-0/+20
On Windows, when writing to a pipe fails, errno is always EINVAL. However, Git expects it to be EPIPE. According to the documentation, there are two cases in which write() triggers EINVAL: the buffer is NULL, or the length is odd but the mode is 16-bit Unicode (the broken pipe is not mentioned as possible cause). Git never sets the file mode to anything but binary, therefore we know that errno should actually be EPIPE if it is EINVAL and the buffer is not NULL. See https://msdn.microsoft.com/en-us/library/1570wh78.aspx for more details. This works around t5571.11 failing with v2.6.4 on Windows. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Acked-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-21Merge git://ozlabs.org/~paulus/gitkLibravatar Junio C Hamano3-664/+680
* git://ozlabs.org/~paulus/gitk: gitk: sv.po: Update Swedish translation (311t) gitk: Let .bleft.mid widgets 'breathe' gitk: Match ttk fonts to gitk fonts gitk: Update revision date in Japanese PO file gitk: Update "Language:" header gitk: Improve translation message gitk: Remove unused line gitk: Update year gitk: Change last translator line gitk: Update fuzzy messages gitk: Update Japanese translation gitk: Fix translation around copyright sign gitk: Update Japanese translation gitk: Fix wrong translation gitk: Translate Japanese catalog gitk: Translate more to Japanese catalog gitk: Update Japanese message catalog gitk: Re-sync line number in Japanese message catalogue gitk: Color name update
2015-12-20l10n: zh_CN: for git v2.7.0 l10n round 1Libravatar Jiang Xin1-1444/+1669
Update 66 translations (2477t0f0u) for git v2.7.0-rc0. Reviewed-by: Ray Chen <oldsharp@gmail.com> Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
2015-12-20Merge branch 'master' of git://github.com/alexhenrie/git-poLibravatar Jiang Xin1-1463/+1644
* 'master' of git://github.com/alexhenrie/git-po: l10n: ca.po: update translation
2015-12-20Merge branch 'fr_v2.7.0' of git://github.com/jnavila/gitLibravatar Jiang Xin1-1449/+1670
* 'fr_v2.7.0' of git://github.com/jnavila/git: l10n: fr v2.7.0 round 1 (2477t)
2015-12-20Merge branch 'master' of git://github.com/alshopov/git-poLibravatar Jiang Xin1-2315/+2873
* 'master' of git://github.com/alshopov/git-po: l10n: Updated Bulgarian translation of git (2477t,0f,0u)
2015-12-18l10n: ca.po: update translationLibravatar Alex Henrie1-1463/+1644
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2015-12-19Merge branch 'ja.po' of https://github.com/qykth-git/gitkLibravatar Paul Mackerras1-356/+336
2015-12-19Merge branch 'color-fix' of https://github.com/qykth-git/gitkLibravatar Paul Mackerras1-6/+6
2015-12-18l10n: fr v2.7.0 round 1 (2477t)Libravatar Jean-Noel Avila1-1449/+1670
Signed-off-by: Jean-Noel Avila <jn.avila@free.fr>
2015-12-18l10n: Updated Bulgarian translation of git (2477t,0f,0u)Libravatar Alexander Shopov1-2315/+2873
Signed-off-by: Alexander Shopov <ash@kambanaria.org>
2015-12-18l10n: sv.po: Update Swedish translation (2477t0f0u)Libravatar Peter Krefting1-1454/+1682
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
2015-12-16Merge branch 'fr/rebase-i-continue-preserve-options'Libravatar Junio C Hamano2-11/+23
"git rebase -i" started with merge strategy options did not propagate them upon "git rebase --continue". * fr/rebase-i-continue-preserve-options: rebase -i: remember merge options beyond continue actions
2015-12-16Merge branch 'maint'Libravatar Junio C Hamano1-2/+1
* maint: credential-store: don't pass strerror to die_errno()
2015-12-16Merge branch 'sg/lock-file-commit-error' into maintLibravatar Junio C Hamano1-2/+1
* sg/lock-file-commit-error: credential-store: don't pass strerror to die_errno()
2015-12-16credential-store: don't pass strerror to die_errno()Libravatar SZEDER Gábor1-2/+1
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-15format-patch: check that header line has expected formatLibravatar brian m. carlson1-0/+7
The format of the "From " header line is very specific to allow utilities to detect Git-style patches. Add a test that the patches created are in the expected format. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-15format-patch: add an option to suppress commit hashLibravatar brian m. carlson5-1/+19
Oftentimes, patches created by git format-patch will be stored in version control or compared with diff. In these cases, two otherwise identical patches can have different commit hashes, leading to diff noise. Teach git format-patch a --zero-commit option that instead produces an all-zero hash to avoid this diff noise. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-15Git 2.7-rc1Libravatar Junio C Hamano2-8/+14
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-15Sync with maintLibravatar Junio C Hamano1-0/+14
2015-12-15Update draft release notes to 2.6.5Libravatar Junio C Hamano1-0/+14
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-12-15Merge branch 'dt/fsck-verify-pack-error' into maintLibravatar Junio C Hamano1-1/+1
The exit code of git-fsck didnot reflect some types of errors found in packed objects, which has been corrected. * dt/fsck-verify-pack-error: verify_pack: do not ignore return value of verification function