summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* reflog_expire(): integrate lock_ref_sha1_basic() errors into oursmh/ref-directory-file-3mh/ref-directory-fileMichael Haggerty2015-05-111-2/+2
| | | | | | | | Now that lock_ref_sha1_basic() gives us back its error messages via a strbuf, incorporate its error message into our error message rather than emitting two separate error messages. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* ref_transaction_commit(): delete extra "the" from error messageMichael Haggerty2015-05-112-8/+8
| | | | | | | | While we are in the area, let's remove a superfluous definite article from the error message that is emitted when the reference cannot be locked. This improves how it reads and makes it a bit shorter. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* ref_transaction_commit(): provide better error messagesMichael Haggerty2015-05-111-4/+6
| | | | | | | | | Now that lock_ref_sha1_basic() gives us back its error messages via a strbuf, incorporate its error message into our error message rather than emitting one error messages to stderr immediately and returning a second to our caller. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* rename_ref(): integrate lock_ref_sha1_basic() errors into oursMichael Haggerty2015-05-111-4/+2
| | | | | | | | Now that lock_ref_sha1_basic() gives us back its error messages via a strbuf, incorporate its error message into our error message rather than emitting two separate error messages. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* lock_ref_sha1_basic(): improve diagnostics for ref D/F conflictsMichael Haggerty2015-05-112-8/+16
| | | | | | | | | | | | | | | If there is a failure to lock a reference that is likely caused by a D/F conflict (e.g., trying to lock "refs/foo/bar" when reference "refs/foo" already exists), invoke verify_refname_available() to try to generate a more helpful error message. That function might not detect an error. For example, some non-reference file might be blocking the deletion of an otherwise-empty directory tree, or there might be a race with another process that just deleted the offending reference. In such cases, generate the strerror-based error message like before. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* lock_ref_sha1_basic(): report errors via a "struct strbuf *err"Michael Haggerty2015-05-111-16/+28
| | | | | | | | For now, change the callers to spew the error to stderr like before. But soon we will change them to incorporate the reason for the failure into their own error messages. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* verify_refname_available(): report errors via a "struct strbuf *err"Michael Haggerty2015-05-111-20/+30
| | | | | | | | It shouldn't be spewing errors directly to stderr. For now, change its callers to spew the errors to stderr. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* verify_refname_available(): rename functionMichael Haggerty2015-05-111-17/+20
| | | | | | | | | Rename is_refname_available() to verify_refname_available() and change its return value from 1 for success to 0 for success, to be consistent with our error-handling convention. In a moment it will also get a "struct strbuf *err" parameter. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* refs: check for D/F conflicts among refs created in a transactionMichael Haggerty2015-05-112-63/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If two references that D/F conflict (e.g., "refs/foo" and "refs/foo/bar") are created in a single transaction, the old code discovered the problem only after the "commit" phase of ref_transaction_commit() had already begun. This could leave some references updated and others not, which violates the promise of atomicity. Instead, check for such conflicts during the "locking" phase: * Teach is_refname_available() to take an "extras" parameter that can contain extra reference names with which the specified refname must not conflict. * Change lock_ref_sha1_basic() to take an "extras" parameter, which it passes through to is_refname_available(). * Change ref_transaction_commit() to pass "affected_refnames" to lock_ref_sha1_basic() as its "extras" argument. This change fixes a test case in t1404. This code is a bit stricter than it needs to be. We could conceivably allow reference "refs/foo/bar" to be created in the same transaction as "refs/foo" is deleted (or vice versa). But that would be complicated to implement, because it is not possible to lock "refs/foo/bar" while "refs/foo" exists as a loose reference, but on the other hand we don't want to delete some references before adding others (because that could leave a gap during which required objects are unreachable). There is also a complication that reflog files' paths can conflict. Any less-strict implementation would probably require tricks like the packing of all references before the start of the real transaction, or the use of temporary intermediate reference names. So for now let's accept too-strict checks. Some reference update transactions will be rejected unnecessarily, but they will be rejected in their entirety rather than leaving the repository in an intermediate state, as would happen now. Please note that there is still one kind of D/F conflict that is *not* handled correctly. If two processes are running at the same time, and one tries to create "refs/foo" at the same time that the other tries to create "refs/foo/bar", then they can race with each other. Both processes can obtain their respective locks ("refs/foo.lock" and "refs/foo/bar.lock"), proceed to the "commit" phase of ref_transaction_commit(), and then the slower process will discover that it cannot rename its lockfile into place (after possibly having committed changes to other references). There appears to be no way to fix this race without changing the locking policy, which in turn would require a change to *all* Git clients. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* ref_transaction_commit(): use a string_list for detecting duplicatesMichael Haggerty2015-05-111-14/+11
| | | | | | | | | | | | | | | | | | | | | Detect duplicates by storing the reference names in a string_list and sorting that, instead of sorting the ref_updates directly. * In a moment the string_list will be used for another purpose, too. * This removes the need for the custom comparison function ref_update_compare(). * This means that we can carry out the updates in the order that the user specified them instead of reordering them. This might be handy someday if, we want to permit multiple updates to a single reference as long as they are compatible with each other. Note: we can't use string_list_remove_duplicates() to check for duplicates, because we need to know the name of the reference that appeared multiple times, to be used in the error message. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* is_refname_available(): use dirname in first loopMichael Haggerty2015-05-111-14/+26
| | | | | | | | | In the first loop (over prefixes of refname), use dirname to keep track of the current prefix. This is not an improvement in itself, but in a moment we will start using dirname for a role where a NUL-terminated string is needed. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* struct nonmatching_ref_data: store a refname instead of a ref_entryMichael Haggerty2015-05-111-3/+4
| | | | | | | | Now that we don't need a ref_entry to pass to report_refname_conflict(), it is sufficient to store the refname of the conflicting reference. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* report_refname_conflict(): inline functionMichael Haggerty2015-05-111-8/+2
| | | | | | | | It wasn't pulling its weight. And we are about to need code similar to this where no ref_entry is available and with more diverse error messages. Rather than try to generalize the function, just inline it. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* entry_matches(): inline functionMichael Haggerty2015-05-111-7/+2
| | | | | | | | It wasn't pulling its weight. And in a moment we will need similar tests that take a refname rather than a ref_entry as parameter, which would have made entry_matches() even less useful. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* is_refname_available(): convert local variable "dirname" to strbufMichael Haggerty2015-05-111-7/+5
| | | | | | | This change wouldn't be worth it by itself, but in a moment we will use the strbuf for more string juggling. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* is_refname_available(): avoid shadowing "dir" variableMichael Haggerty2015-05-111-2/+2
| | | | | | | | The function had a "dir" parameter that was shadowed by a local "dir" variable within a code block. Use the former in place of the latter. (This is consistent with "dir"'s use elsewhere in the function.) Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* is_refname_available(): revamp the commentsMichael Haggerty2015-05-111-22/+47
| | | | | | | Change the comments to a running example of running the function with refname set to "refs/foo/bar". Add some more explanation of the logic. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* t1404: new tests of ref D/F conflicts within transactionsMichael Haggerty2015-05-111-0/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add some tests of reference D/F conflicts (by which I mean the fact that references like "refs/foo" and "refs/foo/bar" are not allowed to coexist) in the context of reference transactions. The test of creating two conflicting references in the same transaction fails, leaving the transaction half-completed. This will be fixed later in this patch series. Please note that the error messages emitted in the case of conflicts are not very user-friendly. In particular, when the conflicts involve loose references, then the errors are reported as error: there are still refs under 'refs/foo' fatal: Cannot lock the ref 'refs/foo'. or error: unable to resolve reference refs/foo/bar: Not a directory fatal: Cannot lock the ref 'refs/foo/bar'. This is because lock_ref_sha1_basic() fails while trying to lock the new reference, before it even gets to the is_refname_available() check. This situation will also be improved later in this patch series. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
* Git 2.4v2.4.0Junio C Hamano2015-04-302-1/+6
| | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'mh/multimail-renewal'Junio C Hamano2015-04-282-24/+25
|\ | | | | | | | | * mh/multimail-renewal: Update git-multimail to version 1.0.2
| * Update git-multimail to version 1.0.2mh/multimail-renewalMichael Haggerty2015-04-282-24/+25
| | | | | | | | | | | | | | | | The only changes are to the README files, most notably the list of maintainers and the project URL. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'mg/show-notes-doc'Junio C Hamano2015-04-281-2/+2
|\ \ | | | | | | | | | | | | | | | | | | Documentation fix. * mg/show-notes-doc: rev-list-options.txt: complete sentence about notes matching
| * | rev-list-options.txt: complete sentence about notes matchingmg/show-notes-docMichael J Gruber2015-04-171-2/+2
| | | | | | | | | | | | | | | Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'nd/versioncmp-prereleases'Junio C Hamano2015-04-281-4/+7
|\ \ \ | | | | | | | | | | | | | | | | * nd/versioncmp-prereleases: git tag: mention versionsort.prereleaseSuffix in manpage
| * | | git tag: mention versionsort.prereleaseSuffix in manpagend/versioncmp-prereleasesMichael Haggerty2015-04-231-4/+7
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'mg/status-v-v'Junio C Hamano2015-04-281-0/+8
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | * mg/status-v-v: status: document the -v/--verbose option
| * | | | status: document the -v/--verbose optionmg/status-v-vMichael Haggerty2015-04-231-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Document `git status -v`, including its new doubled `-vv` form. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | Sync with 2.3.7Junio C Hamano2015-04-272-1/+23
|\ \ \ \ \ | | |_|_|/ | |/| | |
| * | | | Git 2.3.7v2.3.7Junio C Hamano2015-04-274-3/+25
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | Merge branch 'tb/connect-ipv6-parse-fix' into maintJunio C Hamano2015-04-273-16/+24
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An earlier update to the parser that disects a URL broke an address, followed by a colon, followed by an empty string (instead of the port number), e.g. ssh://example.com:/path/to/repo. * tb/connect-ipv6-parse-fix: connect.c: ignore extra colon after hostname
| * \ \ \ \ Merge branch 'ma/bash-completion-leaking-x' into maintJunio C Hamano2015-04-271-1/+1
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The completion script (in contrib/) contaminated global namespace and clobbered on a shell variable $x. * ma/bash-completion-leaking-x: completion: fix global bash variable leak on __gitcompappend
| * \ \ \ \ \ Merge branch 'jc/push-cert' into maintJunio C Hamano2015-04-271-0/+23
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "git push --signed" protocol extension did not limit what the "nonce" that is a server-chosen string can contain or how long it can be, which was unnecessarily lax. Limit both the length and the alphabet to a reasonably small space that can still have enough entropy. * jc/push-cert: push --signed: tighten what the receiving end can ask to sign
* | | | | | | | RelNotes: wordsmithingMichael Haggerty2015-04-231-164/+172
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make many textual tweaks to the 2.4.0 release notes. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | RelNotes: refer to the rebase -i "todo list", not "insn sheet"Michael Haggerty2015-04-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Todo list" is the name that is used in the user-facing documentation. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | RelNotes: correct name of versionsort.prereleaseSuffixMichael Haggerty2015-04-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Git 2.4.0-rc3v2.4.0-rc3Junio C Hamano2015-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | Sync with maintJunio C Hamano2015-04-212-1/+15
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | Git 2.3.6v2.3.6Junio C Hamano2015-04-214-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | | | | | | Merge branch 'jk/colors' into maintJunio C Hamano2015-04-211-2/+7
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "diff-highlight" (in contrib/) used to show byte-by-byte differences, which meant that multi-byte characters can be chopped in the middle. It learned to pay attention to character boundaries (assuming the UTF-8 payload). * jk/colors: diff-highlight: do not split multibyte characters
| * \ \ \ \ \ \ \ Merge branch 'jk/test-annoyances' into maintJunio C Hamano2015-04-215-15/+24
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Test fixes. * jk/test-annoyances: t5551: make EXPENSIVE test cheaper t5541: move run_with_cmdline_limit to test-lib.sh t: pass GIT_TRACE through Apache t: redirect stderr GIT_TRACE to descriptor 4 t: translate SIGINT to an exit
| * \ \ \ \ \ \ \ \ Merge branch 'pt/enter-repo-comment-fix' into maintJunio C Hamano2015-04-211-8/+3
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation update. * pt/enter-repo-comment-fix: enter_repo(): fix docs to match code
| * \ \ \ \ \ \ \ \ \ Merge branch 'jz/gitweb-conf-doc-fix' into maintJunio C Hamano2015-04-211-1/+1
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation update. * jz/gitweb-conf-doc-fix: gitweb.conf.txt: say "build-time", not "built-time"
| * \ \ \ \ \ \ \ \ \ \ Merge branch 'jk/cherry-pick-docfix' into maintJunio C Hamano2015-04-211-1/+2
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jk/cherry-pick-docfix: cherry-pick: fix docs describing handling of empty commits
| * \ \ \ \ \ \ \ \ \ \ \ Merge branch 'iu/fix-parse-options-h-comment' into maintJunio C Hamano2015-04-211-2/+1
| |\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * iu/fix-parse-options-h-comment: parse-options.h: OPTION_{BIT,SET_INT} do not store pointer to defval
| * \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'jg/cguide-we-cannot-count' into maintJunio C Hamano2015-04-211-1/+1
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * jg/cguide-we-cannot-count: CodingGuidelines: update 'rough' rule count
| * \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'jk/pack-corruption-post-mortem' into maintJunio C Hamano2015-04-211-0/+237
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation update. * jk/pack-corruption-post-mortem: howto: document more tools for recovery corruption
| * \ \ \ \ \ \ \ \ \ \ \ \ \ \ Merge branch 'jn/doc-fast-import-no-16-octopus-limit' into maintJunio C Hamano2015-04-211-4/+0
| |\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Documentation update. * jn/doc-fast-import-no-16-octopus-limit: fast-import doc: remove suggested 16-parent limit
* | | | | | | | | | | | | | | | | RelNotes: "merge --quiet" change has been revertedJunio C Hamano2015-04-211-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | | | | | | | Hopefully the last batch for 2.4Junio C Hamano2015-04-201-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | | | | | | | | | | | | | | Merge branch 'ps/grep-help-all-callback-arg'Junio C Hamano2015-04-201-1/+1
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code clean-up. * ps/grep-help-all-callback-arg: grep: correctly initialize help-all option