summaryrefslogtreecommitdiff
path: root/src/signature.c
Commit message (Collapse)AuthorAgeFilesLines
* Introduce git_rebase_commitEdward Thomson2014-10-261-0/+11
| | | | Commit the current patch of a rebase process.
* signature: add a dup function which takes a poolCarlos Martín Nieto2014-09-301-0/+24
| | | | This will be used by the transaction code.
* signature: don't allow empty emailscmn/signature-empty-emailCarlos Martín Nieto2014-09-101-2/+2
| | | | | | A signature is made up of a non-empty name and a non-empty email so let's validate that. This also brings us more in line with git, which also rejects ident with an empty email.
* repository: introduce a convenience config snapshot methodcmn/config-snapshotCarlos Martín Nieto2014-05-071-5/+2
| | | | | | Accessing the repository's config and immediately taking a snapshot of it is a common operation, so let's provide a convenience function for it.
* Use config snapshottingCarlos Martín Nieto2014-04-181-2/+5
| | | | | This way we can assume we have a consistent view of the config situation when we're looking up remote, branch, pack-objects, etc.
* Add git_commit_amend APIRussell Belfer2014-02-071-0/+2
| | | | | | | | | 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.
* Align git_signature_dup.Arthur Schreiber2014-01-141-12/+17
| | | | | | This changes git_signature_dup to actually honor oom conditions raised by the call to git__strdup. It also aligns it with the error code return pattern used everywhere else.
* Don't leak memory when duplicating a NULL signatureBen Straub2013-11-121-1/+5
|
* Add new git_signature_default API using configRussell Belfer2013-08-161-1/+18
| | | | | This adds a new API for creating a signature that uses the config to look up "user.name" and "user.email".
* Merge pull request #1642 from arrbee/diff-function-contextVicent Martí2013-06-121-0/+1
|\ | | | | Diff code reorg plus function context in diff headers
| * Reorganize diff and add basic diff driverRussell Belfer2013-06-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a significant reorganization of the diff code to break it into a set of more clearly distinct files and to document the new organization. Hopefully this will make the diff code easier to understand and to extend. This adds a new `git_diff_driver` object that looks of diff driver information from the attributes and the config so that things like function content in diff headers can be provided. The full driver spec is not implemented in the commit - this is focused on the reorganization of the code and putting the driver hooks in place. This also removes a few #includes from src/repository.h that were overbroad, but as a result required extra #includes in a variety of places since including src/repository.h no longer results in pulling in the whole world.
* | signature: extend trimming to more whitespaceCarlos Martín Nieto2013-06-111-2/+2
|/ | | | | | There are all sorts of misconfiguration in the wild. We already rely on the signature constructor to trim SP. Extend the logic to use `isspace` to decide whether a character should be trimmed.
* Don't bail on parsing commits with an invalid timezoneScott J. Goldman2013-06-021-2/+4
| | | | | | git doesn't do that, and it's not something that's usually actionable to fix. if you have a git repository with one bad timezone in the history, it's too late to change it most likely.
* Fix trailing whitespacesnulltoken2013-05-151-1/+1
|
* signature: Lenient when dupping, strict when creatingVicent Marti2013-05-151-5/+14
|
* Return error for empty name/emailNicolas Viennot2013-04-181-1/+1
|
* signature: Small cleanupsignatures-2Vicent Marti2013-02-201-3/+2
|
* signature: Shut up MSVC, you silly gooseVicent Marti2013-02-201-6/+3
|
* Simplify signature parsingVicent Marti2013-02-201-191/+63
|
* Parse commit time as uint64_t to avoid overflowRussell Belfer2013-01-211-2/+2
| | | | | | | The commit time is already stored as a git_time_t, but we were parsing is as a uint32_t. This just switches the parser to use uint64_t which will handle dates further in the future (and adds some tests of those future dates).
* update copyrightsEdward Thomson2013-01-081-1/+1
|
* Remove GIT_SIGNATURE_VERSION and friendsBen Straub2012-12-031-3/+1
|
* Deploy GIT_SIGNATURE_INITBen Straub2012-11-301-1/+3
|
* Fix MSVC compilation warningsnulltoken2012-09-041-1/+1
|
* signature: make the OS give us the offset for git_signature_nowCarlos Martín Nieto2012-08-281-10/+12
| | | | | | There is a better and less fragile way to calculate time offsets. Let the OS take care of dealing with DST and simply take the the offset between the local time and UTC that it gives us.
* signature: prevent angle bracket usage in identitynulltoken2012-07-111-5/+19
|
* Rename posix wrappers with 'p_' prefix.Ben Straub2012-06-061-2/+2
|
* Merge branch 'development' into rev-parseBen Straub2012-06-051-2/+2
|\ | | | | | | | | | | Conflicts: src/util.h tests-clar/refs/branches/listall.c
| * errors: Rename the generic return codesVicent Martí2012-05-181-2/+2
| |
* | Fix date.c build in msvc.Ben Straub2012-05-151-12/+0
|/ | | | | | Ported the win32 implementations of gmtime_r, localtime_r, and gettimeofday to be part of the posix compatibility layer, and fixed git_signature_now to use them.
* Fix warnings on 64-bit windows buildsRussell Belfer2012-04-171-1/+1
| | | | | This fixes all the warnings on win64 except those in deps, which come from the regex code.
* Convert reflog to new errorsRussell Belfer2012-03-201-1/+1
| | | | Cleaned up some other issues.
* Convert indexer, notes, sha1_lookup, and signatureRussell Belfer2012-03-191-61/+60
| | | | More files moved to new error handling style.
* Update Copyright headerschu2012-02-131-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* Use git_buf for path storage instead of stack-based buffersRussell Belfer2011-12-071-0/+2
| | | | | | | | | | | | | | | | | | | | This converts virtually all of the places that allocate GIT_PATH_MAX buffers on the stack for manipulating paths to use git_buf objects instead. The patch is pretty careful not to touch the public API for libgit2, so there are a few places that still use GIT_PATH_MAX. This extends and changes some details of the git_buf implementation to add a couple of extra functions and to make error handling easier. This includes serious alterations to all the path.c functions, and several of the fileops.c ones, too. Also, there are a number of new functions that parallel existing ones except that use a git_buf instead of a stack-based buffer (such as git_config_find_global_r that exists alongsize git_config_find_global). This also modifies the win32 version of p_realpath to allocate whatever buffer size is needed to accommodate the realpath instead of hardcoding a GIT_PATH_MAX limit, but that change needs to be tested still.
* global: Properly use `git__` memory wrappersVicent Marti2011-10-281-3/+3
| | | | | Ensure that all memory related functions (malloc, calloc, strdup, free, etc) are using their respective `git__` wrappers.
* signature: don't blow up trying to parse names containing '>'Brodie Rao2011-10-121-1/+1
| | | | | | | | | | | | | When trying to find the end of an email, instead of starting at the beginning of the signature, we start at the end of the name (after the first '<'). This brings libgit2 more in line with Git's behavior when reading out existing signatures. However, note that Git does not allow names like these through the usual porcelain; instead, it silently strips any '>' characters it sees.
* config: make git_config_[get|set]_long() able to properly deal with 8 bytes ↵nulltoken2011-09-221-2/+2
| | | | | | | | wide values Should fix issue #419. Signed-off-by: nulltoken <emeric.fermas@gmail.com>
* Merge pull request #384 from kiryl/warningsVicent Martí2011-09-181-3/+3
|\ | | | | Add more -W flags to CFLAGS
| * CMakefile: add -Wmissing-prototypes and fix warningsKirill A. Shutemov2011-08-301-3/+3
| | | | | | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* | Cleanup legal dataVicent Marti2011-09-191-21/+3
|/ | | | | | | | | | 1. The license header is technically not valid if it doesn't have a copyright signature. 2. The COPYING file has been updated with the different licenses used in the project. 3. The full GPLv2 header in each file annoys me.
* signature: adjust API to return error codesschu2011-08-031-7/+25
| | | | | | | | git_signature_new() and git_signature_now() currently don't return error codes. Change the API to return error codes and not pointers to let the user handle errors properly. Signed-off-by: schu <schu-github@schulog.org>
* signature.c: fix off-by-one errorschu2011-08-031-1/+1
| | | | Signed-off-by: schu <schu-github@schulog.org>
* reflog: Fix reflog writer/readernulltoken2011-07-101-2/+2
| | | | | | - Use a space to separate oids and signature - Enforce test coverage - Make test run in a temporary folder in order not to alter the test repository
* Remove unused methodsVicent Marti2011-07-091-28/+0
| | | | | | | | | The direct-writes commit left some (slow) internals methods that were no longer needed. These have been removed. Also, the Reflog code was using the old `git_signature__write`, so it has been rewritten to use a normal buffer and the new `writebuf` signature writer. It's now slightly simpler and faster.
* odb: Direct writes are backVicent Marti2011-07-091-0/+18
| | | | | | | | | | | | | | | | | | | | | | DIRECT WRITES ARE BACK AND FASTER THAN EVER. The streaming writer to the ODB was an overkill for the smaller objects like Commit and Tags; most of the streaming logic was taking too long. This commit makes Commits, Tags and Trees to be built-up in memory, and then written to disk in 2 pushes (header + data), instead of streaming everything. This is *always* faster, even for big files (since the git_filebuf class still does streaming writes when the memory cache overflows). This is also a gazillion lines of code smaller, because we don't have to precompute the final size of the object before starting the stream (this was kind of defeating the point of streaming, anyway). Blobs are still written with full streaming instead of loading them in memory, since this is still the fastest way. A new `git_buf` class has been added. It's missing some features, but it'll get there.
* signature: Fix optional headerVicent Marti2011-07-091-10/+4
|
* git_signature__write: make header optionallyschu2011-07-091-4/+10
| | | | Signed-off-by: schu <schu-github@schulog.org>
* signature: Fix warningsVicent Marti2011-07-051-7/+4
| | | | | | Add extra braces to avoid ambiguous if-else. Also, free() doesn't need a check.
* signature: straighten the creation of a signaturenulltoken2011-07-051-35/+75
| | | | | - Fails on empty name and/or email - Trims leading and trailing spaces of name and email