git
15 years agoMerge branch 'rs/optim-text-wrap' into next
Junio C Hamano [Sun, 21 Feb 2010 21:43:59 +0000 (13:43 -0800)] 
Merge branch 'rs/optim-text-wrap' into next

* rs/optim-text-wrap:
  utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()
  utf8.c: remove strbuf_write()
  utf8.c: remove print_spaces()
  utf8.c: remove print_wrapped_text()

15 years agoMerge branch 'master' into next
Junio C Hamano [Sun, 21 Feb 2010 21:25:06 +0000 (13:25 -0800)] 
Merge branch 'master' into next

* master:

15 years agoMerge branch 'jc/for-each-ref' into next
Junio C Hamano [Sun, 21 Feb 2010 21:20:49 +0000 (13:20 -0800)] 
Merge branch 'jc/for-each-ref' into next

* jc/for-each-ref:
  for-each-ref --format='%(flag)'
  for-each-ref --format='%(symref) %(symref:short)'
  builtin-for-each-ref.c: check if we need to peel onion while parsing the format
  builtin-for-each-ref.c: comment fixes

15 years agoMerge branch 'jn/gitweb-config-error-die' into next
Junio C Hamano [Sun, 21 Feb 2010 21:20:49 +0000 (13:20 -0800)] 
Merge branch 'jn/gitweb-config-error-die' into next

* jn/gitweb-config-error-die:
  gitweb: Die if there are parsing errors in config file

15 years agoMerge branch 'jn/maint-fix-pager' into next
Junio C Hamano [Sun, 21 Feb 2010 21:20:49 +0000 (13:20 -0800)] 
Merge branch 'jn/maint-fix-pager' into next

* jn/maint-fix-pager:
  t7006-pager: if stdout is not a terminal, make a new one
  tests: Add tests for automatic use of pager
  am: Fix launching of pager
  git svn: Fix launching of pager
  git.1: Clarify the behavior of the --paginate option
  Make 'git var GIT_PAGER' always print the configured pager
  Fix 'git var' usage synopsis

15 years agoMerge branch 'jh/maint-submodule-status-in-void' into next
Junio C Hamano [Sun, 21 Feb 2010 21:20:48 +0000 (13:20 -0800)] 
Merge branch 'jh/maint-submodule-status-in-void' into next

* jh/maint-submodule-status-in-void:
  submodule summary: Don't barf when invoked in an empty repo

15 years agoMerge branch 'gf/maint-sh-setup-nongit-ok' into next
Junio C Hamano [Sun, 21 Feb 2010 21:20:48 +0000 (13:20 -0800)] 
Merge branch 'gf/maint-sh-setup-nongit-ok' into next

* gf/maint-sh-setup-nongit-ok:
  require_work_tree broken with NONGIT_OK

15 years agoMerge branch 'ml/send-pack-transport-refactor' into next
Junio C Hamano [Sun, 21 Feb 2010 21:20:48 +0000 (13:20 -0800)] 
Merge branch 'ml/send-pack-transport-refactor' into next

* ml/send-pack-transport-refactor:
  refactor duplicated code in builtin-send-pack.c and transport.c

15 years agoMerge branch 'jn/makedepend' into next
Junio C Hamano [Sun, 21 Feb 2010 21:20:47 +0000 (13:20 -0800)] 
Merge branch 'jn/makedepend' into next

* jn/makedepend:
  Makefile: always remove .depend directories on 'make clean'
  Makefile: tuck away generated makefile fragments in .depend
  Teach Makefile to check header dependencies
  Makefile: list standalone program object files in PROGRAM_OBJS
  Makefile: lazily compute header dependencies
  Makefile: list generated object files in OBJECTS
  Makefile: disable default implicit rules
  Makefile: rearrange dependency rules
  Makefile: transport.o depends on branch.h now
  Makefile: drop dependency on $(wildcard */*.h)
  Makefile: clean up http-walker.o dependency rules
  Makefile: remove wt-status.h from LIB_H
  Makefile: make sure test helpers are rebuilt when headers change
  Makefile: add missing header file dependencies

Conflicts:
Makefile

15 years agoMerge branch 'jh/notes' into next
Junio C Hamano [Sun, 21 Feb 2010 21:20:47 +0000 (13:20 -0800)] 
Merge branch 'jh/notes' into next

* jh/notes: (30 commits)
  builtin-notes: Add "copy" subcommand for copying notes between objects
  builtin-notes: Misc. refactoring of argc and exit value handling
  builtin-notes: Add -c/-C options for reusing notes
  builtin-notes: Refactor handling of -F option to allow combining -m and -F
  builtin-notes: Deprecate the -m/-F options for "git notes edit"
  builtin-notes: Add "append" subcommand for appending to note objects
  builtin-notes: Add "add" subcommand for adding notes to objects
  builtin-notes: Add --message/--file aliases for -m/-F options
  builtin-notes: Add "list" subcommand for listing note objects
  Documentation: Generalize git-notes docs to 'objects' instead of 'commits'
  builtin-notes: Add "prune" subcommand for removing notes for missing objects
  Notes API: prune_notes(): Prune notes that belong to non-existing objects
  t3305: Verify that removing notes triggers automatic fanout consolidation
  builtin-notes: Add "remove" subcommand for removing existing notes
  Teach builtin-notes to remove empty notes
  Teach notes code to properly preserve non-notes in the notes tree
  t3305: Verify that adding many notes with git-notes triggers increased fanout
  t3301: Verify successful annotation of non-commits
  Builtin-ify git-notes
  Refactor notes concatenation into a flexible interface for combining notes
  ...

Conflicts:
Makefile

15 years agoMerge branch 'ml/maint-grep-doc'
Junio C Hamano [Sun, 21 Feb 2010 20:01:06 +0000 (12:01 -0800)] 
Merge branch 'ml/maint-grep-doc'

* ml/maint-grep-doc:
  grep documentation: clarify what files match

15 years agoMerge branch 'tc/maint-transport-ls-remote-with-void'
Junio C Hamano [Sun, 21 Feb 2010 20:01:03 +0000 (12:01 -0800)] 
Merge branch 'tc/maint-transport-ls-remote-with-void'

* tc/maint-transport-ls-remote-with-void:
  transport: add got_remote_refs flag

15 years agoMerge branch 'hm/maint-imap-send-crlf'
Junio C Hamano [Sun, 21 Feb 2010 20:00:21 +0000 (12:00 -0800)] 
Merge branch 'hm/maint-imap-send-crlf'

* hm/maint-imap-send-crlf:
  git-imap-send: Convert LF to CRLF before storing patch to draft box

15 years agoMerge branch 'sp/push-sideband'
Junio C Hamano [Sun, 21 Feb 2010 20:00:07 +0000 (12:00 -0800)] 
Merge branch 'sp/push-sideband'

* sp/push-sideband:
  receive-pack: Send internal errors over side-band #2
  t5401: Use a bare repository for the remote peer
  receive-pack: Send hook output over side band #2
  receive-pack: Wrap status reports inside side-band-64k
  receive-pack: Refactor how capabilities are shown to the client
  send-pack: demultiplex a sideband stream with status data
  run-command: support custom fd-set in async
  run-command: Allow stderr to be a caller supplied pipe

15 years agoMerge branch 'jc/checkout-detached'
Junio C Hamano [Sun, 21 Feb 2010 19:59:42 +0000 (11:59 -0800)] 
Merge branch 'jc/checkout-detached'

* jc/checkout-detached:
  Reword "detached HEAD" notification

15 years agoMerge branch 'jc/maint-fix-test-perm'
Junio C Hamano [Sun, 21 Feb 2010 19:59:35 +0000 (11:59 -0800)] 
Merge branch 'jc/maint-fix-test-perm'

* jc/maint-fix-test-perm:
  lib-patch-mode.sh: Fix permission
  t6000lib: Fix permission

15 years agoMerge branch 'jn/makefile-script-lib'
Junio C Hamano [Sun, 21 Feb 2010 19:59:22 +0000 (11:59 -0800)] 
Merge branch 'jn/makefile-script-lib'

* jn/makefile-script-lib:
  Do not install shell libraries executable

15 years agoMerge branch 'mv/request-pull-modernize'
Junio C Hamano [Sun, 21 Feb 2010 19:59:17 +0000 (11:59 -0800)] 
Merge branch 'mv/request-pull-modernize'

* mv/request-pull-modernize:
  request-pull: avoid mentioning that the start point is a single commit

15 years agot7006-pager: if stdout is not a terminal, make a new one
Jonathan Nieder [Sat, 20 Feb 2010 08:50:25 +0000 (02:50 -0600)] 
t7006-pager: if stdout is not a terminal, make a new one

Testing pagination requires (fake or real) access to a terminal so we
can see whether the pagination automatically kicks in, which makes it
hard to get good coverage when running tests without --verbose.  There
are a number of ways to work around that:

 - Replace all isatty calls with calls to a custom xisatty wrapper
   that usually checks for a terminal but can be overridden for tests.
   This would be workable, but it would require implementing xisatty
   separately in three languages (C, shell, and perl) and making sure
   that any code that is to be tested always uses the wrapper.

 - Redirect stdout to /dev/tty.  This would be problematic because
   there might be no terminal available, and even if a terminal is
   available, it might not be appropriate to spew output to it.

 - Create a new pseudo-terminal on the fly and capture its output.

This patch implements the third approach.

The new test-terminal.perl helper uses IO::Pty from Expect.pm to create
a terminal and executes the program specified by its arguments with
that terminal as stdout.  If the IO::Pty module is missing or not
working on a system, the test script will maintain its old behavior
(skipping most of its tests unless GIT_TEST_OPTS includes --verbose).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'master' into next
Junio C Hamano [Sat, 20 Feb 2010 18:39:55 +0000 (10:39 -0800)] 
Merge branch 'master' into next

* master:
  git-p4: fix bug in symlink handling
  t1450: fix testcases that were wrongly expecting failure
  Documentation: Fix indentation problem in git-commit(1)

15 years agoMerge branch 'maint'
Junio C Hamano [Sat, 20 Feb 2010 18:38:42 +0000 (10:38 -0800)] 
Merge branch 'maint'

* maint:
  git-p4: fix bug in symlink handling
  t1450: fix testcases that were wrongly expecting failure
  Documentation: Fix indentation problem in git-commit(1)

15 years agotests: Add tests for automatic use of pager
Jonathan Nieder [Fri, 19 Feb 2010 07:18:58 +0000 (01:18 -0600)] 
tests: Add tests for automatic use of pager

Git’s automatic pagination support has some subtleties.  Add some
tests to make sure we don’t break:

 - when git will use a pager by default;
 - the effect of the --paginate and --no-pager options;
 - the effect of pagination on use of color;
 - how the choice of pager is configured.

This does not yet test:

 - use of pager by scripted commands (git svn and git am);
 - effect of the pager.* configuration variables;
 - setting of the LESS variable.

Some features involve checking whether stdout is a terminal, so many
of these tests are skipped unless output is passed through to the
terminal (i.e., unless $GIT_TEST_OPTS includes --verbose).

The immediate purpose for these tests was to avoid making things worse
after the breakage from my jn/editor-pager series (see commit 376f39,
2009-11-20).  Thanks to Sebastian Celis <sebastian@sebastiancelis.com>
for the report.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoutf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()
René Scharfe [Fri, 19 Feb 2010 22:20:44 +0000 (23:20 +0100)] 
utf8.c: speculatively assume utf-8 in strbuf_add_wrapped_text()

is_utf8() works by calling utf8_width() for each character at the
supplied location.  In strbuf_add_wrapped_text(), we do that anyway
while wrapping the lines.  So instead of checking the encoding
beforehand, optimistically assume that it's utf-8 and wrap along
until an invalid character is hit, and when that happens start over.

This pays off if the text consists only of valid utf-8 characters.
The following command was run against the Linux kernel repo with
git 1.7.0:

$ time git log --format='%b' v2.6.32 >/dev/null

real 0m2.679s
user 0m2.580s
sys 0m0.100s

$ time git log --format='%w(60,4,8)%b' >/dev/null

real 0m4.342s
user 0m4.230s
sys 0m0.110s

And with this patch series:

$ time git log --format='%w(60,4,8)%b' >/dev/null

real 0m3.741s
user 0m3.630s
sys 0m0.110s

So the cost of wrapping is reduced to 70% in this case.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoutf8.c: remove strbuf_write()
René Scharfe [Fri, 19 Feb 2010 22:16:45 +0000 (23:16 +0100)] 
utf8.c: remove strbuf_write()

The patch before the previous one made sure that all callers of
strbuf_add_wrapped_text() supply a strbuf.  Replace all calls of
strbuf_write() with regular strbuf functions and remove it.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoutf8.c: remove print_spaces()
René Scharfe [Fri, 19 Feb 2010 22:15:55 +0000 (23:15 +0100)] 
utf8.c: remove print_spaces()

The previous patch made sure that strbuf_add_wrapped_text() (and thus
strbuf_add_indented_text(), too) always get a strbuf.  Make use of
this fact by adding strbuf_addchars(), a small helper that adds a
char the specified number of times to a strbuf, and use it to replace
print_spaces().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoutf8.c: remove print_wrapped_text()
René Scharfe [Fri, 19 Feb 2010 22:15:01 +0000 (23:15 +0100)] 
utf8.c: remove print_wrapped_text()

strbuf_add_wrapped_text() is called only from print_wrapped_text()
without a strbuf (in which case it writes its results to stdout).

At its only callsite, supply a strbuf, call strbuf_add_wrapped_text()
directly and remove the wrapper function.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-p4: fix bug in symlink handling
Evan Powers [Tue, 16 Feb 2010 08:44:08 +0000 (00:44 -0800)] 
git-p4: fix bug in symlink handling

Fix inadvertent breakage from b932705 (git-p4: stream from perforce to
speed up clones, 2009-07-30) in the code that strips the trailing '\n'
from p4 print on a symlink. (In practice, contents is of the form
['target\n', ''].)

Signed-off-by: Evan Powers <evan.powers@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot1450: fix testcases that were wrongly expecting failure
Thomas Rast [Sat, 20 Feb 2010 00:18:44 +0000 (01:18 +0100)] 
t1450: fix testcases that were wrongly expecting failure

Almost exactly a year ago in 02a6552 (Test fsck a bit harder), I
introduced two testcases that were expecting failure.

However, the only bug was that the testcases wrote *blobs* because I
forgot to pass -t tag to hash-object.  Fix this, and then adjust the
rest of the test to properly check the result.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: Fix indentation problem in git-commit(1)
Jacob Helwig [Mon, 15 Feb 2010 12:33:06 +0000 (04:33 -0800)] 
Documentation: Fix indentation problem in git-commit(1)

Ever since the "See linkgit:git-config[1]..." paragraph was added to the
description for --untracked-files (d6293d1), the paragraphs for the
following options were indented at the same level as the "See
linkgit:git-config[1]" paragraph.  This problem showed up in the
manpages, but not in the HTML documentation.

While this does fix the alignment of the options following
--untracked-files in the manpage, the "See linkgit..." portion of the
description does not retain its previous indentation level in the
manpages, or HTML documentation.

Signed-off-by: Jacob Helwig <jacob.helwig@gmail.com>
Acked-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'master' into next
Junio C Hamano [Fri, 19 Feb 2010 09:32:05 +0000 (01:32 -0800)] 
Merge branch 'master' into next

* master:
  rm: fix bug in recursive subdirectory removal
  Documentation: describe --thin more accurately

15 years agoMerge branch 'maint'
Junio C Hamano [Fri, 19 Feb 2010 09:31:42 +0000 (01:31 -0800)] 
Merge branch 'maint'

* maint:
  rm: fix bug in recursive subdirectory removal
  Documentation: describe --thin more accurately

15 years agoMerge branch 'jk/maint-rmdir-fix' into maint
Junio C Hamano [Fri, 19 Feb 2010 09:31:37 +0000 (01:31 -0800)] 
Merge branch 'jk/maint-rmdir-fix' into maint

* jk/maint-rmdir-fix:
  rm: fix bug in recursive subdirectory removal

15 years agorm: fix bug in recursive subdirectory removal
Jeff King [Fri, 19 Feb 2010 05:57:21 +0000 (00:57 -0500)] 
rm: fix bug in recursive subdirectory removal

If we remove a path in a/deep/subdirectory, we should try to
remove as many trailing components as possible (i.e.,
subdirectory, then deep, then a). However, the test for the
return value of rmdir was reversed, so we only ever deleted
at most one level.

The fix is in remove_path, so "apply" and "merge-recursive"
also are fixed.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: describe --thin more accurately
Stephen Boyd [Thu, 18 Feb 2010 09:10:28 +0000 (01:10 -0800)] 
Documentation: describe --thin more accurately

The description for --thin was misleading and downright wrong. Correct
it with some inspiration from the description of index-pack's --fix-thin
and some background information from Nicolas Pitre <nico@fluxnic.net>.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'master' into next
Junio C Hamano [Thu, 18 Feb 2010 07:04:00 +0000 (23:04 -0800)] 
Merge branch 'master' into next

* master:
  docs: don't talk about $GIT_DIR/refs/ everywhere

15 years agoMerge branch 'maint'
Junio C Hamano [Thu, 18 Feb 2010 07:03:46 +0000 (23:03 -0800)] 
Merge branch 'maint'

* maint:
  docs: don't talk about $GIT_DIR/refs/ everywhere

15 years agodocs: don't talk about $GIT_DIR/refs/ everywhere
Jeff King [Thu, 18 Feb 2010 01:16:20 +0000 (20:16 -0500)] 
docs: don't talk about $GIT_DIR/refs/ everywhere

It is misleading to say that we pull refs from $GIT_DIR/refs/*, because we
may also consult the packed refs mechanism. These days we tend to treat
the "refs hierarchy" as more of an abstract namespace that happens to be
represented as $GIT_DIR/refs. At best, this is a minor inaccuracy, but at
worst it can confuse users who then look in $GIT_DIR/refs and find that it
is missing some of the refs they expected to see.

This patch drops most uses of "$GIT_DIR/refs/*", changing them into just
"refs/*", under the assumption that users can handle the concept of an
abstract refs namespace. There are a few things to note:

  - most cases just dropped the $GIT_DIR/ portion. But for cases where
    that left _just_ the word "refs", I changed it to "refs/" to help
    indicate that it was a hierarchy.  I didn't do the same for longer
    paths (e.g., "refs/heads" remained, instead of becoming
    "refs/heads/").

  - in some cases, no change was made, as the text was explicitly about
    unpacked refs (e.g., the discussion in git-pack-refs).

  - In some cases it made sense instead to note the existence of packed
    refs (e.g., in check-ref-format and rev-parse).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'master' into next
Junio C Hamano [Wed, 17 Feb 2010 23:33:27 +0000 (15:33 -0800)] 
Merge branch 'master' into next

* master:
  Update draft release notes to 1.7.1
  Update 1.7.0.1 release notes
  fast-import: use the diff_delta() max_delta_size argument
  fast-import: honor pack.indexversion and pack.packsizelimit config vars
  fast-import: make default pack size unlimited
  fast-import: use write_idx_file() instead of custom code
  fast-import: use sha1write() for pack data
  fast-import: start using struct pack_idx_entry

15 years agoMerge branch 'np/fast-import-idx-v2'
Junio C Hamano [Wed, 17 Feb 2010 23:28:25 +0000 (15:28 -0800)] 
Merge branch 'np/fast-import-idx-v2'

* np/fast-import-idx-v2:
  fast-import: use the diff_delta() max_delta_size argument
  fast-import: honor pack.indexversion and pack.packsizelimit config vars
  fast-import: make default pack size unlimited
  fast-import: use write_idx_file() instead of custom code
  fast-import: use sha1write() for pack data
  fast-import: start using struct pack_idx_entry

Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorefactor duplicated code in builtin-send-pack.c and transport.c
Michael Lukashov [Tue, 16 Feb 2010 23:42:52 +0000 (23:42 +0000)] 
refactor duplicated code in builtin-send-pack.c and transport.c

The following functions are (almost) identical:

  verify_remote_names
  update_tracking_ref
  refs_pushed
  print_push_status

Move common versions of these functions to transport.c and rename
them, as suggested by Jeff King and Junio C Hamano.

These functions have been removed entirely from builtin-send-pack.c,
since they are only used internally by print_push_status():

  print_ref_status
  status_abbrev
  print_ok_ref_status
  print_one_push_status

Also, move #define SUMMARY_WIDTH to transport.h and rename it
TRANSPORT_SUMMARY_WIDTH as it is used in builtin-fetch.c and
transport.c

Signed-off-by: Michael Lukashov <michael.lukashov@gmail.com>
Acked-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate draft release notes to 1.7.1
Junio C Hamano [Wed, 17 Feb 2010 23:01:11 +0000 (15:01 -0800)] 
Update draft release notes to 1.7.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 17 Feb 2010 23:00:10 +0000 (15:00 -0800)] 
Merge branch 'maint'

* maint:
  Update 1.7.0.1 release notes

15 years agoUpdate 1.7.0.1 release notes
Junio C Hamano [Wed, 17 Feb 2010 23:00:00 +0000 (15:00 -0800)] 
Update 1.7.0.1 release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jk/cherry-pick-reword' into maint
Junio C Hamano [Wed, 17 Feb 2010 22:55:24 +0000 (14:55 -0800)] 
Merge branch 'jk/cherry-pick-reword' into maint

* jk/cherry-pick-reword:
  cherry-pick: prettify the advice message
  cherry-pick: show commit name instead of sha1
  cherry-pick: format help message as strbuf
  cherry-pick: refactor commit parsing code
  cherry-pick: rewrap advice message

15 years agoMerge branch 'jk/grep-double-dash' into maint
Junio C Hamano [Wed, 17 Feb 2010 22:55:15 +0000 (14:55 -0800)] 
Merge branch 'jk/grep-double-dash' into maint

* jk/grep-double-dash:
  accept "git grep -- pattern"

15 years agoMerge branch 'jc/typo' into maint
Junio C Hamano [Wed, 17 Feb 2010 22:55:09 +0000 (14:55 -0800)] 
Merge branch 'jc/typo' into maint

* jc/typo:
  Typofixes outside documentation area

15 years agoMerge branch 'jc/grep-author-all-match-implicit' into next
Junio C Hamano [Wed, 17 Feb 2010 19:44:25 +0000 (11:44 -0800)] 
Merge branch 'jc/grep-author-all-match-implicit' into next

* jc/grep-author-all-match-implicit:
  "log --author=me --grep=it" should find intersection, not union

15 years agoMerge branch 'jc/checkout-detached' into next
Junio C Hamano [Wed, 17 Feb 2010 19:43:43 +0000 (11:43 -0800)] 
Merge branch 'jc/checkout-detached' into next

* jc/checkout-detached:
  Reword "detached HEAD" notification

15 years agoMerge branch 'ac/cvsimport-revision-mapping' into next
Junio C Hamano [Wed, 17 Feb 2010 19:42:03 +0000 (11:42 -0800)] 
Merge branch 'ac/cvsimport-revision-mapping' into next

* ac/cvsimport-revision-mapping:
  cvsimport: new -R option: generate .git/cvs-revisions mapping

15 years agoMerge branch 'pb/log-first-parent-p-m' into next
Junio C Hamano [Wed, 17 Feb 2010 19:41:38 +0000 (11:41 -0800)] 
Merge branch 'pb/log-first-parent-p-m' into next

* pb/log-first-parent-p-m:
  git log -p -m: document -m and honor --first-parent

15 years agoMerge branch 'hm/maint-imap-send-crlf' into next
Junio C Hamano [Wed, 17 Feb 2010 19:40:40 +0000 (11:40 -0800)] 
Merge branch 'hm/maint-imap-send-crlf' into next

* hm/maint-imap-send-crlf:
  git-imap-send: Convert LF to CRLF before storing patch to draft box

15 years agoMerge branch 'master' into next
Junio C Hamano [Wed, 17 Feb 2010 19:22:15 +0000 (11:22 -0800)] 
Merge branch 'master' into next

* master:
  gitweb: Protect escaping functions against calling on undef
  gitweb: esc_html (short) error message in die_error

15 years agogitweb: Protect escaping functions against calling on undef
Jakub Narebski [Sun, 7 Feb 2010 20:52:25 +0000 (21:52 +0100)] 
gitweb: Protect escaping functions against calling on undef

This is a bit of future-proofing esc_html and friends: when called
with undefined value they would now would return undef... which would
probably mean that error would still occur, but closer to the source
of problem.

This means that we can safely use
  esc_html(shift) || "Internal Server Error"
in die_error() instead of
  esc_html(shift || "Internal Server Error")

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb: esc_html (short) error message in die_error
Jakub Narebski [Sun, 7 Feb 2010 20:51:18 +0000 (21:51 +0100)] 
gitweb: esc_html (short) error message in die_error

The error message (second argument to die_error) is meant to be short,
one-line text description of given error.  A few callers call
die_error with error message containing unescaped user supplied data
($hash, $file_name).  Instead of forcing callers to escape data,
simply call esc_html on the parameter.

Note that optional third parameter, which contains detailed error
description, is meant to be HTML formatted, and therefore should be
not escaped.

While at it update esc_html synopsis/usage, and bring default error
description to read 'Internal Server Error' (titlecased).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosubmodule summary: Don't barf when invoked in an empty repo
Johan Herland [Tue, 16 Feb 2010 10:21:14 +0000 (11:21 +0100)] 
submodule summary: Don't barf when invoked in an empty repo

When invoking "git submodule summary" in an empty repo (which can be
indirectly done by setting status.submodulesummary = true), it currently
emits an error message (via "git diff-index") since HEAD points to an
unborn branch.

This patch adds handling of the HEAD-points-to-unborn-branch special case,
so that "git submodule summary" no longer emits this error message.

The patch also adds a test case that verifies the fix.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: use the diff_delta() max_delta_size argument
Nicolas Pitre [Wed, 17 Feb 2010 19:05:56 +0000 (14:05 -0500)] 
fast-import: use the diff_delta() max_delta_size argument

This let diff_delta() abort early if it is going to bust the given
size limit.  Also, only objects larger than 20 bytes are considered
as objects smaller than that are most certainly going to produce
larger deltas than the original object due to the additional headers.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: honor pack.indexversion and pack.packsizelimit config vars
Nicolas Pitre [Wed, 17 Feb 2010 19:05:55 +0000 (14:05 -0500)] 
fast-import: honor pack.indexversion and pack.packsizelimit config vars

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: make default pack size unlimited
Nicolas Pitre [Wed, 17 Feb 2010 19:05:54 +0000 (14:05 -0500)] 
fast-import: make default pack size unlimited

Now that fast-import is creating packs with index version 2, there is
no point limiting the pack size by default.  A pack split will still
happen if off_t is not sufficiently large to hold large offsets.

While updating the doc, let's remove the "packfiles fit on CDs"
suggestion.  Pack files created by fast-import are still suboptimal and
a 'git repack -a -f -d' or even 'git gc --aggressive' would be a pretty
good idea before considering storage on CDs.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: use write_idx_file() instead of custom code
Nicolas Pitre [Wed, 17 Feb 2010 19:05:53 +0000 (14:05 -0500)] 
fast-import: use write_idx_file() instead of custom code

This allows for the creation of pack index version 2 with its object
CRC and the possibility for a pack to be larger than 4 GB.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: use sha1write() for pack data
Nicolas Pitre [Wed, 17 Feb 2010 19:05:52 +0000 (14:05 -0500)] 
fast-import: use sha1write() for pack data

This is in preparation for using write_idx_file().  Also, by using
sha1write() we get some buffering to reduces the number of write
syscalls, and the written data is SHA1 summed which allows for the extra
data integrity validation check performed in fixup_pack_header_footer()
(details on this in commit abeb40e5aa).

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofast-import: start using struct pack_idx_entry
Nicolas Pitre [Wed, 17 Feb 2010 19:05:51 +0000 (14:05 -0500)] 
fast-import: start using struct pack_idx_entry

This is in preparation for using write_idx_file().

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agorequire_work_tree broken with NONGIT_OK
Gabriel Filion [Wed, 17 Feb 2010 04:18:50 +0000 (23:18 -0500)] 
require_work_tree broken with NONGIT_OK

With NONGIT_OK set, require_work_tree function outside a git repository
gives a syntax error.  This is caused by an incorrect use of "test" that
didn't anticipate $(git rev-parse --is-inside-work-tree) may return an
empty string.

Properly quote the argument to "test", and send the standard error stream
to /dev/null to avoid giving duplicate error messages.

Signed-off-by: Gabriel Filion <lelutin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'mv/request-pull-modernize' into jch
Junio C Hamano [Wed, 17 Feb 2010 07:03:40 +0000 (23:03 -0800)] 
Merge branch 'mv/request-pull-modernize' into jch

* mv/request-pull-modernize:
  request-pull: avoid mentioning that the start point is a single commit

15 years agoMerge branch 'jn/makefile-script-lib' into jch
Junio C Hamano [Wed, 17 Feb 2010 07:03:20 +0000 (23:03 -0800)] 
Merge branch 'jn/makefile-script-lib' into jch

* jn/makefile-script-lib:
  Do not install shell libraries executable

15 years agoMerge branch 'sp/push-sideband' into jch
Junio C Hamano [Wed, 17 Feb 2010 07:02:43 +0000 (23:02 -0800)] 
Merge branch 'sp/push-sideband' into jch

* sp/push-sideband:
  receive-pack: Send internal errors over side-band #2
  t5401: Use a bare repository for the remote peer
  receive-pack: Send hook output over side band #2
  receive-pack: Wrap status reports inside side-band-64k
  receive-pack: Refactor how capabilities are shown to the client
  send-pack: demultiplex a sideband stream with status data
  run-command: support custom fd-set in async
  run-command: Allow stderr to be a caller supplied pipe

15 years agoMerge branch 'tc/maint-transport-ls-remote-with-void' into jch
Junio C Hamano [Wed, 17 Feb 2010 07:02:21 +0000 (23:02 -0800)] 
Merge branch 'tc/maint-transport-ls-remote-with-void' into jch

* tc/maint-transport-ls-remote-with-void:
  transport: add got_remote_refs flag

15 years agoMerge branch 'ml/maint-grep-doc' into jch
Junio C Hamano [Wed, 17 Feb 2010 07:01:28 +0000 (23:01 -0800)] 
Merge branch 'ml/maint-grep-doc' into jch

* ml/maint-grep-doc:
  grep documentation: clarify what files match

15 years agogrep documentation: clarify what files match
Mark Lodato [Tue, 16 Feb 2010 00:25:40 +0000 (19:25 -0500)] 
grep documentation: clarify what files match

Clarify that git-grep(1) searches only tracked files, and that each
<pathspec> is a pathspec, as in any other ordinary git commands.

Add an example to show a simple use case for searching all .c and .h
files in the current directory and below.

Signed-off-by: Mark Lodato <lodatom@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jc/maint-fix-test-perm' into jch
Junio C Hamano [Wed, 17 Feb 2010 06:50:22 +0000 (22:50 -0800)] 
Merge branch 'jc/maint-fix-test-perm' into jch

* jc/maint-fix-test-perm:
  lib-patch-mode.sh: Fix permission
  t6000lib: Fix permission

15 years agoMerge branch 'jc/typo'
Junio C Hamano [Wed, 17 Feb 2010 06:45:14 +0000 (22:45 -0800)] 
Merge branch 'jc/typo'

* jc/typo:
  Typofixes outside documentation area

15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 17 Feb 2010 06:40:45 +0000 (22:40 -0800)] 
Merge branch 'maint'

* maint:
  Prepare 1.7.0.1 release notes
  Fix use of mutex in threaded grep
  dwim_ref: fix dangling symref warning
  stash pop: remove 'apply' options during 'drop' invocation
  diff: make sure --output=/bad/path is caught
  Remove hyphen from "git-command" in two error messages

15 years agoPrepare 1.7.0.1 release notes
Junio C Hamano [Wed, 17 Feb 2010 06:25:03 +0000 (22:25 -0800)] 
Prepare 1.7.0.1 release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jc/maint-grep-one-thread-mutex-fix' into maint
Junio C Hamano [Wed, 17 Feb 2010 06:23:25 +0000 (22:23 -0800)] 
Merge branch 'jc/maint-grep-one-thread-mutex-fix' into maint

* jc/maint-grep-one-thread-mutex-fix:
  Fix use of mutex in threaded grep

15 years agoFix use of mutex in threaded grep
Junio C Hamano [Tue, 16 Feb 2010 02:34:28 +0000 (18:34 -0800)] 
Fix use of mutex in threaded grep

The program can decide at runtime not to use threading even if the support
is compiled in.  In such a case, mutexes are not necessary and left
uninitialized.  But the code incorrectly tried to take and release the
read_sha1_mutex unconditionally.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Fredrik Kuivinen <frekui@gmail.com>
15 years agoMerge branch 'maint-1.6.6' into maint
Junio C Hamano [Tue, 16 Feb 2010 23:05:02 +0000 (15:05 -0800)] 
Merge branch 'maint-1.6.6' into maint

* maint-1.6.6:
  dwim_ref: fix dangling symref warning
  stash pop: remove 'apply' options during 'drop' invocation
  diff: make sure --output=/bad/path is caught
  Remove hyphen from "git-command" in two error messages

15 years agoMerge branch 'maint-1.6.5' into maint-1.6.6
Junio C Hamano [Tue, 16 Feb 2010 23:04:55 +0000 (15:04 -0800)] 
Merge branch 'maint-1.6.5' into maint-1.6.6

* maint-1.6.5:
  dwim_ref: fix dangling symref warning
  stash pop: remove 'apply' options during 'drop' invocation
  diff: make sure --output=/bad/path is caught

15 years agotransport: add got_remote_refs flag
Tay Ray Chuan [Tue, 16 Feb 2010 07:18:21 +0000 (15:18 +0800)] 
transport: add got_remote_refs flag

transport_get_remote_refs() in tranport.c checks transport->remote_refs
to determine whether transport->get_refs_list() should be invoked.  The
logic is "if it is NULL, we haven't run ls-remote to find out yet".

However, transport->remote_refs could still be NULL while cloning from
an empty repository.  This causes get_refs_list() to be run unnecessarily.

Introduce a flag, transport->got_remote_refs, to more explicitly record
if we have run transport->get_refs_list() already.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodwim_ref: fix dangling symref warning
Jeff King [Tue, 16 Feb 2010 07:03:16 +0000 (02:03 -0500)] 
dwim_ref: fix dangling symref warning

If we encounter a symref that is dangling, in most cases we will warn
about it. The one exception is a dangling HEAD, as that indicates a
branch yet to be born.

However, the check in dwim_ref was not quite right. If we were fed
something like "HEAD^0" we would try to resolve "HEAD", see that it is
dangling, and then check whether the _original_ string we got was
"HEAD" (which it wasn't in this case). And that makes no sense; the
dangling thing we found was not "HEAD^0" but rather "HEAD".

Fixing this squelches a scary warning from "submodule summary HEAD" (and
consequently "git status" with status.submodulesummary set) in an empty
repo, as the submodule script calls "git rev-parse -q --verify HEAD^0".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostash pop: remove 'apply' options during 'drop' invocation
Thomas Rast [Mon, 15 Feb 2010 16:05:46 +0000 (17:05 +0100)] 
stash pop: remove 'apply' options during 'drop' invocation

The 'git stash pop' option parsing used to remove the first argument
in --index mode.  At the time this was implemented, this first
argument was always --index.  However, since the invention of the -q
option in fcdd0e9 (stash: teach quiet option, 2009-06-17) you can
cause an internal invocation of

  git stash drop --index

by running

  git stash pop -q --index

which then of course fails because drop doesn't know --index.

To handle this, instead let 'git stash apply' decide what the future
argument to 'drop' should be.

Warning: this means that 'git stash apply' must parse all options that
'drop' can take, and deal with them in the same way.  This is
currently true for its only option -q.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff: make sure --output=/bad/path is caught
Larry D'Anna [Tue, 16 Feb 2010 04:10:45 +0000 (23:10 -0500)] 
diff: make sure --output=/bad/path is caught

The return value from fopen wasn't being checked.

Signed-off-by: Larry D'Anna <larry@elder-gods.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRemove hyphen from "git-command" in two error messages
Pete Harlan [Mon, 15 Feb 2010 23:33:18 +0000 (15:33 -0800)] 
Remove hyphen from "git-command" in two error messages

Signed-off-by: Pete Harlan <pgit@pcharlan.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoam: Fix launching of pager
Jonathan Nieder [Mon, 15 Feb 2010 05:04:13 +0000 (23:04 -0600)] 
am: Fix launching of pager

The pagination functionality in git am has some problems:

 - It does not check if stdout is a tty, so it always paginates.

 - If $GIT_PAGER uses any environment variables, they are being
   ignored, since it does not run $GIT_PAGER through eval.

 - If $GIT_PAGER is set to the empty string, instead of passing
   output through to stdout, it tries to run $dotest/patch.

Fix them.  While at it, move the definition of git_pager() to
git-sh-setup so authors of other commands are not tempted to
reimplement it with the same mistakes.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Mon, 15 Feb 2010 02:59:20 +0000 (18:59 -0800)] 
Merge branch 'maint'

* maint:
  fix minor memory leak in get_tree_entry()

15 years agoMerge branch 'maint-1.6.6' into maint
Junio C Hamano [Mon, 15 Feb 2010 02:59:14 +0000 (18:59 -0800)] 
Merge branch 'maint-1.6.6' into maint

* maint-1.6.6:
  fix minor memory leak in get_tree_entry()

15 years agogitweb: Die if there are parsing errors in config file
Jakub Narebski [Sun, 14 Feb 2010 21:46:28 +0000 (22:46 +0100)] 
gitweb: Die if there are parsing errors in config file

Otherwise the errors can propagate, and show in damnest places, and
you would spend your time chasing ghosts instead of debugging real
problem (yes, it is from personal experience).

This follows (parts of) advice in `perldoc -f do` documentation.

This required restructoring code a bit, so we die only if we are reading
(executing) config file.  As a side effect $GITWEB_CONFIG_SYSTEM is always
available, even when we use $GITWEB_CONFIG.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit svn: Fix launching of pager
Jonathan Nieder [Sun, 14 Feb 2010 12:06:10 +0000 (06:06 -0600)] 
git svn: Fix launching of pager

In commit dec543e (am -i, git-svn: use "git var GIT_PAGER"), I tried
to teach git svn to defer to git var on what pager to use. In the
process, I introduced two bugs:

 - The value set for $pager in config_pager has local scope, so
   run_pager never sees it;

 - git var cannot tell whether git svn’s output is going to a
   terminal, so the value chosen for $pager does not reflect that
   information.

Fix them.

Reported-by: Sebastian Celis <sebastian@sebastiancelis.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit.1: Clarify the behavior of the --paginate option
Jonathan Nieder [Sun, 14 Feb 2010 12:02:35 +0000 (06:02 -0600)] 
git.1: Clarify the behavior of the --paginate option

The --paginate option is meant to negate the effect of an explicit or
implicit pager.<cmd> = false setting.  Thus it turns the pager on if
output is going to a terminal rather than unconditionally.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMake 'git var GIT_PAGER' always print the configured pager
Jonathan Nieder [Sun, 14 Feb 2010 11:59:59 +0000 (05:59 -0600)] 
Make 'git var GIT_PAGER' always print the configured pager

Scripted commands that want to use git’s configured pager know better
than ‘git var’ does whether stdout is going to be a tty at the
appropriate time.  Checking isatty(1) as git_pager() does now won’t
cut it, since the output of git var itself is almost never a terminal.
The symptom is that when used by humans, ‘git var GIT_PAGER’ behaves
as it should, but when used by scripts, it always returns ‘cat’!

So avoid tricks with isatty() and just always print the configured
pager.

This does not fix the callers to check isatty(1) themselves yet.
Nevertheless, this patch alone is enough to fix 'am --interactive'.

Thanks to Sebastian Celis for the report and Jeff King for the
analysis.

Reported-by: Sebastian Celis <sebastian@sebastiancelis.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix 'git var' usage synopsis
Jonathan Nieder [Sun, 14 Feb 2010 11:55:53 +0000 (05:55 -0600)] 
Fix 'git var' usage synopsis

The parameter to 'git var' is not optional.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agofix minor memory leak in get_tree_entry()
René Scharfe [Sun, 14 Feb 2010 09:56:46 +0000 (10:56 +0100)] 
fix minor memory leak in get_tree_entry()

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-notes: Add "copy" subcommand for copying notes between objects
Johan Herland [Sat, 13 Feb 2010 21:28:38 +0000 (22:28 +0100)] 
builtin-notes: Add "copy" subcommand for copying notes between objects

This is useful for keeping notes to objects that are being rewritten by e.g.
'git commit --amend', 'git rebase', or 'git cherry-pick'.

"git notes copy <from> <to>" is in practice equivalent to
"git notes add -C $(git notes list <from>) <to>", although it is somewhat
more convenient for regular users.

"git notes copy" takes the same -f option as "git add", to overwrite existing
notes at the target (instead of aborting with an error message).

If the <from>-object has no notes, "git notes copy" will abort with an error
message.

The patch includes tests verifying correct behaviour of the new subcommand.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-notes: Misc. refactoring of argc and exit value handling
Johan Herland [Sat, 13 Feb 2010 21:28:37 +0000 (22:28 +0100)] 
builtin-notes: Misc. refactoring of argc and exit value handling

This is in preparation of future patches that add additional subcommands.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-notes: Add -c/-C options for reusing notes
Johan Herland [Sat, 13 Feb 2010 21:28:36 +0000 (22:28 +0100)] 
builtin-notes: Add -c/-C options for reusing notes

Inspired by the -c/-C options to "git commit", we teach these options to
"git notes add/append" to allow reuse of note objects.

With this patch in place, it is now easy to copy or move notes between
objects. For example, to copy object A's notes to object B:
git notes add [-f] -C $(git notes list A) B
To move instead of copying, you simply remove the notes from the source
object afterwards, e.g.:
git notes remove A

The patch includes tests verifying correct behaviour of the new functionality.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-notes: Refactor handling of -F option to allow combining -m and -F
Johan Herland [Sat, 13 Feb 2010 21:28:35 +0000 (22:28 +0100)] 
builtin-notes: Refactor handling of -F option to allow combining -m and -F

By moving the -F option handling into a separate function (parse_file_arg),
we can start allowing several -F options, and mixed usage of -m and -F
options. Each -m/-F given appends to the note message, in the order they are
given on the command-line.

The patch includes tests verifying correct behaviour of the new functionality.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-notes: Deprecate the -m/-F options for "git notes edit"
Johan Herland [Sat, 13 Feb 2010 21:28:34 +0000 (22:28 +0100)] 
builtin-notes: Deprecate the -m/-F options for "git notes edit"

The semantics for "git notes edit -m/-F" overlap with those for
"git notes add -f", and the behaviour (i.e. overwriting existing
notes with the given message/file) is more intuitively captured
by (and better documented with) "git notes add -f".

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>
15 years agobuiltin-notes: Add "append" subcommand for appending to note objects
Johan Herland [Sat, 13 Feb 2010 21:28:33 +0000 (22:28 +0100)] 
builtin-notes: Add "append" subcommand for appending to note objects

"git notes append" is equivalent to "git notes edit" except that instead
of editing existing notes contents, you can only append to it. This is
useful for quickly adding annotations like e.g.:
git notes append -m "Acked-by: A U Thor <author@example.com>"

"git notes append" takes the same -m/-F options as "git notes add".

If there is no existing note to append to, "git notes append" is identical
to "git notes add" (i.e. it adds a new note).

The patch includes tests verifying correct behaviour of the new subcommand.

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>
15 years agobuiltin-notes: Add "add" subcommand for adding notes to objects
Johan Herland [Sat, 13 Feb 2010 21:28:32 +0000 (22:28 +0100)] 
builtin-notes: Add "add" subcommand for adding notes to objects

"git notes add" is identical to "git notes edit" except that instead of
editing existing notes for a given object, you can only add notes to an
object that currently has none. If "git notes add" finds existing notes
for the given object, the addition is aborted. However, if the new
-f/--force option is used, "git notes add" will _overwrite_ the existing
notes with the new notes contents.

If there is no existing notes for the given object. "git notes add" is
identical to "git notes edit" (i.e. it adds a new note).

The patch includes tests verifying correct behaviour of the new subcommand.

Suggested-by: Joey Hess <joey@kitenet.net>
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>
15 years agobuiltin-notes: Add --message/--file aliases for -m/-F options
Johan Herland [Sat, 13 Feb 2010 21:28:31 +0000 (22:28 +0100)] 
builtin-notes: Add --message/--file aliases for -m/-F options

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobuiltin-notes: Add "list" subcommand for listing note objects
Johan Herland [Sat, 13 Feb 2010 21:28:30 +0000 (22:28 +0100)] 
builtin-notes: Add "list" subcommand for listing note objects

"git notes list" will list all note objects in the current notes ref (in the
format "<note object> <annotated object>"). "git notes list <object>" will
list the note object associated with the given <object>, or fail loudly if
the given <object> has no associated notes.

If no arguments are given to "git notes", it defaults to the "list"
subcommand. This is for pseudo-compatibility with "git tag" and "git branch".

The patch includes tests verifying correct behaviour of the new subcommand.

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>
15 years agoDocumentation: Generalize git-notes docs to 'objects' instead of 'commits'
Johan Herland [Sat, 13 Feb 2010 21:28:29 +0000 (22:28 +0100)] 
Documentation: Generalize git-notes docs to 'objects' instead of 'commits'

Notes can annotate arbitrary objects (not only commits), but this is not
reflected in the current documentation.

This patch rewrites the git-notes documentation to talk about 'objects'
instead of 'commits'. However, the discussion on commit notes and how
they are displayed by 'git log' is largely preserved.

Finally, I add myself to the Author/Documentation credits, since most of
the lines in the git-notes code and docs are blamed on me.

Cc: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>