summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-04-28completion: remove unnecessary _get_comp_words_by_ref() invocationsLibravatar SZEDER Gábor1-105/+11
In v1.7.4-rc0~11^2~2 (bash: get --pretty=m<tab> completion to work with bash v4, 2010-12-02) we started to use _get_comp_words_by_ref() to access completion-related variables. That was large change, and to make it easily reviewable, we invoked _get_comp_words_by_ref() in each completion function and systematically replaced every occurance of bash's completion-related variables ($COMP_WORDS and $COMP_CWORD) with variables set by _get_comp_words_by_ref(). This has the downside that _get_comp_words_by_ref() is invoked several times during a single completion. The worst offender is perhaps 'git log mas<TAB>': during the completion of 'master' _get_comp_words_by_ref() is invoked no less than six times. However, the variables $prev, $cword, and $words provided by _get_comp_words_by_ref() are not modified in any of the completion functions, and the previous commit ensures that the $cur variable is not modified as well. This makes it possible to invoke _get_comp_words_by_ref() to get those variables only once in our toplevel completion functions _git() and _gitk(), and all other completion functions will inherit them. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-28completion: don't modify the $cur variable in completion functionsLibravatar SZEDER Gábor1-57/+50
Since v1.7.4-rc0~11^2~2 (bash: get --pretty=m<tab> completion to work with bash v4, 2010-12-02) we use _get_comp_words_by_ref() to access completion-related variables, and the $cur variable holds the word containing the current cursor position in all completion functions. This $cur variable is left unchanged in most completion functions; there are only four functions modifying its value, namely __gitcomp(), __git_complete_revlist_file(), __git_complete_remote_or_refspec(), and _git_config(). If this variable were never modified, then it would allow us a nice optimisation and cleanup. Therefore, this patch assigns $cur to an other local variable and uses that for later modifications in those four functions. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-27Start 1.7.6 cycleLibravatar Junio C Hamano3-2/+81
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-27Merge branch 'mg/x-years-12-months'Libravatar Junio C Hamano2-2/+4
* mg/x-years-12-months: date: avoid "X years, 12 months" in relative dates
2011-04-27Merge branch 'cn/format-patch-quiet'Libravatar Junio C Hamano2-7/+14
* cn/format-patch-quiet: format-patch: document --quiet option format-patch: don't pass on the --quiet flag
2011-04-27Merge branch 'ef/maint-strbuf-init'Libravatar Junio C Hamano3-12/+12
* ef/maint-strbuf-init: config: support values longer than 1023 bytes strbuf: make sure buffer is zero-terminated
2011-04-27Merge branch 'rr/doc-content-type'Libravatar Junio C Hamano2-62/+103
* rr/doc-content-type: Documentation: Allow custom diff tools to be specified in 'diff.tool' Documentation: Add diff.<driver>.* to config Documentation: Move diff.<driver>.* from config.txt to diff-config.txt Documentation: Add filter.<driver>.* to config
2011-04-27Merge branch 'jc/merge-dash-previous'Libravatar Junio C Hamano1-3/+6
* jc/merge-dash-previous: merge: allow "-" as a short-hand for "previous branch"
2011-04-27Merge branch 'dm/stash-k-i-p'Libravatar Junio C Hamano3-4/+25
* dm/stash-k-i-p: stash: ensure --no-keep-index and --patch can be used in any order stash: add two more tests for --no-keep-index
2011-04-27Merge branch 'rj/sparse'Libravatar Junio C Hamano10-30/+50
* rj/sparse: sparse: Fix some "symbol not declared" warnings sparse: Fix errors due to missing target-specific variables sparse: Fix an "symbol 'merge_file' not decared" warning sparse: Fix an "symbol 'format_subject' not declared" warning sparse: Fix some "Using plain integer as NULL pointer" warnings sparse: Fix an "symbol 'cmd_index_pack' not declared" warning Makefile: Use cgcc rather than sparse in the check target
2011-04-27Merge branch 'jk/maint-upload-pack-shallow'Libravatar Junio C Hamano1-12/+11
* jk/maint-upload-pack-shallow: upload-pack: start pack-objects before async rev-list
2011-04-27Merge branch 'nk/blame-abbrev'Libravatar Junio C Hamano2-2/+14
* nk/blame-abbrev: blame: add --abbrev command line option and make it honor core.abbrev
2011-04-27Merge branch 'jk/maint-stash-oob'Libravatar Junio C Hamano2-16/+12
* jk/maint-stash-oob: stash: fix false positive in the invalid ref test. stash: fix accidental apply of non-existent stashes Conflicts: t/t3903-stash.sh
2011-04-27Merge branch 'dm/color-palette'Libravatar Junio C Hamano4-35/+29
* dm/color-palette: Share color list between graph and show-branch
2011-04-27Merge branch 'jk/stash-loosen-safety'Libravatar Junio C Hamano2-7/+17
* jk/stash-loosen-safety: stash: drop dirty worktree check on apply
2011-04-27Merge branch 'jc/pack-objects-bigfile'Libravatar Junio C Hamano6-9/+14
* jc/pack-objects-bigfile: Teach core.bigfilethreashold to pack-objects
2011-04-27Merge branch 'mh/git-svn-automkdirs'Libravatar Junio C Hamano3-2/+42
* mh/git-svn-automkdirs: git-svn: add an option to skip the creation of empty directories
2011-04-27Merge branch 'mg/reflog-with-options'Libravatar Junio C Hamano2-13/+35
* mg/reflog-with-options: reflog: fix overriding of command line options t/t1411: test reflog with formats builtin/log.c: separate default and setup of cmd_log_init()
2011-04-27Merge branch 'ar/clean-rmdir-empty'Libravatar Junio C Hamano2-1/+8
* ar/clean-rmdir-empty: clean: unreadable directory may still be rmdir-able if it is empty
2011-04-27Merge branch 'mg/sha1-path-advise'Libravatar Junio C Hamano2-9/+19
* mg/sha1-path-advise: sha1_name: Suggest commit:./file for path in subdir t1506: factor out test for "Did you mean..."
2011-04-27Automatically autoload bashcompinit for ZSH, when neededLibravatar Marius Storm-Olsen1-8/+8
If bashcompinit has not already been autoloaded, do so automatically, as it is required to properly parse the git-completion file with ZSH. Helped-by: Felipe Contreras Signed-off-by: Marius Storm-Olsen <mstormo@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-23Git 1.7.5Libravatar Junio C Hamano2-1/+6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-22sparse: Fix some "symbol not declared" warningsLibravatar Ramsay Jones2-2/+3
In particular, sparse issues the "symbol 'a_symbol' was not declared. Should it be static?" warnings for the following symbols: attr.c:468:12: 'git_etc_gitattributes' attr.c:476:5: 'git_attr_system' vcs-svn/svndump.c:282:6: 'svndump_read' vcs-svn/svndump.c:417:5: 'svndump_init' vcs-svn/svndump.c:432:6: 'svndump_deinit' vcs-svn/svndump.c:445:6: 'svndump_reset' The symbols in attr.c only require file scope, so we add the static modifier to their declaration. The symbols in vcs-svn/svndump.c are external symbols, and they already have extern declarations in the "svndump.h" header file, so we simply include the header in svndump.c. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-22sparse: Fix errors due to missing target-specific variablesLibravatar Ramsay Jones1-17/+28
In particular, sparse issues the following errors: attr.c:472:43: error: undefined identifier 'ETC_GITATTRIBUTES' config.c:821:43: error: undefined identifier 'ETC_GITCONFIG' exec_cmd.c:14:37: error: undefined identifier 'PREFIX' exec_cmd.c:83:28: error: undefined identifier 'GIT_EXEC_PATH' builtin/help.c:328:46: error: undefined identifier 'GIT_MAN_PATH' builtin/help.c:374:40: error: undefined identifier 'GIT_INFO_PATH' builtin/help.c:382:45: error: undefined identifier 'GIT_HTML_PATH' git.c:96:42: error: undefined identifier 'GIT_HTML_PATH' git.c:241:35: error: invalid initializer http.c:293:43: error: undefined identifier 'GIT_HTTP_USER_AGENT' which is caused by not passing the target-specific additions to the EXTRA_CPPFLAGS variable to cgcc. In order to fix the problem, we define a new sparse target which depends on a set of non-existent "sparse object" files (*.sp) which correspond to the set of C source files. In addition to the new target, we also provide a new pattern rule for "creating" the sparse object files from the source files by running cgcc. This allows us to add '*.sp' to the rules setting the target-specific EXTRA_CPPFLAGS variable, which is then included in the new pattern rule to run cgcc. Also, we change the 'check' target to re-direct the user to the new sparse target. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-20date: avoid "X years, 12 months" in relative datesLibravatar Michael J Gruber2-2/+4
When relative dates are more than about a year ago, we start writing them as "Y years, M months". At the point where we calculate Y and M, we have the time delta specified as a number of days. We calculate these integers as: Y = days / 365 M = (days % 365 + 15) / 30 This rounds days in the latter half of a month up to the nearest month, so that day 16 is "1 month" (or day 381 is "1 year, 1 month"). We don't round the year at all, though, meaning we can end up with "1 year, 12 months", which is silly; it should just be "2 years". Implement this differently with months of size onemonth = 365/12 so that totalmonths = (long)( (days + onemonth/2)/onemonth ) years = totalmonths / 12 months = totalmonths % 12 In order to do this without floats, we write the first formula as totalmonths = (days*12*2 + 365) / (365*2) Tests and inspiration by Jeff King. Helped-by: Jeff King <peff@peff.net> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-19Git 1.7.5-rc3Libravatar Junio C Hamano3-9/+4
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-19Sync with 1.7.4.5Libravatar Junio C Hamano2-0/+11
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-19Git 1.7.4.5Libravatar Junio C Hamano3-2/+6
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-19git-svn.txt: Document --mergeinfoLibravatar Michael J Gruber1-0/+7
6abd933 (git-svn: allow the mergeinfo property to be set, 2010-09-24) introduced the --mergeinfo option. Document it. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-18Revert "run-command: prettify -D_FORTIFY_SOURCE workaround"Libravatar Junio C Hamano1-11/+6
This reverts commit ebec842773932e6f853acac70c80f84209b5f83e, which somehow mistakenly thought that any non-zero return from write(2) is an error.
2011-04-14Merge branch 'maint'Libravatar Junio C Hamano4-3/+7
* maint: archive: document limitation of tar.umask config setting t3306,t5304: avoid clock skew issues git.txt: fix list continuation
2011-04-14archive: document limitation of tar.umask config settingLibravatar René Scharfe1-1/+2
The local value of the config variable tar.umask is not passed to the other side with --remote. We may want to change that, but for now just document this fact. Reported-by: Jacek Masiulaniec <jacek.masiulaniec@gmail.com> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-14t3306,t5304: avoid clock skew issuesLibravatar Michael J Gruber2-1/+5
On systems where the local time and file modification time may be out of sync (e.g. test directory on NFS) t3306 and t5305 can fail because prune compares times such as "now" (client time) with file modification times (server times for remote file systems). I.e., these are spurious test failures. Avoid this by setting the relevant modification times to the local time. Noticed on a system with as little as 2s time skew. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-14git.txt: fix list continuationLibravatar Michael J Gruber1-1/+0
Remove a spurious empty line which prevented asciidoc from recognizing a list continuation mark ('+'), so that it does not get output literally any more. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-13Git 1.7.5-rc2Libravatar Junio C Hamano2-3/+3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-13Merge branch 'maint'Libravatar Junio C Hamano0-0/+0
* maint:
2011-04-13Merge branch 'jc/rev-list-options-fix' into maintLibravatar Junio C Hamano1-2/+2
* jc/rev-list-options-fix: "log --cherry-pick" documentation regression fix
2011-04-13Merge branch 'js/checkout-untracked-symlink' into maintLibravatar Junio C Hamano1-1/+1
* js/checkout-untracked-symlink: t2021: mark a test as fixed
2011-04-13remove doubled words, e.g., s/to to/to/, and fix related typosLibravatar Jim Meyering8-14/+11
I found that some doubled words had snuck back into projects from which I'd already removed them, so now there's a "syntax-check" makefile rule in gnulib to help prevent recurrence. Running the command below spotted a few in git, too: git ls-files | xargs perl -0777 -n \ -e 'while (/\b(then?|[iao]n|i[fst]|but|f?or|at|and|[dt])\s+\1\b/gims)' \ -e '{$n=($` =~ tr/\n/\n/ + 1); ($v=$&)=~s/\n/\\n/g;' \ -e 'print "$ARGV:$n:$v\n"}' Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-13revert: Hide '-r' option in default usageLibravatar Ramkumar Ramachandra1-1/+2
The '-r' command-line option is a no-op provided only for backward compatiblity since abd6970 (cherry-pick: make -r the default, 2006-10-05), and somehow ended up surviving across reimplementation in C at 9509af6 (Make git-revert & git-cherry-pick a builtin, 2007-03-01) and another rewrite of the command line parser at f810379 (Make builtin-revert.c use parse_options, 2007-10-07). We should have stopped advertising the option long time ago. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-12format-patch: document --quiet optionLibravatar Carlos Martín Nieto1-1/+4
Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-12format-patch: don't pass on the --quiet flagLibravatar Carlos Martín Nieto1-6/+10
The --quiet flag is not meant to be passed on to the diff, as the user always wants the patches to be produced so catch it and pass it to reopen_stdout which decides whether to print the filename or not. Noticed by Paul Gortmaker Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-12Merge branch 'js/checkout-untracked-symlink'Libravatar Junio C Hamano1-1/+1
* js/checkout-untracked-symlink: t2021: mark a test as fixed
2011-04-12Merge branch 'nd/init-gitdir'Libravatar Junio C Hamano1-1/+1
* nd/init-gitdir: t0001: guard a new test with SYMLINKS prerequisite
2011-04-12t2021: mark a test as fixedLibravatar Johannes Sixt1-1/+1
The failure was fixed by the previous commit. Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11t0001: guard a new test with SYMLINKS prerequisiteLibravatar Johannes Sixt1-1/+1
Signed-off-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11config: support values longer than 1023 bytesLibravatar Erik Faye-Lund2-11/+9
parse_value in config.c has a static buffer of 1024 bytes that it parse the value into. This can sometimes be a problem when a config file contains very long values. It's particularly amusing that git-config already is able to write such files, so it should probably be able to read them as well. Fix this by using a strbuf instead of a fixed-size buffer. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11strbuf: make sure buffer is zero-terminatedLibravatar Erik Faye-Lund1-1/+3
strbuf_init does not zero-terminate the initial buffer when hint is non-zero. Fix this so we can rely on the string to be zero-terminated even if we haven't filled it with anything yet. Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11sparse: Fix an "symbol 'merge_file' not decared" warningLibravatar Ramsay Jones4-2/+10
In order to fix the warning, we add a new "merge-file.h" header containing the extern declaration of the merge_file() function, and include the header in the source files that require the declaration. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2011-04-11sparse: Fix an "symbol 'format_subject' not declared" warningLibravatar Ramsay Jones2-3/+2
In order to fix the warning, we add an extern declaration for this function to the "commit.h" header file, along with all other non- static functions defined in pretty.c. Also, we remove the function declaration from builtin/shortlog.c, since it is no longer needed. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>