summaryrefslogtreecommitdiff
path: root/src/signature.c
Commit message (Collapse)AuthorAgeFilesLines
* 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
* signature: enhance relaxed parsing of bogus signaturesnulltoken2011-07-051-41/+93
| | | | Final fix for issue #278
* git_signature__parse: make parsing less strictschu2011-07-051-24/+24
| | | | | | | | | | git_signature__parse used to be very strict about what's a well-formed signature. Since git_signature__parse is used only when reading already existing signatures, we should not care about if it's a valid signature too much but rather show what we got. Reported-by: nulltoken <emeric.fermas@gmail.com> Signed-off-by: schu <schu-github@schulog.org>
* cleanup: remove trailing spacesKirill A. Shutemov2011-07-011-5/+5
| | | | Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
* sig: allow empty namesCarlos Martín Nieto2011-06-281-2/+0
| | | | Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
* commit: Allow spaces inside email addressesVicent Marti2011-06-281-1/+1
| | | | | | | | Core Git doesn't care when people use spaces in the email address, even though this kind of foolery receives the capital punishment in several states of the USA. We must obey.
* signature: Fix compilationVicent Marti2011-06-011-1/+1
|
* Fix tag and signature parsingDavid Glesser2011-05-311-6/+20
| | | | | | Before this commit, malformed tag and signature were considered as valid by the parser. See the test t3800-mktag.sh of git to see example of malformed tag and signature.
* signature.c: Move to new error handling mechanismJakob Pfender2011-05-231-1/+1
|
* Move signature.c to the new error handlingCarlos Martín Nieto2011-05-101-13/+13
| | | | Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Fix `time_t` conversion on Win32Vicent Marti2011-04-091-2/+2
|
* Fix `gmtime` issues in Win32Vicent Marti2011-04-091-6/+20
|
* Rename `git_signature_new_now`Vicent Marti2011-04-091-1/+1
| | | | The new name is more cool.
* Add API git_signature_new_nowCarlos Martín Nieto2011-04-091-0/+19
| | | | | | | | | Most tags will have a timestamp of whenever the code is running and dealing with time and timezones is error-prone. Optimize for this case by adding a function which causes the signature to be created with a current timestamp. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Add a few malloc checksCarlos Martín Nieto2011-04-091-0/+6
| | | | | | | Add checks to see if malloc failed when allocating the tag members and signature members. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
* Properly check `strtol` for errorsVicent Marti2011-04-091-9/+10
| | | | | We are now using a custom `strtol` implementation to make sure we're not missing any overflow errors.
* Change `parse` methods to const bufferVicent Marti2011-04-021-4/+4
| | | | Signed-off-by: Vicent Marti <tanoku@gmail.com>