summaryrefslogtreecommitdiff
path: root/builtin-commit-tree.c
Commit message (Collapse)AuthorAgeFilesLines
* init_buffer(): Kill buf pointerLuiz Fernando N. Capitulino2007-04-251-2/+1
| | | | | | | We don't need it, it's possible to assign the block of memory to bufp Signed-off-by: Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Cleanup check_valid in commit-tree.Shawn O. Pearce2007-02-271-5/+5
| | | | | | | | | This routine should be using the object_type enum rather than a string comparsion, as the expected type is always supplied and is known at compile time. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* convert object type handling from a string to a numberNicolas Pitre2007-02-271-4/+3
| | | | | | | | | | | | | | | 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>
* Don't force everybody to call setup_ident().Junio C Hamano2007-01-281-1/+0
| | | | | | | | | | | | Back when only handful commands that created commit and tag were the only users of committer identity information, it made sense to explicitly call setup_ident() to pre-fill the default value from the gecos information. But it is much simpler for programs to make the call automatic when get_ident() is called these days, since many more programs want to use the information when updating the reflog. Signed-off-by: Junio C Hamano <junkio@cox.net>
* commit-tree: cope with different ways "utf-8" can be spelled.Junio C Hamano2006-12-301-2/+1
| | | | | | | | People can spell config.commitencoding differently from what we internally have ("utf-8") to mean UTF-8. Try to accept them and treat them equally. Signed-off-by: Junio C Hamano <junkio@cox.net>
* UTF-8: introduce i18n.logoutputencoding.Junio C Hamano2006-12-271-1/+3
| | | | | | | | | | | | | | | | It is plausible for somebody to want to view the commit log in a different encoding from i18n.commitencoding -- the project's policy may be UTF-8 and the user may be using a commit message hook to run iconv to conform to that policy (and either not have i18n.commitencoding to default to UTF-8 or have it explicitly set to UTF-8). Even then, Latin-1 may be more convenient for the usual pager and the terminal the user uses. The new variable i18n.logoutputencoding is used in preference to i18n.commitencoding to decide what encoding to recode the log output in when git-log and friends formats the commit log message. Signed-off-by: Junio C Hamano <junkio@cox.net>
* i18n.logToUTF8: convert commit log message to UTF-8Junio C Hamano2006-12-261-2/+9
| | | | | | | | | | | | When i18n.commitencoding is set to a non UTF-8 encoding, commit-tree records the encoding in an extra header after author/committer headers in the commit object. An earlier version used trailer but Johannes points out that there is little risk breaking existing Porcelains with a new header. Signed-off-by: Junio C Hamano <junkio@cox.net>
* commit-tree: encourage UTF-8 commit messages.Johannes Schindelin2006-12-241-2/+13
| | | | | | | | | | | | Introduce is_utf() to check if a text looks like it is encoded in UTF-8, utf8_width() to count display width, and implements print_wrapped_text() using them. git-commit-tree warns if the commit message does not minimally conform to the UTF-8 encoding when i18n.commitencoding is either unset, or set to "utf-8". Signed-off-by: Junio C Hamano <junkio@cox.net>
* commit-tree: do not overflow MAXPARENTJunio C Hamano2006-12-211-0/+3
| | | | | | | We have a static allocation of MAXPARENT, but that limit was not enforced, other than by a lucky invocation of the program segfaulting. Signed-off-by: Junio C Hamano <junkio@cox.net>
* make commit message a little more consistent and confortingNicolas Pitre2006-12-151-2/+0
| | | | | | | | | | | | It is nicer to let the user know when a commit succeeded all the time, not only the first time. Also the commit sha1 is much more useful than the tree sha1 in this case. This patch also introduces a -q switch to supress this message as well as the summary of created/deleted files. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Do not use memcmp(sha1_1, sha1_2, 20) with hardcoded length.David Rientjes2006-08-171-1/+1
| | | | | | | | | | | | | Introduces global inline: hashcmp(const unsigned char *sha1, const unsigned char *sha2) Uses memcmp for comparison and returns the result based on the length of the hash name (a future runtime decision). Acked-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: David Rientjes <rientjes@google.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Call setup_git_directory() much earlierLinus Torvalds2006-07-291-3/+1
| | | | | | | | | This changes the calling convention of built-in commands and passes the "prefix" (i.e. pathname of $PWD relative to the project root level) down to them. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Builtin git-commit-tree.Peter Eriksen2006-05-231-0/+140
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk> Signed-off-by: Junio C Hamano <junkio@cox.net>