summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-01-20Optimize color_parse_memRené Scharfe
Commit 5ef8d77a implemented color_parse_mem, a function for parsing colors from a non-NUL-terminated string, by simply allocating a new NUL-terminated string and calling color_parse. This had a small but measurable speed impact on a user format that used the advanced color parsing. E.g., # uses quick parsing $ time ./git log --pretty=tformat:'%Credfoo%Creset' >/dev/null real 0m0.673s user 0m0.652s sys 0m0.016s # uses color_parse_mem $ time ./git log --pretty=tformat:'%C(red)foo%C(reset)' >/dev/null real 0m0.692s user 0m0.660s sys 0m0.032s This patch implements color_parse_mem as the primary function, with color_parse as a wrapper for strings. This gives comparable timings to the first case above. Original patch by René. Commit message and debugging by Jeff King. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18expand --pretty=format color optionsJeff King
Currently, the only colors available to --pretty=format users are red, green, and blue. Rather than expand it with a few new colors, this patch makes the usual config color syntax available, including more colors, backgrounds, and attributes. Because colors are no longer bounded to a single word (e.g., %Cred), this uses a more advanced syntax that features a beginning and end delimiter (but the old syntax still works). So you can now do: git log --pretty=tformat:'%C(yellow)%h%C(reset) %s' to emulate --pretty=oneline, or even git log --pretty=tformat:'%C(cyan magenta bold)%s%C(reset)' if you want to relive the awesomeness of 4-color CGA. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-18color: make it easier for non-config to parse color specsJeff King
We have very featureful color-parsing routines which are used for color.diff.* and other options. Let's make it easier to use those routines from other parts of the code. This patch adds a color_parse_mem() helper function which takes a length-bounded string instead of a NUL-terminated one. While the helper is only a few lines long, it is nice to abstract this out so that: - callers don't forget to free() the temporary buffer - right now, it is implemented in terms of color_parse(). But it would be more efficient to reverse this and implement color_parse in terms of color_parse_mem. This also changes the error string for an invalid color not to mention the word "config", since it is not always appropriate (and when it is, the context is obvious since the offending config variable is given). Finally, while we are in the area, we clean up the parameter names in the declaration of color_parse; the var and value parameters were reversed from the actual implementation. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-16Merge branch 'maint'Junio C Hamano
* maint: t3404: Add test case for auto-amending only edited commits after "edit" t3404: Add test case for aborted --continue after "edit" t3501: check that commits are actually done
2009-01-15Merge branch 'maint-1.6.0' into maintJunio C Hamano
* maint-1.6.0: t3404: Add test case for auto-amending only edited commits after "edit" t3404: Add test case for aborted --continue after "edit" t3501: check that commits are actually done
2009-01-15t3404: Add test case for auto-amending only edited commits after "edit"Stephan Beyer
Add a test case for the bugfix introduced by commit c14c3c82d "git-rebase--interactive: auto amend only edited commit". Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15t3404: Add test case for aborted --continue after "edit"Stephan Beyer
Add a test case for the bugfix introduced by commit 8beb1f33d "git-rebase-interactive: do not squash commits on abort". Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15t3501: check that commits are actually doneStephan Beyer
The basic idea of t3501 is to check whether revert and cherry-pick works on renamed files. But as there is no pure cherry-pick/revert test, it is good to also check if commits are actually done in that scenario. Signed-off-by: Stephan Beyer <s-beyer@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15bash-completion: Add comments to remind about required argumentsTed Pavlic
Add a few simple comments above commands that take arguments. These comments are meant to remind developers of potential problems that can occur when the script is sourced on systems with "set -u." Any function which requires arguments really ought to be called with explicit arguments given. Also adds a #!bash to the top of bash completions so that editing software can always identify that the file is of sh type. Signed-off-by: Ted Pavlic <ted@tedpavlic.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15bash-completion: Try bash completions before simple filetypeTed Pavlic
When a git completion is not found, a bash shell should try bash-type completions first before going to standard filetype completions. This patch adds "-o bashdefault" to the completion line. If that option is not available, it uses the old method. This behavior was inspired by Mercurial's bash completion script. Signed-off-by: Ted Pavlic <ted@tedpavlic.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15bash-completion: Support running when set -u is enabledTed Pavlic
Under "set -u" semantics, it is an error to access undefined variables. Some user environments may enable this setting in the interactive shell. In any context where the completion functions access an undefined variable, accessing a default empty string (aka "${1-}" instead of "$1") is a reasonable way to code the function, as it silences the undefined variable error while still supplying an empty string. In this patch, functions that should always take an argument still use $1. Functions that have optional arguments use ${1-}. Signed-off-by: Ted Pavlic <ted@tedpavlic.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-15Merge branch 'maint'Junio C Hamano
* maint: Update draft release notes to 1.6.1.1 Make t3411 executable fix handling of multiple untracked files for git mv -k add test cases for "git mv -k"
2009-01-15Update draft release notes to 1.6.1.1Junio C Hamano
2009-01-15Merge branch 'maint-1.6.0' into maintJunio C Hamano
* maint-1.6.0: fix handling of multiple untracked files for git mv -k add test cases for "git mv -k"
2009-01-15Make t3411 executableMiklos Vajna
Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14fix handling of multiple untracked files for git mv -kMichael J Gruber
The "-k" option to "git mv" should allow specifying multiple untracked files. Currently, multiple untracked files raise an assertion if they appear consecutively as arguments. Fix this by decrementing the loop index after removing one entry from the array of arguments. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14add test cases for "git mv -k"Michael J Gruber
Add test cases for ignoring nonexisting and untracked files using the -k option to "git mv". There is one known breakage related to multiple untracked files specfied as consecutive arguments. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14Update 1.6.2 draft release notesJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14Merge branch 'maint'Junio C Hamano
* maint: fast-import: Cleanup mode setting. Git.pm: call Error::Simple() properly
2009-01-14Merge branch 'maint-1.6.0' into maintJunio C Hamano
* maint-1.6.0: fast-import: Cleanup mode setting. Git.pm: call Error::Simple() properly
2009-01-14Merge branch 'nd/grep-assume-unchanged'Junio C Hamano
* nd/grep-assume-unchanged: grep: grep cache entries if they are "assume unchanged" grep: support --no-ext-grep to test builtin grep
2009-01-14Merge branch 'as/maint-shortlog-cleanup'Junio C Hamano
* as/maint-shortlog-cleanup: builtin-shortlog.c: use string_list_append(), and don't strdup unnecessarily
2009-01-14Merge branch 'jc/maint-ls-tree'Junio C Hamano
* jc/maint-ls-tree: Document git-ls-tree --full-tree ls-tree: add --full-tree option
2009-01-14Merge branch 'js/bundle-tags'Junio C Hamano
* js/bundle-tags: bundle: allow rev-list options to exclude annotated tags
2009-01-14Merge branch 'js/add-not-submodule'Junio C Hamano
* js/add-not-submodule: git add: do not add files from a submodule
2009-01-14Merge branch 'pb/maint-git-pm-false-dir'Junio C Hamano
* pb/maint-git-pm-false-dir: Git.pm: correctly handle directory name that evaluates to "false"
2009-01-14Merge branch 'pj/maint-ldflags'Junio C Hamano
* pj/maint-ldflags: configure clobbers LDFLAGS
2009-01-14Merge branch 'fe/cvsserver'Junio C Hamano
* fe/cvsserver: cvsserver: change generation of CVS author names cvsserver: add option to configure commit message
2009-01-14Merge branch 'js/maint-bisect-gitk'Junio C Hamano
* js/maint-bisect-gitk: bisect view: call gitk if Cygwin's SESSIONNAME variable is set
2009-01-14Merge branch 'np/no-loosen-prune-expire-now'Junio C Hamano
* np/no-loosen-prune-expire-now: objects to be pruned immediately don't have to be loosened
2009-01-14Merge branch 'cb/maint-unpack-trees-absense'Junio C Hamano
* cb/maint-unpack-trees-absense: unpack-trees: remove redundant path search in verify_absent unpack-trees: fix path search bug in verify_absent unpack-trees: handle failure in verify_absent
2009-01-14Merge branch 'mc/cd-p-pwd'Junio C Hamano
* mc/cd-p-pwd: git-sh-setup: Fix scripts whose PWD is a symlink to a work-dir on OS X
2009-01-14Merge branch 'mh/cherry-default'Junio C Hamano
* mh/cherry-default: Documentation: clarify which parameters are optional to git-cherry git-cherry: make <upstream> parameter optional
2009-01-14fast-import: Cleanup mode setting.Felipe Contreras
"S_IFREG | mode" makes only sense for 0644 and 0755. Even though doing (S_IFREG | mode) may not hurt when mode is any other supported value, that is only true because S_IFREG mode bit happens to be already on for S_IFLNK or S_IFGITLINK. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-14Git.pm: call Error::Simple() properlyJay Soffian
The error message to Error::Simple() must be passed as a single argument. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-13Merge branch 'maint'Junio C Hamano
* maint: Avoid spurious error messages on error mistakes. contrib/examples/README: give an explanation of the status of these files
2009-01-13Merge branch 'kk/maint-http-push' into maintJunio C Hamano
* kk/maint-http-push: http-push: support full URI in handle_remote_ls_ctx()
2009-01-13Merge branch 'js/maint-merge-recursive-r-d-conflict' into maintJunio C Hamano
* js/maint-merge-recursive-r-d-conflict: merge-recursive: mark rename/delete conflict as unmerged
2009-01-13Merge branch 'cb/maint-merge-recursive-fix' into maintJunio C Hamano
* cb/maint-merge-recursive-fix: merge-recursive: do not clobber untracked working tree garbage modify/delete conflict resolution overwrites untracked file Conflicts: builtin-merge-recursive.c
2009-01-13Merge branch 'ap/maint-apply-modefix' into maintJunio C Hamano
* ap/maint-apply-modefix: builtin-apply: prevent non-explicit permission changes
2009-01-13Merge branch 'maint-1.6.0' into maintJunio C Hamano
* maint-1.6.0: Avoid spurious error messages on error mistakes. contrib/examples/README: give an explanation of the status of these files
2009-01-13Avoid spurious error messages on error mistakes.Pierre Habouzit
Prior to that, if the user chose "squash" as a first action, the stderr looked like: grep: /home/madcoder/dev/scm/git/.git/rebase-merge/done: No such file or directory Cannot 'squash' without a previous commit Now the first line is gone. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-13Fix Documentation typos surrounding the word 'handful'.Jon Loeliger
Some instances replaced by "handful of", others use the word "few", a couple get a slight rewording. Signed-off-by: Jon Loeliger <jdl@freescale.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-13sha1_file: make "read_object" staticChristian Couder
This function is only used from "sha1_file.c". And as we want to add a "replace_object" hook in "read_sha1_file", we must not let people bypass the hook using something other than "read_sha1_file". Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-13contrib/vim: change URL to point to the latest syntax filesMarkus Heidelberg
Vim's SVN repository doesn't offer the latest runtime files, since normally they are only updated there on a release. Though currently there is no difference between the SVN and HTTP/FTP version of the git syntax files. Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-13contrib/examples/README: give an explanation of the status of these filesjidanni@jidanni.org
We attempt to give an explanation of the status of the files in this directory. Signed-off-by: jidanni <jidanni@jidanni.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-01-12Merge branch 'maint'Junio C Hamano
* maint: Documentation/git-push.txt: minor: compress one option
2009-01-12Merge branch 'mh/maint-sendmail-cc-doc' into maintJunio C Hamano
* mh/maint-sendmail-cc-doc: doc/git-send-email: mention sendemail.cc config variable
2009-01-12Merge branch 'jc/maint-do-not-switch-to-non-commit' into maintJunio C Hamano
* jc/maint-do-not-switch-to-non-commit: git checkout: do not allow switching to a tree-ish that is not a commit
2009-01-12Documentation/git-push.txt: minor: compress one optionjidanni@jidanni.org
Signed-off-by: jidanni <jidanni@jidanni.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>