Code

git.git
13 years agot3701: fix here document
Junio C Hamano [Thu, 5 May 2011 18:28:52 +0000 (11:28 -0700)]
t3701: fix here document

A broken here-document was not caught because end of file is taken by
an implicit end of the here document (POSIX does not seem to say it is
an error to lack the delimiter), and everything in the test just turned
into a single "cat into a file".

Noticed-by: Kacper Kornet <draenog@pld-linux.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-fast-import.txt: --relative-marks takes no parameter
Michael J Gruber [Thu, 5 May 2011 09:13:38 +0000 (11:13 +0200)]
git-fast-import.txt: --relative-marks takes no parameter

Remove spurious "=" after --relative-marks.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoshell: add missing initialization of argv0_path
Dima Sharov [Thu, 5 May 2011 06:40:17 +0000 (09:40 +0300)]
shell: add missing initialization of argv0_path

According to c6dfb39 (remote-curl: add missing initialization of
argv0_path, 2009-10-13), stand-alone programs (non-builtins)
must call git_extract_argv0_path(argv[0]) in order to help builds
that derive the installation prefix at runtime. Without this call,
the program segfaults (or raises an assertion failure).

Signed-off-by: Dima Sharov <git.avalakvista@gmail.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot/annotate-tests: Use echo & cat instead of sed
Brian Gernhardt [Thu, 5 May 2011 04:43:37 +0000 (00:43 -0400)]
t/annotate-tests: Use echo & cat instead of sed

The use of the sed command "1i No robots allowed" caused the version
of sed in OS X to die with

   sed: 1: "1i "No robots allowed"\n": command i expects \ followed by
   text

Since this command was just trying to add a single line to the
beginning of the file, do the same with "echo" followed by "cat".

Unbreaks t8001 and t8002 on OS X 10.6.7

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoUpdate draft release notes to 1.7.6
Junio C Hamano [Wed, 4 May 2011 23:02:17 +0000 (16:02 -0700)]
Update draft release notes to 1.7.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'ml/test-readme'
Junio C Hamano [Wed, 4 May 2011 22:52:00 +0000 (15:52 -0700)]
Merge branch 'ml/test-readme'

* ml/test-readme:
  t/README: unify documentation of test function args

13 years agoMerge branch 'ft/gitweb-tar-with-gzip-n'
Junio C Hamano [Wed, 4 May 2011 22:51:57 +0000 (15:51 -0700)]
Merge branch 'ft/gitweb-tar-with-gzip-n'

* ft/gitweb-tar-with-gzip-n:
  gitweb: supply '-n' to gzip for identical output

13 years agoMerge branch 'mg/rev-list-count-cherry'
Junio C Hamano [Wed, 4 May 2011 22:51:53 +0000 (15:51 -0700)]
Merge branch 'mg/rev-list-count-cherry'

* mg/rev-list-count-cherry:
  rev-list --count: separate count for --cherry-mark

13 years agoMerge branch 'ss/doc-svn'
Junio C Hamano [Wed, 4 May 2011 22:51:43 +0000 (15:51 -0700)]
Merge branch 'ss/doc-svn'

* ss/doc-svn:
  remove noise and inaccuracies from git-svn docs

13 years agoMerge branch 'jn/format-patch-doc'
Junio C Hamano [Wed, 4 May 2011 22:51:41 +0000 (15:51 -0700)]
Merge branch 'jn/format-patch-doc'

* jn/format-patch-doc:
  Documentation/format-patch: suggest Toggle Word Wrap add-on for Thunderbird
  Documentation: publicize hints for sending patches with GMail
  Documentation: publicize KMail hints for sending patches inline
  Documentation: hints for sending patches inline with Thunderbird
  Documentation: explain how to check for patch corruption

13 years agoMerge branch 'vr/merge-base-doc'
Junio C Hamano [Wed, 4 May 2011 22:51:37 +0000 (15:51 -0700)]
Merge branch 'vr/merge-base-doc'

* vr/merge-base-doc:
  Restructure documentation for git-merge-base.
  Documentation: update to git-merge-base --octopus

13 years agoMerge branch 'ss/cherry-pick-x-doc'
Junio C Hamano [Wed, 4 May 2011 22:51:35 +0000 (15:51 -0700)]
Merge branch 'ss/cherry-pick-x-doc'

* ss/cherry-pick-x-doc:
  doc: Clarify that "cherry-pick -x" does not use "git notes"

13 years agoMerge branch 'jn/maint-format-patch-doc'
Junio C Hamano [Wed, 4 May 2011 22:51:31 +0000 (15:51 -0700)]
Merge branch 'jn/maint-format-patch-doc'

* jn/maint-format-patch-doc:
  Documentation: describe the format of messages with inline patches

13 years agoMerge branch 'jk/format-patch-multiline-header'
Junio C Hamano [Wed, 4 May 2011 22:51:27 +0000 (15:51 -0700)]
Merge branch 'jk/format-patch-multiline-header'

* jk/format-patch-multiline-header:
  format-patch: wrap email addresses after long names

13 years agoMerge branch 'jm/mergetool-submodules'
Junio C Hamano [Wed, 4 May 2011 22:51:23 +0000 (15:51 -0700)]
Merge branch 'jm/mergetool-submodules'

* jm/mergetool-submodules:
  mergetool: Teach about submodules

13 years agoSync with 1.7.5.1
Junio C Hamano [Wed, 4 May 2011 22:49:04 +0000 (15:49 -0700)]
Sync with 1.7.5.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.7.5.1 v1.7.5.1
Junio C Hamano [Wed, 4 May 2011 22:47:40 +0000 (15:47 -0700)]
Git 1.7.5.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jh/dirstat' into maint
Junio C Hamano [Wed, 4 May 2011 21:59:07 +0000 (14:59 -0700)]
Merge branch 'jh/dirstat' into maint

* jh/dirstat:
  --dirstat: In case of renames, use target filename instead of source filename
  Teach --dirstat not to completely ignore rearranged lines within a file
  --dirstat-by-file: Make it faster and more correct
  --dirstat: Describe non-obvious differences relative to --stat or regular diff

13 years agoMerge branch 'sp/maint-clear-postfields' into maint
Junio C Hamano [Wed, 4 May 2011 21:58:56 +0000 (14:58 -0700)]
Merge branch 'sp/maint-clear-postfields' into maint

* sp/maint-clear-postfields:
  http: clear POSTFIELDS when initializing a slot

13 years agoMerge branch 'jk/maint-stash-oob' into maint
Junio C Hamano [Wed, 4 May 2011 21:58:42 +0000 (14:58 -0700)]
Merge branch 'jk/maint-stash-oob' into maint

* 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

13 years agoMerge branch 'jk/maint-upload-pack-shallow' into maint
Junio C Hamano [Wed, 4 May 2011 21:58:13 +0000 (14:58 -0700)]
Merge branch 'jk/maint-upload-pack-shallow' into maint

* jk/maint-upload-pack-shallow:
  upload-pack: start pack-objects before async rev-list

13 years agoMerge branch 'dm/stash-k-i-p' into maint
Junio C Hamano [Wed, 4 May 2011 21:57:49 +0000 (14:57 -0700)]
Merge branch 'dm/stash-k-i-p' into maint

* 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

13 years agoMerge branch 'jc/pack-objects-bigfile' into maint
Junio C Hamano [Wed, 4 May 2011 21:57:38 +0000 (14:57 -0700)]
Merge branch 'jc/pack-objects-bigfile' into maint

* jc/pack-objects-bigfile:
  Teach core.bigfilethreashold to pack-objects

13 years agoMerge branch 'mg/reflog-with-options' into maint
Junio C Hamano [Wed, 4 May 2011 21:57:33 +0000 (14:57 -0700)]
Merge branch 'mg/reflog-with-options' into maint

* 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()

13 years agoMerge branch 'jk/stash-loosen-safety' into maint
Junio C Hamano [Wed, 4 May 2011 21:57:15 +0000 (14:57 -0700)]
Merge branch 'jk/stash-loosen-safety' into maint

* jk/stash-loosen-safety:
  stash: drop dirty worktree check on apply

13 years agoMerge branch 'ar/clean-rmdir-empty' into maint
Junio C Hamano [Wed, 4 May 2011 21:57:06 +0000 (14:57 -0700)]
Merge branch 'ar/clean-rmdir-empty' into maint

* ar/clean-rmdir-empty:
  clean: unreadable directory may still be rmdir-able if it is empty

13 years agoMerge branch 'mg/sha1-path-advise' into maint
Junio C Hamano [Wed, 4 May 2011 21:56:51 +0000 (14:56 -0700)]
Merge branch 'mg/sha1-path-advise' into maint

* mg/sha1-path-advise:
  sha1_name: Suggest commit:./file for path in subdir
  t1506: factor out test for "Did you mean..."

13 years agogit-add.txt: document 'add.ignoreErrors'
Valentin Haenel [Wed, 4 May 2011 19:58:17 +0000 (21:58 +0200)]
git-add.txt: document 'add.ignoreErrors'

Signed-off-by: Valentin Haenel <valentin.haenel@gmx.de>
Noticed-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot5541-http-push: add test for chunked
Tay Ray Chuan [Wed, 4 May 2011 17:19:50 +0000 (01:19 +0800)]
t5541-http-push: add test for chunked

Trigger the chunked type of pushing for smart HTTP. This can serve as a
regression test for the issue fixed in 1e41827 (http: clear POSTFIELDS
when initializing a slot).

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohttp-push: refactor curl_easy_setup madness
Dan McGee [Tue, 3 May 2011 15:47:29 +0000 (23:47 +0800)]
http-push: refactor curl_easy_setup madness

We were doing (nearly) the same thing all over the place, in slightly
different orders, different variable names, etc. Refactor most calls
into two helper functions, one for GET and one for everything else, that
do the heavy lifting leaving most callsites a lot cleaner in the
process.

Note that the setting of CURLOPT_PUT at the callsites of
curl_setup_http() which previously didn't do it (eg.
locking_available(), remote_ls()) is safe, since that
option is deprecated in libcurl in place of, and has the same effect as,
CURLOPT_UPLOAD.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohttp-push: use const for strings in signatures
Dan McGee [Tue, 3 May 2011 15:47:28 +0000 (23:47 +0800)]
http-push: use const for strings in signatures

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohttp: make curl callbacks match contracts from curl header
Dan McGee [Tue, 3 May 2011 15:47:27 +0000 (23:47 +0800)]
http: make curl callbacks match contracts from curl header

Yes, these don't match perfectly with the void* first parameter of the
fread/fwrite in the standard library, but they do match the curl
expected method signature. This is needed when a refactor passes a
curl_write_callback around, which would otherwise give incorrect
parameter warnings.

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoUpdate draft release notes to 1.7.6
Junio C Hamano [Mon, 2 May 2011 23:10:50 +0000 (16:10 -0700)]
Update draft release notes to 1.7.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jk/notes-ui-updates'
Junio C Hamano [Mon, 2 May 2011 22:58:50 +0000 (15:58 -0700)]
Merge branch 'jk/notes-ui-updates'

* jk/notes-ui-updates:
  contrib/completion: --notes, --no-notes
  log/pretty-options: Document --[no-]notes and deprecate old notes options
  revision.c: make --no-notes reset --notes list
  revision.c: support --notes command-line option
  notes: refactor display notes default handling
  notes: refactor display notes extra refs field
  revision.c: refactor notes ref expansion
  notes: make expand_notes_ref globally accessible

13 years agoMerge branch 'ab/i18n-fixup'
Junio C Hamano [Mon, 2 May 2011 22:58:40 +0000 (15:58 -0700)]
Merge branch 'ab/i18n-fixup'

* ab/i18n-fixup: (24 commits)
  i18n: use test_i18n{cmp,grep} in t7600, t7607, t7611 and t7811
  i18n: use test_i18n{grep,cmp} in t7508
  i18n: use test_i18ngrep in t7506
  i18n: use test_i18ngrep and test_i18ncmp in t7502
  i18n: use test_i18ngrep in t7501
  i18n: use test_i18ncmp in t7500
  i18n: use test_i18ngrep in t7201
  i18n: use test_i18ncmp and test_i18ngrep in t7102 and t7110
  i18n: use test_i18ncmp and test_i18ngrep in t5541, t6040, t6120, t7004, t7012 and t7060
  i18n: use test_i18ncmp and test_i18ngrep in t3700, t4001 and t4014
  i18n: use test_i18ncmp and test_i18ngrep in t3203, t3501 and t3507
  i18n: use test_i18ngrep in t2020, t2204, t3030, and t3200
  i18n: use test_i18ngrep in lib-httpd and t2019
  i18n: do not overuse C_LOCALE_OUTPUT (grep)
  i18n: use test_i18ncmp in t1200 and t2200
  i18n: .git file is not a human readable message (t5601)
  i18n: do not overuse C_LOCALE_OUTPUT
  i18n: mark init-db messages for translation
  i18n: mark checkout plural warning for translation
  i18n: mark checkout --detach messages for translation
  ...

13 years agoMerge branch 'nm/submodule-update-force'
Junio C Hamano [Mon, 2 May 2011 22:58:36 +0000 (15:58 -0700)]
Merge branch 'nm/submodule-update-force'

* nm/submodule-update-force:
  submodule: Add --force option for git submodule update

Conflicts:
t/t7406-submodule-update.sh

13 years agoMerge branch 'jh/notes-add-ui'
Junio C Hamano [Mon, 2 May 2011 22:58:32 +0000 (15:58 -0700)]
Merge branch 'jh/notes-add-ui'

* jh/notes-add-ui:
  Make "git notes add" more user-friendly when there are existing notes

Conflicts:
builtin/notes.c

13 years agoMerge branch 'nd/maint-setup'
Junio C Hamano [Mon, 2 May 2011 22:58:30 +0000 (15:58 -0700)]
Merge branch 'nd/maint-setup'

* nd/maint-setup:
  Kill off get_relative_cwd()
  setup: return correct prefix if worktree is '/'

Conflicts:
dir.c
setup.c

13 years agoMerge branch 'mz/maint-rename-unmerged'
Junio C Hamano [Mon, 2 May 2011 22:58:27 +0000 (15:58 -0700)]
Merge branch 'mz/maint-rename-unmerged'

* mz/maint-rename-unmerged:
  diffcore-rename: don't consider unmerged path as source

13 years agoDocumentation: clarify meaning of --html-path, --man-path, and --info-path
Jonathan Nieder [Mon, 2 May 2011 06:07:45 +0000 (01:07 -0500)]
Documentation: clarify meaning of --html-path, --man-path, and --info-path

These options tell UI programs where git put its documentation, so
"Help" actions can show the documentation for *this* version of git
without regard to how MANPATH and INFOPATH are set up.  Details:

. Each variable tells where documentation is expected to be.  They do
  not indicate whether documentation was actually installed.

. The output of "git --html-path" is an absolute path and can be used
  in "file://$(git --html-path)/git-add.html" to name the HTML file
  documenting a particular command.

. --man-path names a manual page hierarchy (e.g.,
  /home/user/share/man).  Its output can be passed to "man -M" or put
  at the beginning of $MANPATH.

. --info-path names a directory with info files (e.g.,
  /home/user/share/info).  Its output is suitable as an argument to
  "info -d" or for inclusion in $INFOPATH.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit: add --info-path and --man-path options
Jon Seymour [Sun, 1 May 2011 08:16:25 +0000 (18:16 +1000)]
git: add --info-path and --man-path options

Similar to the way the --html-path option lets UI programs learn where git
has its HTML documentation pages, expose the other two paths used to store
the documentation pages of these two types.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoUpdate draft release notes to 1.7.6
Junio C Hamano [Sun, 1 May 2011 23:29:43 +0000 (16:29 -0700)]
Update draft release notes to 1.7.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'rs/strbuf-setlen-assert'
Junio C Hamano [Sun, 1 May 2011 23:25:04 +0000 (16:25 -0700)]
Merge branch 'rs/strbuf-setlen-assert'

* rs/strbuf-setlen-assert:
  strbuf: clarify assertion in strbuf_setlen()

13 years agoMerge branch 'vh/git-svn-doc'
Junio C Hamano [Sun, 1 May 2011 23:25:01 +0000 (16:25 -0700)]
Merge branch 'vh/git-svn-doc'

* vh/git-svn-doc:
  git-svn.txt: small typeface improvements
  git-svn.txt: move option descriptions
  git-svn.txt: fix usage of --add-author-from

13 years agoPass empty file to p4merge where no base is suitable.
Ciaran Jessup [Sun, 1 May 2011 22:16:02 +0000 (23:16 +0100)]
Pass empty file to p4merge where no base is suitable.

Modify the p4merge client command to pass a reference to an empty file
instead of the local file when no base revision available.

In the situation where a merge tries to add a file from one branch
into a branch that already contains that file (by name), p4merge
currently seems to have successfully automatically resolved the
'conflict' when it is opened (correctly if the files differed by
just whitespace for example) but leaves the save button disabled. This
means the user of the p4merge client cannot commit the resolved
changes back to disk and merely exits, leaving the original
(merge-conflicted) file intact on the disk.

Provide an empty base file to p4merge so that it leaves the save
button enabled.  This will allow saving of the auto-resolution to
disk.

Signed-off-by: Ciaran Jessup <ciaranj@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoLook for password in both CVS and CVSNT password files.
Guy Rouillier [Sun, 1 May 2011 05:33:52 +0000 (01:33 -0400)]
Look for password in both CVS and CVSNT password files.

In conn, if password is not passed on command line, look for a password
entry in both the CVS password file and the CVSNT password file.  If only
one file is found and the requested repository is in that file, or if both
files are found but the requested repository is found in only one file, use
the password from the single file containing the repository entry.  If both
files are found and the requested repository is found in both files, then
produce an error message.

The CVS password file separates tokens with a space character, while
the CVSNT password file separates tokens with an equal (=) character.
Add a sub find_password_entry that accepts the password file name
and a delimiter to eliminate code duplication.

Signed-off-by: Guy Rouillier <guyr@burntmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomerge-one-file: fix broken merges with alternate work trees
Jeff King [Fri, 29 Apr 2011 22:24:32 +0000 (18:24 -0400)]
merge-one-file: fix broken merges with alternate work trees

The merge-one-file tool predates the invention of
GIT_WORK_TREE. By the time GIT_WORK_TREE was invented, most
people were using the merge-recursive strategy, which
handles resolving internally. Therefore these features have
had very little testing together.

For the most part, merge-one-file just works with
GIT_WORK_TREE; most of its heavy lifting is done by plumbing
commands which do respect GIT_WORK_TREE properly. The one
exception is a shell redirection which touches the worktree
directly, writing results to the wrong place in the presence
of a GIT_WORK_TREE variable.

This means that merges won't even fail; they will silently
produce incorrect results, throwing out the entire "theirs"
side of files which need content-level merging!

This patch makes merge-one-file chdir to the toplevel of the
working tree (and exit if we don't have one). This most
closely matches the assumption made by the original script
(before separate work trees were invented), and matches what
happens when the script is called as part of a merge
strategy.

While we're at it, we'll also error-check the call to cat.
Merging a file in a subdirectory could in fact fail, as the
redirection relies on the "checkout-index" call just prior
to create leading directories. But we never noticed, since
we ignored the error return from running cat.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd tests for merge-index / merge-one-file
Jeff King [Fri, 29 Apr 2011 22:23:54 +0000 (18:23 -0400)]
add tests for merge-index / merge-one-file

There were no tests for either, except a brief use in
t1200-tutorial.

These tools are not used much these days, as most people
use the merge-recursive strategy, which handles everything
internally. However, they are used by the "octopus" and
"resolve" strategies, as well as any custom strategies
or merge scripts people have built around them.

For example, together with read-tree, they are the simplest
way to do a basic content-level merge without checking out
the entire repository contents beforehand.

This script adds a basic test of the tools to perform one
content-level merge. It also shows a failure of the tools to
work properly in the face of GIT_WORK_TREE or core.worktree.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years ago"add -p": work-around an old laziness that does not coalesce hunks
Junio C Hamano [Wed, 6 Apr 2011 21:20:57 +0000 (14:20 -0700)]
"add -p": work-around an old laziness that does not coalesce hunks

Since 0beee4c (git-add--interactive: remove hunk coalescing, 2008-07-02),
"git add--interactive" behaves lazily and passes overlapping hunks to the
underlying "git apply" without coalescing.  This was partially corrected
by 7a26e65 (its partial revert, 2009-05-16), but overlapping hunks are
still passed when the patch is edited.

Teach "git apply" the --allow-overlap option that disables a safety
feature that avoids misapplication of patches by not applying patches
to overlapping hunks, and pass this option form "add -p" codepath.

Do not even advertise the option, as this is merely a workaround, and the
correct fix is to make "add -p" correctly coalesce adjacent patch hunks.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd--interactive.perl: factor out repeated --recount option
Junio C Hamano [Wed, 6 Apr 2011 21:12:34 +0000 (14:12 -0700)]
add--interactive.perl: factor out repeated --recount option

Depending on the direction and the target of patch application, we would
need to pass --cached and --reverse to underlying "git apply".  Also we
only pass --check when we are not applying but just checking.

But we always pass --recount since 8cbd431 (git-add--interactive: replace
hunk recounting with apply --recount, 2008-07-02).  Instead of repeating
the same --recount over and over again, move it to a single place that
actually runs the command, namely, "run_git_apply" subroutine.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3701: Editing a split hunk in an "add -p" session
Junio C Hamano [Fri, 29 Apr 2011 19:41:16 +0000 (12:41 -0700)]
t3701: Editing a split hunk in an "add -p" session

Arnaud Lacombe reported that with the recent change to reject overlapping
hunks fed to "git apply", the edit mode of an "add -p" session that lazily
feeds overlapping hunks without coalescing adjacent ones claim that the
patch does not apply.  Expose the problem to be fixed.

Cf. http://thread.gmane.org/gmane.comp.version-control.git/170685/focus=171000

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd -p: 'q' should really quit
Junio C Hamano [Fri, 29 Apr 2011 22:12:32 +0000 (15:12 -0700)]
add -p: 'q' should really quit

The "quit" command was added in 9a7a1e0 (git add -p: new "quit" command at
the prompt, 2009-04-10) to allow the user to say that hunks other than
what have already been chosen are undesirable, and exit the interactive
loop immediately.  It forgot that there may be an undecided hunk before
the current one.  In such a case, the interactive loop still goes back to
the beginning.

Clear all the USE bit for undecided hunks and exit the loop.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogitweb: Mark matched 'ctag' / contents tag (?by_tag=foo)
Jakub Narebski [Fri, 29 Apr 2011 17:51:58 +0000 (19:51 +0200)]
gitweb: Mark matched 'ctag' / contents tag (?by_tag=foo)

It might have been hard to discover that current view is limited to
projects with given content tag (ctag), as it was distinquished only
in gitweb URL.  Mark matched contents tag in the tag cloud using
"match" class, for easier discovery.

This commit introduces a bit of further code duplication in
git_populate_project_tagcloud().

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogitweb: Change the way "content tags" ('ctags') are handled
Jakub Narebski [Fri, 29 Apr 2011 17:51:57 +0000 (19:51 +0200)]
gitweb: Change the way "content tags" ('ctags') are handled

The major change is removing the ability to edit content tags (ctags)
in a web browser.

The interface was created by gitweb, while actual editing of tags was
to be done by external script; the API was not defined, and neither
was provided example implementation.  Such split is also a bit fragile
- interface and implementation have to be kept in sync.  Gitweb
provided only ability to add tags; you could not edit tags nor delete
them.

Format of ctags is now described in the comment above git_get_project_ctags
subroutine.  Gitweb now is more robust with respect to original ctags
format; it also accepts two new formats: $GIT_DIR/ctags file, with one
content tag per line, and multi-value `gitweb.ctag' config variable.

Gathering all ctags of all project is now put in git_gather_all_ctags
subroutine, making git_project_list_body more clear.

git_populate_project_tagcloud subroutine now generates data used for
tag cloud, including generation of ctag link, also in the case
HTML::TagCloud module is unavailable.  Links are now generated using
href() subroutine - this is more robust, as ctags might contain '?',
';' and '=' special characters that need to be escaped in query param.
Shown tags are HTML-escaped.

The generation of tag cloud in git_show_project_tagcloud in the case
when HTML::TagCloud is not available is now changed slightly.

The 'content tags' field on project summary page is made more in line
with other fields in "projects_list" table.  Because one cannot now
add new tags from web interface, this field is no longer displayed
when there are no content tags for given project.

Ctags-issue-Reported-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Ctags-issue-Reported-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogitweb: Restructure projects list generation
Jakub Narebski [Fri, 29 Apr 2011 17:51:56 +0000 (19:51 +0200)]
gitweb: Restructure projects list generation

Extract filtering out forks (which is done if 'forks' feature is
enabled) into filter_forks_from_projects_list subroutine, and
searching projects (via projects search form, or via content tags)
into search_projects_list subroutine.

Both are now run _before_ displaying projects, and not while printing;
this allow to know upfront if there were any found projects.  Gitweb
now can and do print 'No such projects found' if user searches for
phrase which does not correspond to any project (any repository).
This also would allow splitting projects list into pages, if we so
desire.

Filtering out forks and marking repository (project) as having forks
is now consolidated into one subroutine (special case of handling
forks in git_get_projects_list only for $projects_list being file is
now removed).  Forks handling is also cleaned up and simplified.
$pr->{'forks'} now contains un-filled list of forks; we can now also
detect situation where the way for having forks is prepared, but there
are no forks yet.

Sorting projects got also refactored in a very straight way (just
moving code) into sort_projects_list subroutine.

The interaction between forks, content tags and searching is now made
more explicit: searching whether by tag, or via search form turns off
fork filtering (gitweb searches also forks, and will show all
results).  If 'ctags' feature is disabled, then searching by tag is
too.

The t9500 test now includes some basic test for 'forks' and 'ctags'
features; the t9502 includes test checking if gitweb correctly filters
out forks.

Generating list of projects by scanning given directory is now also a
bit simplified wrt. handling filtering; it is byproduct of extracting
filtering forks to separate subroutine.

While at it we now detect that there are no projects and respond with
"404 No projects found" also for 'project_index' and 'opml' actions.

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Fri, 29 Apr 2011 18:48:13 +0000 (11:48 -0700)]
Merge branch 'maint'

* maint:
  Start 1.7.5.1 maintenance track
  git-send-email: fix missing space in error message

Conflicts:
RelNotes

13 years agoStart 1.7.5.1 maintenance track
Junio C Hamano [Fri, 29 Apr 2011 18:47:10 +0000 (11:47 -0700)]
Start 1.7.5.1 maintenance track

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'mg/x-years-12-months' into maint
Junio C Hamano [Fri, 29 Apr 2011 18:43:18 +0000 (11:43 -0700)]
Merge branch 'mg/x-years-12-months' into maint

* mg/x-years-12-months:
  date: avoid "X years, 12 months" in relative dates

13 years agogit-send-email: fix missing space in error message
Sylvain Rabot [Fri, 29 Apr 2011 18:23:24 +0000 (20:23 +0200)]
git-send-email: fix missing space in error message

When the command cannot make a connection to the SMTP server the error
message to diagnose the broken configuration is issued.  However, when an
optional smtp-server-port is given and needs to be reported, the message
lacked a space between "hello=<smtp-domain>" and "port=<smtp-server-port>".

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMark dirstat error messages for translation
Johan Herland [Fri, 29 Apr 2011 09:36:23 +0000 (11:36 +0200)]
Mark dirstat error messages for translation

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoImprove error handling when parsing dirstat parameters
Johan Herland [Fri, 29 Apr 2011 09:36:22 +0000 (11:36 +0200)]
Improve error handling when parsing dirstat parameters

When encountering errors or unknown tokens while parsing parameters to the
--dirstat option, it makes sense to die() with an error message informing
the user of which parameter did not make sense. However, when parsing the
diff.dirstat config variable, we cannot simply die(), but should instead
(after warning the user) ignore the erroneous or unrecognized parameter.
After all, future Git versions might add more dirstat parameters, and
using two different Git versions on the same repo should not cripple the
older Git version just because of a parameter that is only understood by
a more recent Git version.

This patch fixes the issue by refactoring the dirstat parameter parsing
so that parse_dirstat_params() keeps on parsing parameters, even if an
earlier parameter was not recognized. When parsing has finished, it returns
zero if all parameters were successfully parsed, and non-zero if one or
more parameters were not recognized (with appropriate error messages
appended to the 'errmsg' argument).

The parse_dirstat_params() callers then decide (based on the return value
from parse_dirstat_params()) whether to warn and ignore (in case of
diff.dirstat), or to warn and die (in case of --dirstat).

The patch also adds a couple of tests verifying the correct behavior of
--dirstat and diff.dirstat in the face of unknown (possibly future) dirstat
parameters.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoNew --dirstat=lines mode, doing dirstat analysis based on diffstat
Johan Herland [Fri, 29 Apr 2011 09:36:21 +0000 (11:36 +0200)]
New --dirstat=lines mode, doing dirstat analysis based on diffstat

This patch adds an alternative implementation of show_dirstat(), called
show_dirstat_by_line(), which uses the more expensive diffstat analysis
(as opposed to show_dirstat()'s own (relatively inexpensive) analysis)
to derive the numbers from which the --dirstat output is computed.

The alternative implementation is controlled by the new "lines" parameter
to the --dirstat option (or the diff.dirstat config variable).

For binary files, the diffstat analysis counts bytes instead of lines,
so to prevent binary files from dominating the dirstat results, the
byte counts for binary files are divided by 64 before being compared to
their textual/line-based counterparts. This is a stupid and ugly - but
very cheap - heuristic.

In linux-2.6.git, running the three different --dirstat modes:

  time git diff v2.6.20..v2.6.30 --dirstat=changes > /dev/null
vs.
  time git diff v2.6.20..v2.6.30 --dirstat=lines > /dev/null
vs.
  time git diff v2.6.20..v2.6.30 --dirstat=files > /dev/null

yields the following average runtimes on my machine:

 - "changes" (default): ~6.0 s
 - "lines":             ~9.6 s
 - "files":             ~0.1 s

So, as expected, there's a considerable performance hit (~60%) by going
through the full diffstat analysis as compared to the default "changes"
analysis (obviously, "files" is much faster than both). As such, the
"lines" mode is probably only useful if you really need the --dirstat
numbers to be consistent with the numbers returned from the other
--*stat options.

The patch also includes documentation and tests for the new dirstat mode.

Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAllow specifying --dirstat cut-off percentage as a floating point number
Johan Herland [Fri, 29 Apr 2011 09:36:20 +0000 (11:36 +0200)]
Allow specifying --dirstat cut-off percentage as a floating point number

Only the first digit after the decimal point is kept, as the dirstat
calculations all happen in permille.

Selftests verifying floating-point percentage input has been added.

Improved-by: Junio C Hamano <gitster@pobox.com>
Improved-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAdd config variable for specifying default --dirstat behavior
Johan Herland [Fri, 29 Apr 2011 09:36:19 +0000 (11:36 +0200)]
Add config variable for specifying default --dirstat behavior

The new diff.dirstat config variable takes the same arguments as
'--dirstat=<args>', and specifies the default arguments for --dirstat.
The config is obviously overridden by --dirstat arguments passed on the
command line.

When not specified, the --dirstat defaults are 'changes,noncumulative,3'.

The patch also adds several tests verifying the interaction between the
diff.dirstat config variable, and the --dirstat command line option.

Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoRefactor --dirstat parsing; deprecate --cumulative and --dirstat-by-file
Johan Herland [Fri, 29 Apr 2011 09:36:18 +0000 (11:36 +0200)]
Refactor --dirstat parsing; deprecate --cumulative and --dirstat-by-file

Instead of having multiple interconnected dirstat-related options, teach
the --dirstat option itself to accept all behavior modifiers as parameters.

 - Preserve the current --dirstat=<limit> (where <limit> is an integer
   specifying a cut-off percentage)
 - Add --dirstat=cumulative, replacing --cumulative
 - Add --dirstat=files, replacing --dirstat-by-file
 - Also add --dirstat=changes and --dirstat=noncumulative for specifying the
   current default behavior. These allow the user to reset other --dirstat
   parameters (e.g. 'cumulative' and 'files') occuring earlier on the
   command line.

The deprecated options (--cumulative and --dirstat-by-file) are still
functional, although they have been removed from the documentation.

Allow multiple parameters to be separated by commas, e.g.:
  --dirstat=files,10,cumulative

Update the documentation accordingly, and add testcases verifying the
behavior of the new syntax.

Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMake --dirstat=0 output directories that contribute < 0.1% of changes
Johan Herland [Fri, 29 Apr 2011 09:36:17 +0000 (11:36 +0200)]
Make --dirstat=0 output directories that contribute < 0.1% of changes

The expected output from --dirstat=0, is to include any directory with
changes, even if those changes contribute a minuscule portion of the total
changes. However, currently, directories that contribute less than 0.1% are
not included, since their 'permille' value is 0, and there is an
'if (permille)' check in gather_dirstat() that causes them to be ignored.

This test is obviously intended to exclude directories that contribute no
changes whatsoever, but in this case, it hits too broadly. The correct
check is against 'this_dir' from which the permille is calculated. Only if
this value is 0 does the directory truly contribute no changes, and should
be skipped from the output.

This patches fixes this issue, and updates corresponding testcases to
expect the new behvaior.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAdd several testcases for --dirstat and friends
Johan Herland [Fri, 29 Apr 2011 09:36:16 +0000 (11:36 +0200)]
Add several testcases for --dirstat and friends

Currently, t4013 is the only selftest that exercises the --dirstat machinery,
but it only does a superficial verification of --dirstat's output.

This patch adds a new selftest - t4047-diff-dirstat.sh - which prepares a
commit containing:
 - unchanged files, changed files and files with rearranged lines
 - copied files, moved files, and unmoved files

It then verifies the correct dirstat output for that commit in the following
dirstat modes:
 - --dirstat
 - -X
 - --dirstat=0
 - -X0
 - --cumulative
 - --dirstat-by-file
 - (plus combinations of the above)

Each of the above tests are also run with:
 - no rename detection
 - rename detection (-M)
 - expensive copy detection (-C -C)

Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoblame: tolerate bogus e-mail addresses a bit better
Josh Stone [Thu, 21 Apr 2011 22:07:36 +0000 (15:07 -0700)]
blame: tolerate bogus e-mail addresses a bit better

The names and e-mails are sanitized by fmt_ident() when creating commits,
so that they do not contain "<" nor ">", and the "committer" and "author"
lines in the commit object will always be in the form:

    ("author" | "committer") name SP "<" email ">" SP timestamp SP zone

When parsing the email part out, the current code looks for SP starting
from the end of the email part, but the author could obfuscate the address
as "author at example dot com".

We should instead look for SP followed by "<", to match the logic of the
side that formats these lines.

Signed-off-by: Josh Stone <jistone@redhat.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot/test-lib.sh: minor readability improvements
Mathias Lafeldt [Fri, 29 Apr 2011 12:30:30 +0000 (14:30 +0200)]
t/test-lib.sh: minor readability improvements

Apply parameter expansion. Also use here document to save
test results instead of appending each line with ">>".

Signed-off-by: Mathias Lafeldt <misfire@debugon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodiffcore-rename.c: avoid set-but-not-used warning
Jim Meyering [Fri, 29 Apr 2011 09:42:41 +0000 (11:42 +0200)]
diffcore-rename.c: avoid set-but-not-used warning

Since 9d8a5a5 (diffcore-rename: refactor "too many candidates" logic,
2011-01-06), diffcore_rename() initializes num_src but does not use it
anymore.  "-Wunused-but-set-variable" in gcc-4.6 complains about this.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jc/diff-irreversible-delete'
Junio C Hamano [Thu, 28 Apr 2011 21:11:47 +0000 (14:11 -0700)]
Merge branch 'jc/diff-irreversible-delete'

* jc/diff-irreversible-delete:
  git diff -D: omit the preimage of deletes

13 years agoMerge branch 'jc/rename-degrade-cc-to-c'
Junio C Hamano [Thu, 28 Apr 2011 21:11:43 +0000 (14:11 -0700)]
Merge branch 'jc/rename-degrade-cc-to-c'

* jc/rename-degrade-cc-to-c:
  diffcore-rename: fall back to -C when -C -C busts the rename limit
  diffcore-rename: record filepair for rename src
  diffcore-rename: refactor "too many candidates" logic
  builtin/diff.c: remove duplicated call to diff_result_code()

13 years agoMerge branch 'mz/rebase'
Junio C Hamano [Thu, 28 Apr 2011 21:11:39 +0000 (14:11 -0700)]
Merge branch 'mz/rebase'

* mz/rebase: (34 commits)
  rebase: define options in OPTIONS_SPEC
  Makefile: do not install sourced rebase scripts
  rebase: use @{upstream} if no upstream specified
  rebase -i: remove unnecessary state rebase-root
  rebase -i: don't read unused variable preserve_merges
  git-rebase--am: remove unnecessary --3way option
  rebase -m: don't print exit code 2 when merge fails
  rebase -m: remember allow_rerere_autoupdate option
  rebase: remember strategy and strategy options
  rebase: remember verbose option
  rebase: extract code for writing basic state
  rebase: factor out sub command handling
  rebase: make -v a tiny bit more verbose
  rebase -i: align variable names
  rebase: show consistent conflict resolution hint
  rebase: extract am code to new source file
  rebase: extract merge code to new source file
  rebase: remove $branch as synonym for $orig_head
  rebase -i: support --stat
  rebase: factor out call to pre-rebase hook
  ...

13 years agoMerge branch 'en/merge-recursive'
Junio C Hamano [Thu, 28 Apr 2011 21:11:35 +0000 (14:11 -0700)]
Merge branch 'en/merge-recursive'

* en/merge-recursive:
  merge-recursive: tweak magic band-aid
  merge-recursive: When we detect we can skip an update, actually skip it
  t6022: New test checking for unnecessary updates of files in D/F conflicts
  t6022: New test checking for unnecessary updates of renamed+modified files

13 years agoMerge branch 'jh/dirstat'
Junio C Hamano [Thu, 28 Apr 2011 21:11:19 +0000 (14:11 -0700)]
Merge branch 'jh/dirstat'

* jh/dirstat:
  --dirstat: In case of renames, use target filename instead of source filename
  Teach --dirstat not to completely ignore rearranged lines within a file
  --dirstat-by-file: Make it faster and more correct
  --dirstat: Describe non-obvious differences relative to --stat or regular diff

13 years agoMerge branch 'sp/maint-clear-postfields'
Junio C Hamano [Thu, 28 Apr 2011 21:10:51 +0000 (14:10 -0700)]
Merge branch 'sp/maint-clear-postfields'

* sp/maint-clear-postfields:
  http: clear POSTFIELDS when initializing a slot

13 years agohashcmp(): inline memcmp() by hand to optimize
Ingo Molnar [Thu, 28 Apr 2011 10:19:02 +0000 (12:19 +0200)]
hashcmp(): inline memcmp() by hand to optimize

This is reported to speed "git gc" by 18%.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-rebase--interactive.sh: preserve-merges fails on merges created with no-ff
Andrew Wong [Thu, 28 Apr 2011 04:35:55 +0000 (00:35 -0400)]
git-rebase--interactive.sh: preserve-merges fails on merges created with no-ff

'git rebase' uses 'git merge' to preserve merges (-p).  This preserves
the original merge commit correctly, except when the original merge
commit was created by 'git merge --no-ff'.  In this case, 'git rebase'
will fail to preserve the merge, because during 'git rebase', 'git
merge' will simply fast-forward and skip the commit.  For example:

               B
              / \
             A---M
            /
    ---o---O---P---Q

If we try to rebase M onto P, we lose the merge commit and this happens:

                 A---B
                /
    ---o---O---P---Q

To correct this, we simply do a "no fast-forward" on all merge commits
when rebasing.  Since by the time we decided to do a 'git merge' inside
'git rebase', it means there was a merge originally, so 'git merge'
should always create a merge commit regardless of what the merge
branches look like. This way, when rebase M onto P from the above
example, we get:

                   B
                  / \
                 A---M
                /
    ---o---O---P---Q

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocompletion: remove unnecessary _get_comp_words_by_ref() invocations
SZEDER Gábor [Thu, 28 Apr 2011 16:01:52 +0000 (18:01 +0200)]
completion: remove unnecessary _get_comp_words_by_ref() invocations

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>
13 years agocompletion: don't modify the $cur variable in completion functions
SZEDER Gábor [Thu, 28 Apr 2011 16:01:51 +0000 (18:01 +0200)]
completion: don't modify the $cur variable in completion functions

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>
13 years agoStart 1.7.6 cycle
Junio C Hamano [Wed, 27 Apr 2011 19:09:04 +0000 (12:09 -0700)]
Start 1.7.6 cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'mg/x-years-12-months'
Junio C Hamano [Wed, 27 Apr 2011 18:36:43 +0000 (11:36 -0700)]
Merge branch 'mg/x-years-12-months'

* mg/x-years-12-months:
  date: avoid "X years, 12 months" in relative dates

13 years agoMerge branch 'cn/format-patch-quiet'
Junio C Hamano [Wed, 27 Apr 2011 18:36:43 +0000 (11:36 -0700)]
Merge branch 'cn/format-patch-quiet'

* cn/format-patch-quiet:
  format-patch: document --quiet option
  format-patch: don't pass on the --quiet flag

13 years agoMerge branch 'ef/maint-strbuf-init'
Junio C Hamano [Wed, 27 Apr 2011 18:36:43 +0000 (11:36 -0700)]
Merge branch 'ef/maint-strbuf-init'

* ef/maint-strbuf-init:
  config: support values longer than 1023 bytes
  strbuf: make sure buffer is zero-terminated

13 years agoMerge branch 'rr/doc-content-type'
Junio C Hamano [Wed, 27 Apr 2011 18:36:43 +0000 (11:36 -0700)]
Merge branch 'rr/doc-content-type'

* 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

13 years agoMerge branch 'jc/merge-dash-previous'
Junio C Hamano [Wed, 27 Apr 2011 18:36:42 +0000 (11:36 -0700)]
Merge branch 'jc/merge-dash-previous'

* jc/merge-dash-previous:
  merge: allow "-" as a short-hand for "previous branch"

13 years agoMerge branch 'dm/stash-k-i-p'
Junio C Hamano [Wed, 27 Apr 2011 18:36:42 +0000 (11:36 -0700)]
Merge branch 'dm/stash-k-i-p'

* 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

13 years agoMerge branch 'rj/sparse'
Junio C Hamano [Wed, 27 Apr 2011 18:36:42 +0000 (11:36 -0700)]
Merge branch 'rj/sparse'

* 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

13 years agoMerge branch 'jk/maint-upload-pack-shallow'
Junio C Hamano [Wed, 27 Apr 2011 18:36:42 +0000 (11:36 -0700)]
Merge branch 'jk/maint-upload-pack-shallow'

* jk/maint-upload-pack-shallow:
  upload-pack: start pack-objects before async rev-list

13 years agoMerge branch 'nk/blame-abbrev'
Junio C Hamano [Wed, 27 Apr 2011 18:36:42 +0000 (11:36 -0700)]
Merge branch 'nk/blame-abbrev'

* nk/blame-abbrev:
  blame: add --abbrev command line option and make it honor core.abbrev

13 years agoMerge branch 'jk/maint-stash-oob'
Junio C Hamano [Wed, 27 Apr 2011 18:36:42 +0000 (11:36 -0700)]
Merge branch 'jk/maint-stash-oob'

* 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

13 years agoMerge branch 'jc/pack-objects-bigfile'
Junio C Hamano [Wed, 27 Apr 2011 18:36:41 +0000 (11:36 -0700)]
Merge branch 'jc/pack-objects-bigfile'

* jc/pack-objects-bigfile:
  Teach core.bigfilethreashold to pack-objects

13 years agoMerge branch 'dm/color-palette'
Junio C Hamano [Wed, 27 Apr 2011 18:36:41 +0000 (11:36 -0700)]
Merge branch 'dm/color-palette'

* dm/color-palette:
  Share color list between graph and show-branch

13 years agoMerge branch 'mh/git-svn-automkdirs'
Junio C Hamano [Wed, 27 Apr 2011 18:36:41 +0000 (11:36 -0700)]
Merge branch 'mh/git-svn-automkdirs'

* mh/git-svn-automkdirs:
  git-svn: add an option to skip the creation of empty directories

13 years agoMerge branch 'jk/stash-loosen-safety'
Junio C Hamano [Wed, 27 Apr 2011 18:36:41 +0000 (11:36 -0700)]
Merge branch 'jk/stash-loosen-safety'

* jk/stash-loosen-safety:
  stash: drop dirty worktree check on apply

13 years agoMerge branch 'mg/reflog-with-options'
Junio C Hamano [Wed, 27 Apr 2011 18:36:41 +0000 (11:36 -0700)]
Merge branch 'mg/reflog-with-options'

* 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()

13 years agoMerge branch 'ar/clean-rmdir-empty'
Junio C Hamano [Wed, 27 Apr 2011 18:36:41 +0000 (11:36 -0700)]
Merge branch 'ar/clean-rmdir-empty'

* ar/clean-rmdir-empty:
  clean: unreadable directory may still be rmdir-able if it is empty

13 years agoMerge branch 'mg/sha1-path-advise'
Junio C Hamano [Wed, 27 Apr 2011 18:36:40 +0000 (11:36 -0700)]
Merge branch 'mg/sha1-path-advise'

* mg/sha1-path-advise:
  sha1_name: Suggest commit:./file for path in subdir
  t1506: factor out test for "Did you mean..."

13 years agoconfig.txt,diff-options.txt: porcelain vs. plumbing for color.diff
Michael J Gruber [Wed, 27 Apr 2011 07:38:27 +0000 (09:38 +0200)]
config.txt,diff-options.txt: porcelain vs. plumbing for color.diff

Reading the diff-family and config man pages one may think that the
color.diff and color.ui settings apply to all diff commands. Make it
clearer that they do not apply to the plumbing variants
diff-{files,index,tree}.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agostrbuf: clarify assertion in strbuf_setlen()
René Scharfe [Wed, 27 Apr 2011 17:24:50 +0000 (19:24 +0200)]
strbuf: clarify assertion in strbuf_setlen()

Commit a8f3e2219 introduced the strbuf_grow() call to strbuf_setlen() to
make ensure that there was at least one byte available to write the
mandatory trailing NUL, even for previously unallocated strbufs.

Then b315c5c0 added strbuf_slopbuf for the same reason, only globally for
all uses of strbufs.

Thus the strbuf_grow() call can be removed now.  This avoids readers of
strbuf.h from mistakenly thinking that strbuf_setlen() can be used to
extend a strbuf.

The following assert() needs to be changed to cope with the fact that
sb->alloc can now be zero, which is OK as long as len is also zero.  As
suggested by Junio, use the chance to convert it to a die() with a short
explanatory message.  The pattern of 'die("BUG: ...")' is already used in
strbuf.c.

This was the only assert() in strbuf.[ch], so assert.h doesn't have to be
included anymore either.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>