summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-02-17update_ref(): improve documentationLibravatar Michael Haggerty2-7/+14
Add a docstring for update_ref(), emphasizing its similarity to ref_transaction_update(). Rename its parameters to match those of ref_transaction_update(). Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17ref_transaction_verify(): new function to check a reference's valueLibravatar Michael Haggerty3-21/+67
If NULL is passed to ref_transaction_update()'s new_sha1 parameter, then just verify old_sha1 (under lock) without trying to change the new value of the reference. Use this functionality to add a new function ref_transaction_verify(), which checks the current value of the reference under lock but doesn't change it. Use ref_transaction_verify() in the implementation of "git update-ref --stdin"'s "verify" command to avoid the awkward need to "update" the reference to its existing value. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17ref_transaction_delete(): check that old_sha1 is not null_sha1Libravatar Michael Haggerty1-0/+2
It makes no sense to delete a reference that is already known not to exist. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17ref_transaction_create(): check that new_sha1 is validLibravatar Michael Haggerty1-0/+2
Creating a reference requires a new_sha1 that is not NULL and not null_sha1. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17commit: avoid race when creating orphan commitsLibravatar Michael Haggerty2-2/+2
If HEAD doesn't point at anything during the initial check, then we should make sure that it *still* doesn't point at anything when we are ready to update the reference. Otherwise, another process might commit while we are working (e.g., while we are waiting for the user to edit the commit message) and we will silently overwrite it. This fixes a failing test in t7516. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17commit: add tests of commit racesLibravatar Michael Haggerty1-0/+30
Committing involves the following steps: 1. Determine the current value of HEAD (if any). 2. Create the new commit object. 3. Update HEAD. Please note that step 2 can take arbitrarily long, because it might involve the user editing a commit message. If a second process sneaks in a commit during step 2, then the first commit process should fail. This is usually done correctly, because step 3 verifies that HEAD still points at the same commit that it pointed to during step 1. However, if there is a race when creating an *orphan* commit, then the test in step 3 is skipped. Add tests for proper handling of such races. One of the new tests fails. It will be fixed in a moment. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17ref_transaction_delete(): remove "have_old" parameterLibravatar Michael Haggerty4-12/+13
Instead, verify the reference's old value if and only if old_sha1 is non-NULL. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17ref_transaction_update(): remove "have_old" parameterLibravatar Michael Haggerty12-29/+31
Instead, verify the reference's old value if and only if old_sha1 is non-NULL. ref_transaction_delete() will get the same treatment in a moment. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17struct ref_update: move "have_old" into "flags"Libravatar Michael Haggerty1-17/+28
Instead of having a separate have_old field, record this boolean value as a bit in the "flags" field. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17refs.c: change some "flags" to "unsigned int"Libravatar Michael Haggerty4-16/+17
Change the following functions' "flags" arguments from "int" to "unsigned int": * ref_transaction_update() * ref_transaction_create() * ref_transaction_delete() * update_ref() * delete_ref() * lock_ref_sha1_basic() Also change the "flags" member in "struct ref_update" to unsigned. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-12refs: remove the gap in the REF_* constant valuesLibravatar Michael Haggerty1-1/+2
There is no reason to "reserve" a gap between the public and private flags values. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-12refs: move REF_DELETING to refs.cLibravatar Michael Haggerty2-3/+7
It is only used internally now. Document it a little bit better, too. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Reviewed-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-11Post 2.3 cycle (batch #1)Libravatar Junio C Hamano1-1/+64
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-11Merge branch 'ah/usage-strings'Libravatar Junio C Hamano64-104/+108
* ah/usage-strings: standardize usage info string format
2015-02-11Merge branch 'jc/pretty-format-doc'Libravatar Junio C Hamano1-3/+7
* jc/pretty-format-doc: "log --pretty" documentation: do not forget "tformat:"
2015-02-11Merge branch 'jc/unused-symbols'Libravatar Junio C Hamano16-125/+111
Mark file-local symbols as "static", and drop functions that nobody uses. * jc/unused-symbols: shallow.c: make check_shallow_file_for_update() static remote.c: make clear_cas_option() static urlmatch.c: make match_urls() static revision.c: make save_parents() and free_saved_parents() static line-log.c: make line_log_data_init() static pack-bitmap.c: make pack_bitmap_filename() static prompt.c: remove git_getpass() nobody uses http.c: make finish_active_slot() and handle_curl_result() static
2015-02-11Merge branch 'jc/push-to-checkout'Libravatar Junio C Hamano4-26/+143
Extending the js/push-to-deploy topic, the behaviour of "git push" when updating the working tree and the index with an update to the branch that is checked out can be tweaked by push-to-checkout hook. * jc/push-to-checkout: receive-pack: support push-to-checkout hook receive-pack: refactor updateInstead codepath
2015-02-11Merge branch 'sb/atomic-push'Libravatar Junio C Hamano13-50/+429
"git push" has been taught a "--atomic" option that makes push to update more than one ref an "all-or-none" affair. * sb/atomic-push: Document receive.advertiseatomic t5543-atomic-push.sh: add basic tests for atomic pushes push.c: add an --atomic argument send-pack.c: add --atomic command line argument send-pack: rename ref_update_to_be_sent to check_to_send_update receive-pack.c: negotiate atomic push support receive-pack.c: add execute_commands_atomic function receive-pack.c: move transaction handling in a central place receive-pack.c: move iterating over all commands outside execute_commands receive-pack.c: die instead of error in case of possible future bug receive-pack.c: shorten the execute_commands loop over all commands
2015-02-11Merge branch 'mh/reflog-expire'Libravatar Junio C Hamano3-265/+332
Restructure "reflog expire" to fit the reflogs better with the recently updated ref API. Looked reasonable (except that some shortlog entries stood out like a sore thumb). * mh/reflog-expire: (24 commits) refs.c: let fprintf handle the formatting refs.c: don't expose the internal struct ref_lock in the header file lock_any_ref_for_update(): inline function refs.c: remove unlock_ref/close_ref/commit_ref from the refs api reflog_expire(): new function in the reference API expire_reflog(): treat the policy callback data as opaque Move newlog and last_kept_sha1 to "struct expire_reflog_cb" expire_reflog(): move rewrite to flags argument expire_reflog(): move verbose to flags argument expire_reflog(): pass flags through to expire_reflog_ent() struct expire_reflog_cb: a new callback data type Rename expire_reflog_cb to expire_reflog_policy_cb expire_reflog(): move updateref to flags argument expire_reflog(): move dry_run to flags argument expire_reflog(): add a "flags" argument expire_reflog(): extract two policy-related functions Extract function should_expire_reflog_ent() expire_reflog(): use a lock_file for rewriting the reflog file expire_reflog(): return early if the reference has no reflog expire_reflog(): rename "ref" parameter to "refname" ...
2015-02-11Merge branch 'cj/log-invert-grep'Libravatar Junio C Hamano5-2/+25
"git log --invert-grep --grep=WIP" will show only commits that do not have the string "WIP" in their messages. * cj/log-invert-grep: log: teach --invert-grep option
2015-02-11Merge branch 'km/gettext-n'Libravatar Junio C Hamano3-0/+45
* km/gettext-n: gettext.h: add parentheses around N_ expansion if supported
2015-02-11Merge branch 'bc/http-fallback-to-password-after-krb-fails'Libravatar Junio C Hamano1-0/+10
After attempting and failing a password-less authentication (e.g. kerberos), libcURL refuses to fall back to password based Basic authentication without a bit of help/encouragement. * bc/http-fallback-to-password-after-krb-fails: remote-curl: fall back to Basic auth if Negotiate fails
2015-02-11Merge branch 'dk/format-patch-ignore-diff-submodule'Libravatar Junio C Hamano2-1/+73
Setting diff.submodule to 'log' made "git format-patch" produce broken patches. * dk/format-patch-ignore-diff-submodule: format-patch: ignore diff.submodule setting t4255: test am submodule with diff.submodule
2015-02-11Merge branch 'jn/rerere-fail-on-auto-update-failure'Libravatar Junio C Hamano1-10/+6
"git rerere" (invoked internally from many mergy operations) did not correctly signal errors when told to update the working tree files and failed to do so for whatever reason. * jn/rerere-fail-on-auto-update-failure: rerere: error out on autoupdate failure
2015-02-11Merge branch 'jk/blame-commit-label'Libravatar Junio C Hamano11-34/+29
"git blame HEAD -- missing" failed to correctly say "HEAD" when it tried to say "No such path 'missing' in HEAD". * jk/blame-commit-label: blame.c: fix garbled error message use xstrdup_or_null to replace ternary conditionals builtin/commit.c: use xstrdup_or_null instead of envdup builtin/apply.c: use xstrdup_or_null instead of null_strdup git-compat-util: add xstrdup_or_null helper
2015-02-11Merge branch 'ld/p4-submit-hint'Libravatar Junio C Hamano1-1/+1
* ld/p4-submit-hint: git-p4: correct --prepare-p4-only instructions
2015-02-11Merge branch 'ld/p4-exclude-in-sync'Libravatar Junio C Hamano3-13/+84
Like the "clone" subcommand, allow excluding subdirectories in the "sync" subcommand. * ld/p4-exclude-in-sync: git-p4: support excluding paths on sync
2015-02-11git-p4: support excluding paths on syncLibravatar Luke Diamand3-13/+84
The clone subcommand has long had support for excluding subdirectories, but sync has not. This is a nuisance, since as soon as you do a sync, any changed files that were initially excluded start showing up. Move the "exclude" command-line option into the parent class; the actual behavior was already present there so it simply had to be exposed. Signed-off-by: Luke Diamand <luke@diamand.org> Reviewed-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-11Merge branch 'jc/coding-guidelines'Libravatar Junio C Hamano1-3/+8
* jc/coding-guidelines: CodingGuidelines: clarify C #include rules
2015-02-11Merge branch 'ak/typofixes'Libravatar Junio C Hamano2-2/+2
* ak/typofixes: t/lib-terminal.sh: fix typo pack-bitmap: fix typo
2015-02-05Git 2.3Libravatar Junio C Hamano3-1/+12
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-02Merge git://github.com/git-l10n/git-poLibravatar Junio C Hamano1-5/+5
* git://github.com/git-l10n/git-po: l10n: ca.po: Fix trailing whitespace
2015-01-30l10n: ca.po: Fix trailing whitespaceLibravatar Alex Henrie1-5/+5
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2015-01-27Git 2.3.0-rc2Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-27Merge git://github.com/git-l10n/git-poLibravatar Junio C Hamano2-929/+941
* git://github.com/git-l10n/git-po: l10n: de.po: correct singular form l10n: de.po: translate "leave behind" correctly l10n: de.po: fix typo l10n: ca.po: update translation
2015-01-27Merge branch 'master' of git://github.com/alexhenrie/git-poLibravatar Jiang Xin1-925/+937
* 'master' of git://github.com/alexhenrie/git-po: l10n: ca.po: update translation
2015-01-26l10n: de.po: correct singular formLibravatar Michael J Gruber1-1/+1
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2015-01-26l10n: de.po: translate "leave behind" correctlyLibravatar Michael J Gruber1-2/+2
This message is about leaving orphaned commits behind, not about behind an upstream branch. Try to make this clear. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2015-01-26l10n: de.po: fix typoLibravatar Benedikt Heine1-2/+2
Signed-off-by: Benedikt Heine <bebe@bebehei.de> Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
2015-01-26l10n: ca.po: update translationLibravatar Alex Henrie1-925/+937
Signed-off-by: Alex Henrie <alexhenrie24@gmail.com>
2015-01-23git-p4: correct --prepare-p4-only instructionsLibravatar Luke Diamand1-1/+1
If you use git-p4 with the "--prepare-p4-only" option, then it prints the p4 command line to use. However, the command line was incorrect: the changelist specification must be supplied on standard input, not as an argument to p4. Signed-off-by: Luke Diamand <luke@diamand.org> Acked-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-22Merge branch 'js/t1050'Libravatar Junio C Hamano1-6/+6
* js/t1050: t1050-large: generate large files without dd
2015-01-22Merge branch 'ak/cat-file-clean-up'Libravatar Junio C Hamano1-2/+0
* ak/cat-file-clean-up: cat-file: use "type" and "size" from outer scope
2015-01-22Merge git://github.com/git-l10n/git-poLibravatar Junio C Hamano7-6423/+6506
* git://github.com/git-l10n/git-po: l10n: correct indentation of show-branch usage l10n: de.po: translate 3 messages l10n: zh_CN: various fixes on command arguments l10n: vi.po(2298t): Updated 3 new strings l10n: sv.po: Update Swedish translation (2298t0f0u) l10n: fr.po v2.3.0 round 2 l10n: git.pot: v2.3.0 round 2 (3 updated) l10n: de.po: translate 13 new messages l10n: de.po: fix typo l10n: de.po: translate "track" as "versionieren" l10n: zh_CN: translations for git v2.3.0-rc0 l10n: sv.po: Update Swedish translation (2298t0f0u) l10n: fr.po v2.3.0 round 1 l10n: vi.po(2298t): Updated and change Plural-Forms l10n: git.pot: v2.3.0 round 1 (13 new, 11 removed) l10n: ca.po: various fixes
2015-01-22Merge branch 'sh/asciidoc-git-version-fix'Libravatar Junio C Hamano1-1/+1
* sh/asciidoc-git-version-fix: Documentation: fix version numbering
2015-01-22Documentation: fix version numberingLibravatar Sven van Haastregt1-1/+1
Version numbers in asciidoc-generated content (such as man pages) went missing as of da8a366 (Documentation: refactor common operations into variables). Fix by putting the underscore back in the variable name. Signed-off-by: Sven van Haastregt <svenvh@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-22Merge branch 'jh/empty-notes'Libravatar Junio C Hamano1-1/+1
* jh/empty-notes: Fix unclosed here document in t3301.sh
2015-01-22Fix unclosed here document in t3301.shLibravatar Kacper Kornet1-1/+1
Commit 908a3203632a02568df230c0fccf9a2cd8da24e6 introduced indentation to here documents in t3301.sh. However in one place <<-EOF was missing -, which broke this test when run with mksh-50d. This commit fixes it. Signed-off-by: Kacper Kornet <draenog@pld-linux.org> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-21t/lib-terminal.sh: fix typoLibravatar Alexander Kuleshov1-1/+1
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-01-21pack-bitmap: fix typoLibravatar Alexander Kuleshov1-1/+1
Signed-off-by: Alexander Kuleshov <kuleshovmail@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>