aboutsummaryrefslogtreecommitdiff
path: root/mktag.c
Commit message (Collapse)AuthorAge
* convert object type handling from a string to a numberNicolas Pitre2007-02-27
| | | | | | | | | | | | | | | We currently have two parallel notation for dealing with object types in the code: a string and a numerical value. One of them is obviously redundent, and the most used one requires more stack space and a bunch of strcmp() all over the place. This is an initial step for the removal of the version using a char array found in object reading code paths. The patch is unfortunately large but there is no sane way to split it in smaller parts without breaking the system. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Use xmalloc instead of mallocJonas Fonseca2006-08-31
| | | | | Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fixup command names in some usage strings.Ramsay Allan Jones2006-08-03
| | | | | | | | | Most usage strings, such as for command xxx, start with "git-xxx". This updates the rebels to conform to the general pattern. (The git wrapper is an exception to this, of course ...) Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add NO_C99_FORMAT to support older compilers.Ramsay Allan Jones2006-08-02
| | | | | | | | | The NO_C99_FORMAT macro allows compilers that lack support for the ll,hh,j,z,t size specifiers (eg. gcc 2.95.2) to adapt the code to avoid runtime errors in the formatted IO functions. Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* New tests and en-passant modifications to mktag.Ramsay Allan Jones2006-08-02
| | | | | | | | | | | | | | | | | | | These changes were originally part of the next patch, but have been split out since they were peripheral to the main purpose of that patch. - update comment describing the signature format to reflect the current code. - remove trailing \n in calls to error(), since a \n is already provided by error(). - remove redundant call to get_sha1_hex(). - call sha1_to_hex(sha1) to convert to ascii, rather than attempting to print the raw sha1. The new tests provide a regression suite to support the modifications to git-mktag in this and the next patch. Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Avoid C99 comments, use old-style C comments instead.Pavel Roskin2006-07-10
| | | | | | | | | | This doesn't make the code uglier or harder to read, yet it makes the code more portable. This also simplifies checking for other potential incompatibilities. "gcc -std=c89 -pedantic" can flag many incompatible constructs as warnings, but C99 comments will cause it to emit an error. Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* add more informative error messages to git-mktagBjörn Engelmann2006-05-23
| | | | | Signed-off-by: Björn Engelmann <BjEngelmann@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* remove the artificial restriction tagsize < 8kbBjörn Engelmann2006-05-23
| | | | | Signed-off-by: Björn Engelmann <BjEngelmann@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Use blob_, commit_, tag_, and tree_type throughout.Peter Eriksen2006-04-04
| | | | | | | | | This replaces occurences of "blob", "commit", "tag", and "tree", where they're really used as type specifiers, which we already have defined global constants for. Signed-off-by: Peter Eriksen <s022018@student.dtu.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>
* xread/xwrite: do not worry about EINTR at calling sites.Junio C Hamano2005-12-19
| | | | | | | | | | We had errno==EINTR check after read(2)/write(2) sprinkled all over the places, always doing continue. Consolidate them into xread()/xwrite() wrapper routines. Credits for suggestion goes to HPA -- bugs are mine. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make the rest of commands work from a subdirectory.Junio C Hamano2005-11-28
| | | | | | | | | | These commands are converted to run from a subdirectory. commit-tree convert-objects merge-base merge-index mktag pack-objects pack-redundant prune-packed read-tree tar-tree unpack-file unpack-objects update-server-info write-tree Signed-off-by: Junio C Hamano <junkio@cox.net>
* [PATCH] Update tags to record who made themEric W. Biederman2005-07-15
| | | | | | | | | | | And finally what all of this has been leading up to. The 2 line code change to record who made a tag, and the 8 line code change to check that we recorded the tag. Gosh the error checking is always so much bigger than the code :) Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* git-mktag: be more careful in reading the input.Linus Torvalds2005-05-29
| | | | | | | | Instead of always assuming it can be read with a single read() system call, loop around properly. Pointed out by Pasky, but I ended up implementing it differently from his suggested patch.
* [PATCH] delta readNicolas Pitre2005-05-20
| | | | | | | | | | | | | | | | This makes the core code aware of delta objects and undeltafy them as needed. The convention is to use read_sha1_file() to have undeltafication done automatically (most users do that already so this is transparent). If the delta object itself has to be accessed then it must be done through map_sha1_file() and unpack_sha1_file(). In that context mktag.c has been switched to read_sha1_file() as there is no reason to do the full map+unpack manually. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
* Rename git core commands to be "git-xxxx" to avoid name clashes.Linus Torvalds2005-04-29
This also regularizes the make. The source files themselves don't get the "git-" prefix, because that's just inconvenient. So instead we just make the rule that "git-xxxx" depends on "xxxx.c", and do that for all the core programs (ie the old "git-mktag.c" got renamed to just "mktag.c" to match everything else). And "show-diff" got renamed to "git-diff-files" while at it, since that's what it really should be to match the other git-diff-xxx cases.