summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Make git_oid_equal a non-inline APIRussell Belfer2014-02-201-0/+5
| | | |
* | | | ReadabilityBen Straub2014-02-181-1/+3
| | | |
* | | | Improve error propagation in shallow callBen Straub2014-02-181-4/+5
|/ / /
* | | Check for EWOULDBLOCK as well as EAGAIN on write.brian m. carlson2014-02-162-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some systems, notably HP PA-RISC systems running Linux or HP-UX, EWOULDBLOCK and EAGAIN are not the same value. POSIX (and these OSes) allow EWOULDBLOCK to occur on write(2) (and send(2), etc.), so check explicitly for this case as well as EAGAIN by defining and using a macro GIT_ISBLOCKED that considers both. The macro is necessary because MSYS does not provide EWOULDBLOCK and compilation fails if an attempt is made to use it unconditionally. On most systems, where the two values are the same, the compiler will simply optimize this check out and it will have no effect.
* | | Never convert CRLF->LFEdward Thomson2014-02-111-17/+4
| | | | | | | | | | | | Core git performs no conversion on systems that use LF, emulate that.
* | | Merge pull request #2110 from libgit2/ed/crlf_inputRussell Belfer2014-02-111-1/+7
|\ \ \ | | | | | | | | Handle `core.autocrlf=input` when checking out
| * | | core.autocrlf=input w/ text=auto attr to workdirEdward Thomson2014-02-091-1/+7
| | |/ | |/|
* | | refs: move current_id before the reflog parametersCarlos Martín Nieto2014-02-101-8/+8
| | | | | | | | | | | | | | | Keep the reflog parameters as the last two, as they're the optional parameters.
* | | refs: conditional wording fixupsCarlos Martín Nieto2014-02-101-3/+2
|/ / | | | | | | | | This addresses arrbee's concerns about wording in the conditional reference udpate functions.
* | Add git_commit_amend APIRussell Belfer2014-02-072-66/+163
| | | | | | | | | | | | | | | | | | This adds an API to amend an existing commit, basically a shorthand for creating a new commit filling in missing parameters from the values of an existing commit. As part of this, I also added a new "sys" API to create a commit using a callback to get the parents. This allowed me to rewrite all the other commit creation APIs so that temporary allocations are no longer needed.
* | Merge pull request #2099 from libgit2/bs/more-reflog-stuffRussell Belfer2014-02-077-17/+77
|\ \ | | | | | | More reflogness
| * | Correct default reflog message for git_remote_fetchBen Straub2014-02-061-1/+12
| | |
| * | Merge remote-tracking branch 'libgit2/development' into bs/more-reflog-stuffBen Straub2014-02-057-81/+85
| |\ \
| * | | Add reflog params to git_repository_detach_headBen Straub2014-02-041-2/+5
| | | |
| * | | Add reflog parameters to remote apisBen Straub2014-02-042-8/+20
| | | | | | | | | | | | Also added a test for git_remote_fetch.
| * | | Add reflog parameters to git_push_update_tipsBen Straub2014-02-041-2/+7
| | | |
| * | | Fix reflog message when creating commitsBen Straub2014-02-041-2/+21
| | | |
| * | | Add reset tests for reflogBen Straub2014-02-031-1/+3
| | | |
| * | | Add reflog parameters to git_resetBen Straub2014-02-031-2/+10
| | | |
* | | | Merge pull request #2042 from libgit2/cmn/conditional-refRussell Belfer2014-02-074-46/+172
|\ \ \ \ | | | | | | | | | | refs: conditional ref updates
| * | | | refs: add an unconditional deleteCarlos Martín Nieto2014-02-051-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Add it under the git_reference_remove() name, letting the user pass the repo and name, analogous to unconditional setting/creation.
| * | | | refs: catch cases where the ref type has changedCarlos Martín Nieto2014-02-051-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | If the type of the on-disk reference has changed, the old value comparison should fail.
| * | | | refs: check the ref's old value when deletingCarlos Martín Nieto2014-02-051-1/+9
| | | | | | | | | | | | | | | | | | | | Recognize when the reference has changed since we loaded it.
| * | | | refs: placeholder conditional deleteCarlos Martín Nieto2014-02-054-26/+48
| | | | | | | | | | | | | | | | | | | | We don't actually pass the old value yet.
| * | | | refs: factor out old value comparisonCarlos Martín Nieto2014-02-051-14/+26
| | | | | | | | | | | | | | | | | | | | We will reuse this later for deletion.
| * | | | refs: bring conditional symbolic updates to the frontendCarlos Martín Nieto2014-02-051-5/+18
| | | | | | | | | | | | | | | | | | | | Bring the race detection goodness to symbolic references as well.
| * | | | refdb: add conditional symbolic updatesCarlos Martín Nieto2014-02-054-24/+26
| | | | | | | | | | | | | | | | | | | | | | | | | Add a parameter to the backend to allow checking for the old symbolic target.
| * | | | refs: fix leak on successful updateCarlos Martín Nieto2014-02-051-7/+7
| | | | | | | | | | | | | | | | | | | | Free the old ref even on success.
| * | | | refs: return GIT_EMODIFIED if the ref target movedCarlos Martín Nieto2014-02-051-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | In case we loose the race to update the reference, return GIT_EMODIFIED to let the user distinguish it from other types of errors.
| * | | | refs: changes from feedbackCarlos Martín Nieto2014-02-051-27/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change the name to _matching() intead of _if(), and force _set_target() to be a conditional update. If the user doesn't care about the old value, they should use git_reference_create().
| * | | | refs: conditional ref updatesCarlos Martín Nieto2014-02-054-20/+74
| | | | | | | | | | | | | | | | | | | | Allow updating references if the old value matches the given one.
* | | | | Fix some Windows warningsRussell Belfer2014-02-074-20/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a number of warnings with the Windows 64-bit build including a test failure in test_repo_message__message where an invalid pointer to a git_buf was being used.
* | | | | Merge pull request #2100 from libgit2/rb/update-pqueueVicent Marti2014-02-0712-247/+173
|\ \ \ \ \ | | | | | | | | | | | | Replace priority queue code with implementation from hashsig
| * | | | | Avoid extra copying in pqueue operationsRussell Belfer2014-02-042-20/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This tweaks the pqueue_up and pqueue_down routines so that they will not do full element swaps but instead carry over the state of the previous loop iteration and only assign elements for which we know the final position. This will avoid a little bit of data assignment which should improve performance in theory. Also got rid of some vector helpers that I'm no longer using.
| * | | | | Fix typo setting sorted flag when reloading indexRussell Belfer2014-02-041-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a typo I made for setting the sorted flag on the index after a reload. That typo didn't actually cause any test failures so I'm also adding a test that explicitly checks that the index is correctly sorted after a reload when ignoring case and when not.
| * | | | | Convert pqueue to just be a git_vectorRussell Belfer2014-02-048-71/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates the git_pqueue to simply be a set of specialized init/insert/pop functions on a git_vector. To preserve the pqueue feature of having a fixed size heap, I converted the "sorted" field in git_vectors to a more general "flags" field so that pqueue could mix in it's own flag. This had a bunch of ramifications because a number of places were directly looking at the vector "sorted" field - I added a couple new git_vector helpers (is_sorted, set_sorted) so the specific representation of this information could be abstracted.
| * | | | | Replace pqueue with code from hashsig heapRussell Belfer2014-02-038-226/+142
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I accidentally wrote a separate priority queue implementation when I was working on file rename detection as part of the file hash signature calculation code. To simplify licensing terms, I just adapted that to a general purpose priority queue and replace the old priority queue implementation that was borrowed from elsewhere. This also removes parts of the COPYING document that no longer apply to libgit2.
* | | | | Remove unused utf8 -> utf16 conversion codeEdward Thomson2014-02-051-62/+0
| |_|_|/ |/| | |
* | | | Merge pull request #2094 from libgit2/cmn/push-non-commitRussell Belfer2014-02-052-32/+43
|\ \ \ \ | | | | | | | | | | Add flexibility to the revwalk API
| * | | | revparse: do look at all refs when matching textCarlos Martín Nieto2014-02-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Now that we no longer fail to push non-commits on a glob, let's search on all refs when we rev-parse syntax asks us to match text.
| * | | | revwalk: remove usage of foreachCarlos Martín Nieto2014-02-051-11/+14
| | | | |
| * | | | revwalk: ignore wrong object type in glob pushesCarlos Martín Nieto2014-02-051-12/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Pushing a whole namespace can cause us to attempt to push non-committish objects. Catch this situation and special-case it for ignoring this.
| * | | | revwalk: accept committish objectsCarlos Martín Nieto2014-02-051-8/+13
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let the user push committish objects and peel them to figure out which commit to push to our queue. This is for convenience and for allowing uses of git_revwalk_push_glob(w, "tags") with annotated tags.
* | | | Split p_strlen into its own headerCarlos Martín Nieto2014-02-053-13/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need this from util.h and posix.h, but the latter includes common.h which includes util.h, which means p_strlen is not defined by the time we get to git__strndup(). Split the definition on p_strlen() off into its own header so we can use it in util.h.
* | | | utils: don't reimplement strnlenCarlos Martín Nieto2014-02-051-2/+2
| | | | | | | | | | | | | | | | | | | | The standard library provides a very nice strnlen function, which knows to use SSE, let's not reimplement it ourselves.
* | | | commit: faster parsingCarlos Martín Nieto2014-02-051-28/+12
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current code issues a lot of strncmp() calls in order to check for the end of the header, simply in order to copy it and start going through it again. These are a lot of calls for something we can check as we go along. Knowing the amount of parents beforehand to reduce allocations in extreme cases does not make up for them. Instead start parsing immediately and check for the double-newline after each header field, leaving the raw_header allocation for the end, which lets us go through the header once and reduces the amount of strncmp() calls significantly. In unscientific testing, this has reduced a shortlog-like usage (walking though the whole history of a branch and extracting data from the commits) of git.git from ~830ms to ~700ms and makes the time we spend in strncmp() negligible.
* | | Remove unused pointer assignmentEdward Thomson2014-02-031-1/+1
| | |
* | | Merge wd validation tests against index not HEADEdward Thomson2014-02-031-6/+3
| |/ |/| | | | | | | | | | | | | | | | | | | | | Validating the workdir should not compare HEAD to working directory - this is both inefficient (as it ignores the cache) and incorrect. If we had legitimately allowed changes in the index (identical to the merge result) then comparing HEAD to workdir would reject these changes as different. Further, this will identify files that were filtered strangely as modified, while testing with the cache would prevent this. Also, it's stupid slow.
* | Merge pull request #2095 from libgit2/update-head-reflogVicent Marti2014-02-031-1/+7
|\ \ | | | | | | Correct "new" id for reattached-HEAD reflog entry
| * | Check for errors when dereferencing symbolic refsBen Straub2014-02-011-2/+6
| | |