]> asedeno.scripts.mit.edu Git - git.git/log
git.git
13 years agoMerge branch 'sg/completion'
Junio C Hamano [Wed, 17 Nov 2010 23:00:11 +0000 (15:00 -0800)]
Merge branch 'sg/completion'

* sg/completion:
  bash: support pretty format aliases
  bash: support more 'git notes' subcommands and their options
  bash: not all 'git bisect' subcommands make sense when not bisecting
  bash: offer refs for 'git bisect start'

13 years agoMerge branch 'sg/bisect'
Junio C Hamano [Wed, 17 Nov 2010 23:00:03 +0000 (15:00 -0800)]
Merge branch 'sg/bisect'

* sg/bisect:
  bisect: check for mandatory argument of 'bisect replay'
  bisect: improve error msg of 'bisect reset' when original HEAD is deleted
  bisect: improve error message of 'bisect log' while not bisecting

13 years agoMerge branch 'ak/submodule-sync'
Junio C Hamano [Wed, 17 Nov 2010 22:59:54 +0000 (14:59 -0800)]
Merge branch 'ak/submodule-sync'

* ak/submodule-sync:
  submodule sync: Update "submodule.<name>.url" for empty directories

13 years agoMerge branch 'jk/maint-rev-list-nul'
Junio C Hamano [Wed, 17 Nov 2010 22:59:33 +0000 (14:59 -0800)]
Merge branch 'jk/maint-rev-list-nul'

* jk/maint-rev-list-nul:
  rev-list: handle %x00 NUL in user format

13 years agoMerge branch 'ks/no-textconv-symlink'
Junio C Hamano [Wed, 17 Nov 2010 22:59:27 +0000 (14:59 -0800)]
Merge branch 'ks/no-textconv-symlink'

* ks/no-textconv-symlink:
  blame,cat-file --textconv: Don't assume mode is ``S_IFREF | 0664''
  blame,cat-file: Demonstrate --textconv is wrongly running converter on symlinks
  blame,cat-file: Prepare --textconv tests for correctly-failing conversion program

13 years agoMerge branch 'jn/gitweb-test'
Junio C Hamano [Wed, 17 Nov 2010 22:59:22 +0000 (14:59 -0800)]
Merge branch 'jn/gitweb-test'

* jn/gitweb-test:
  gitweb/Makefile: Include gitweb/config.mak
  gitweb/Makefile: Add 'test' and 'test-installed' targets
  t/gitweb-lib.sh: Add support for GITWEB_TEST_INSTALLED
  gitweb: Move call to evaluate_git_version after evaluate_gitweb_config

13 years agoMerge branch 'cb/diff-fname-optim'
Junio C Hamano [Wed, 17 Nov 2010 22:59:16 +0000 (14:59 -0800)]
Merge branch 'cb/diff-fname-optim'

* cb/diff-fname-optim:
  diff: avoid repeated scanning while looking for funcname
  do not search functions for patch ID
  add rebase patch id tests

13 years agoMerge branch 'jk/no-textconv-symlink'
Junio C Hamano [Wed, 17 Nov 2010 22:59:10 +0000 (14:59 -0800)]
Merge branch 'jk/no-textconv-symlink'

* jk/no-textconv-symlink:
  diff: don't use pathname-based diff drivers for symlinks

13 years agoMerge branch 'dk/maint-blame-el'
Junio C Hamano [Wed, 17 Nov 2010 22:59:04 +0000 (14:59 -0800)]
Merge branch 'dk/maint-blame-el'

* dk/maint-blame-el:
  git-blame.el: Add (require 'format-spec)

13 years agoMerge branch 'maint'
Junio C Hamano [Wed, 17 Nov 2010 21:57:58 +0000 (13:57 -0800)]
Merge branch 'maint'

* maint:
  clean: remove redundant variable baselen
  Documentation/git-pull: clarify configuration
  Document that rev-list --graph triggers parent rewriting.
  clean: avoid quoting twice
  document sigchain api
  Keep together options controlling the behaviour of diffcore-rename.
  t3402: test "rebase -s<strategy> -X<opt>"

13 years agot6022: Use -eq not = to test output of wc -l
Brian Gernhardt [Mon, 8 Nov 2010 21:29:26 +0000 (16:29 -0500)]
t6022: Use -eq not = to test output of wc -l

When comparing numbers such as "3" to "$(wc -l)", we should check for
numerical equality using -eq instead of string equality using = because
some implementations of wc output extra whitespace.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoclean: remove redundant variable baselen
Nguyễn Thái Ngọc Duy [Mon, 15 Nov 2010 06:42:44 +0000 (13:42 +0700)]
clean: remove redundant variable baselen

baselen used to be the result of common_prefix() when it was made
builtin. Since 1d8842d (Add 'fill_directory()' helper function for
directory traversal - 2009-05-14), its value will always be
zero. Remove it because it's no longer variable.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'mz/maint-rebase-X-fix' into maint
Junio C Hamano [Wed, 17 Nov 2010 21:18:19 +0000 (13:18 -0800)]
Merge branch 'mz/maint-rebase-X-fix' into maint

* mz/maint-rebase-X-fix:
  t3402: test "rebase -s<strategy> -X<opt>"

13 years agoDocumentation/git-pull: clarify configuration
Martin von Zweigbergk [Fri, 12 Nov 2010 18:55:58 +0000 (19:55 +0100)]
Documentation/git-pull: clarify configuration

The sentence about 'branch.<name>.rebase' refers to the first sentence
in the paragraph and not to the sentence about avoiding rebasing
non-local changes. Clarify this.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocument that rev-list --graph triggers parent rewriting.
Yann Dirson [Fri, 12 Nov 2010 08:48:58 +0000 (09:48 +0100)]
Document that rev-list --graph triggers parent rewriting.

This may help to understand why --graph causes more comments to
be selected.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoclean: avoid quoting twice
Nguyễn Thái Ngọc Duy [Mon, 15 Nov 2010 10:12:44 +0000 (17:12 +0700)]
clean: avoid quoting twice

qname is the result of quote_path_relative(), which does
quote_c_style_counted() internally. Remove the hard-coded quotes.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodocument sigchain api
Jeff King [Fri, 12 Nov 2010 04:24:56 +0000 (23:24 -0500)]
document sigchain api

It's pretty straightforward, but a stripped-down example
never hurts. And we should make clear that it is explicitly
OK to use SIG_DFL and SIG_IGN.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoKeep together options controlling the behaviour of diffcore-rename.
Yann Dirson [Wed, 10 Nov 2010 20:27:13 +0000 (21:27 +0100)]
Keep together options controlling the behaviour of diffcore-rename.

It makes little sense to have --diff-filter in the middle of them, and
even spares an ifndef::git-format-patch.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agouse persistent memory for rejected paths
Clemens Buchacher [Mon, 15 Nov 2010 19:52:19 +0000 (20:52 +0100)]
use persistent memory for rejected paths

An aborted merge prints the list of rejected paths as part of the
error message. Since commit f66caaf9 (do not overwrite files in
leading path), some of those paths do not have static buffers, so
we have to keep a copy. Use string_list's to accomplish this.

This changes the order of the list to the order in which the paths
are processed. Previously, it was reversed.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Mon, 15 Nov 2010 19:00:24 +0000 (11:00 -0800)]
Merge branch 'maint'

* maint:
  rebase -X: do not clobber strategy

13 years agoverify-tag: document --verbose
René Scharfe [Mon, 8 Nov 2010 18:04:51 +0000 (19:04 +0100)]
verify-tag: document --verbose

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobranch: improve --verbose description
René Scharfe [Mon, 8 Nov 2010 18:03:58 +0000 (19:03 +0100)]
branch: improve --verbose description

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoarchive: improve --verbose description
René Scharfe [Mon, 8 Nov 2010 18:02:57 +0000 (19:02 +0100)]
archive: improve --verbose description

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDescribe various forms of "be quiet" using OPT__QUIET
Jonathan Nieder [Mon, 8 Nov 2010 19:54:48 +0000 (13:54 -0600)]
Describe various forms of "be quiet" using OPT__QUIET

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd OPT__FORCE
René Scharfe [Mon, 8 Nov 2010 18:01:54 +0000 (19:01 +0100)]
add OPT__FORCE

Add OPT__FORCE as a helper macro in the same spirit as OPT__VERBOSE
et.al. to simplify defining -f/--force options.

Signed-off-by: Rene Scharfe <rene.scharfe@lstfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd description parameter to OPT__QUIET
René Scharfe [Mon, 8 Nov 2010 18:06:54 +0000 (19:06 +0100)]
add description parameter to OPT__QUIET

Allows better help text to be defined than "be quiet".  Also make use
of the macro in a place that already had a different description.  No
object code changes intended.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd description parameter to OPT__DRY_RUN
René Scharfe [Mon, 8 Nov 2010 17:58:51 +0000 (18:58 +0100)]
add description parameter to OPT__DRY_RUN

Allows better help text to be defined than "dry run".  Also make use
of the macro in places that already had a different description.  No
object code changes intended.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd description parameter to OPT__VERBOSE
René Scharfe [Mon, 8 Nov 2010 17:56:39 +0000 (18:56 +0100)]
add description parameter to OPT__VERBOSE

Allows better help text to be defined than "be verbose".  Also make use
of the macro in places that already had a different description.  No
object code changes intended.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodo not overwrite untracked during merge from unborn branch
Clemens Buchacher [Sun, 14 Nov 2010 22:07:49 +0000 (23:07 +0100)]
do not overwrite untracked during merge from unborn branch

In case HEAD does not point to a valid commit yet, merge is
implemented as a hard reset. This will cause untracked files to be
overwritten.

Instead, assume the empty tree for HEAD and do a regular merge. An
untracked file will cause the merge to abort and do nothing. If no
conflicting files are present, the merge will have the same effect
as a hard reset.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: use test_cmp instead of piping to diff(1)
Ævar Arnfjörð Bjarmason [Sun, 14 Nov 2010 14:44:16 +0000 (14:44 +0000)]
tests: use test_cmp instead of piping to diff(1)

Change submodule tests that piped to diff(1) to use test_cmp. The
resulting unified diff is easier to read.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot7004-tag.sh: re-arrange git tag comment for clarity
Ævar Arnfjörð Bjarmason [Sun, 14 Nov 2010 14:44:15 +0000 (14:44 +0000)]
t7004-tag.sh: re-arrange git tag comment for clarity

Split the "message in editor has initial comment" test into three
tests. The motivation is to be able to only skip the middle part under
NO_GETTEXT_POISON.

In addition the return value of 'git tag' was being returned. We now
check that it's non-zero. I used ! instead of test_must_fail so that
the GIT_EDITOR variable was only used in this command invocation, and
because the surrounding tests use this style.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-send-email.perl: make initial In-Reply-To apply only to first email
Antonio Ospite [Fri, 12 Nov 2010 14:55:08 +0000 (15:55 +0100)]
git-send-email.perl: make initial In-Reply-To apply only to first email

When an initial --in-reply-to is supplied, make it apply only to the
first message; --[no-]chain-reply-to setting are honored by second and
subsequent messages; this is also how the git-format-patch option with
the same name behaves.

Moreover, when $initial_reply_to is asked to the user interactively it
is asked as the "Message-ID to be used as In-Reply-To for the _first_
email", this makes the user think that the second and subsequent
patches are not using it but are considered as replies to the first
message or chained according to the --[no-]chain-reply setting.

Look at the v2 series in the illustration to see what the new behavior
ensures:

       (before the patch)          |      (after the patch)
 [PATCH 0/2] Here is what I did... | [PATCH 0/2] Here is what I did...
   [PATCH 1/2] Clean up and tests  |   [PATCH 1/2] Clean up and tests
   [PATCH 2/2] Implementation      |   [PATCH 2/2] Implementation
   [PATCH v2 0/3] Here is a reroll |   [PATCH v2 0/3] Here is a reroll
   [PATCH v2 1/3] Clean up         |     [PATCH v2 1/3] Clean up
   [PATCH v2 2/3] New tests        |     [PATCH v2 2/3] New tests
   [PATCH v2 3/3] Implementation   |     [PATCH v2 3/3] Implementation

This is the typical behaviour we want when we send a series with cover
letter in reply to some discussion, the new patch series should appear
as a separate subtree in the discussion.

Also update the documentation on --in-reply-to to describe the new
behavior.

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3402: test "rebase -s<strategy> -X<opt>"
Junio C Hamano [Thu, 11 Nov 2010 21:28:57 +0000 (13:28 -0800)]
t3402: test "rebase -s<strategy> -X<opt>"

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation: point to related commands from gitignore
Jonathan Nieder [Wed, 10 Nov 2010 19:00:48 +0000 (13:00 -0600)]
Documentation: point to related commands from gitignore

A frequently asked question on #git is how to stop tracking a file
that is mistakenly tracked by git.  A frequently attempted strategy is
to add such files to .gitignore.

Thus one might imagine that the gitignore documentation could be a
good entry point for 'git rm' documentation.  Add some
cross-references in this vein.

While at it, move a reference to update-index --assume-unchanged from
the DESCRIPTION to lower down on the page.  This way, the methodical
reader can benefit from first learning what excludes files do, then
how they relate to other git facilities.

Based-on-patch-by: Sitaram Chamarty <sitaram@atc.tcs.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation: split gitignore page into sections
Jonathan Nieder [Wed, 10 Nov 2010 18:57:39 +0000 (12:57 -0600)]
Documentation: split gitignore page into sections

A learner-by-example might want to look at the examples section first.
Help her out by supplying some section headings: PATTERN FORMAT for
the format of lines in an excludes file and EXAMPLES for the two
examples.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoRemove pack file handling dependency from wrapper.o
Jonathan Nieder [Sat, 6 Nov 2010 19:00:38 +0000 (14:00 -0500)]
Remove pack file handling dependency from wrapper.o

As v1.7.0-rc0~43 (slim down "git show-index", 2010-01-21) explains,
use of xmalloc() brings in a dependency on zlib, the sha1 lib, and the
rest of git's object file access machinery via try_to_free_pack_memory.
That is overkill when xmalloc is just being used as a convenience
wrapper to exit when no memory is available.

So defer setting try_to_free_pack_memory as try_to_free_routine until
the first packfile is opened in add_packed_git().

After this change, a simple program using xmalloc() and no other
functions will not pull in any code from libgit.a aside from wrapper.o
and usage.o.

Improved-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agopack-objects: mark file-local variable static
Jonathan Nieder [Sat, 6 Nov 2010 11:47:57 +0000 (06:47 -0500)]
pack-objects: mark file-local variable static

old_try_to_free_routine is not meant for use from other files.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agowrapper: give zlib wrappers their own translation unit
Jonathan Nieder [Sat, 6 Nov 2010 11:47:34 +0000 (06:47 -0500)]
wrapper: give zlib wrappers their own translation unit

Programs using xmalloc() but not git_inflate() require -lz on the
linker command line because git_inflate() is in the same translation
unit as xmalloc().

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agostrbuf: move strbuf_branchname to sha1_name.c
Jonathan Nieder [Sat, 6 Nov 2010 11:46:52 +0000 (06:46 -0500)]
strbuf: move strbuf_branchname to sha1_name.c

strbuf_branchname is a thin wrapper around interpret_branch_name
from sha1_name.o.  Most strbuf.o users do not need it.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agopath helpers: move git_mkstemp* to wrapper.c
Jonathan Nieder [Sat, 6 Nov 2010 11:46:31 +0000 (06:46 -0500)]
path helpers: move git_mkstemp* to wrapper.c

git_mkstemp_mode and related functions do not require access to
specialized git machinery, unlike some other functions from
path.c (like set_shared_perm()).  Move them to wrapper.c where
the wrapper xmkstemp_mode is defined.

This eliminates a dependency of wrapper.o on environment.o via
path.o.  With typical linkers (e.g., gcc), that dependency makes
programs that use functions from wrapper.o and not environment.o
or path.o larger than they need to be.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agowrapper: move odb_* to environment.c
Jonathan Nieder [Sat, 6 Nov 2010 11:45:38 +0000 (06:45 -0500)]
wrapper: move odb_* to environment.c

The odb_mkstemp and odb_pack_keep functions open files under the
$GIT_OBJECT_DIRECTORY directory.  This requires access to the git
configuration which very simple programs do not need.

Move these functions to environment.o, closer to their dependencies.
This should make it easier for programs to link to wrapper.o without
linking to environment.o.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agowrapper: move xmmap() to sha1_file.c
Jonathan Nieder [Sat, 6 Nov 2010 11:44:11 +0000 (06:44 -0500)]
wrapper: move xmmap() to sha1_file.c

wrapper.o depends on sha1_file.o for a number of reasons.  One is
release_pack_memory().

xmmap function calls mmap, discarding unused pack windows when
necessary to relieve memory pressure.  Simple git programs using
wrapper.o as a friendly libc do not need this functionality.
So move xmmap to sha1_file.o, where release_pack_memory() is.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorebase -X: do not clobber strategy
Martin von Zweigbergk [Wed, 10 Nov 2010 07:14:26 +0000 (08:14 +0100)]
rebase -X: do not clobber strategy

If any strategy options are passed to -X, the strategy will always be
set to 'recursive'. According to the documentation, it should default to
'recursive' if it is not set, but it should be possible to set it to
other values.

This fixes a regression introduced in v1.7.3-rc0~67^2 (2010-07-29).

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocherry-pick/revert: transparently refresh index
Jonathan Nieder [Sun, 31 Oct 2010 19:59:33 +0000 (14:59 -0500)]
cherry-pick/revert: transparently refresh index

A stat-dirty index is not a detail that ought to concern the operator
of porcelain such as "git cherry-pick".

Without this change, a cherry-pick after copying a worktree with rsync
errors out with a misleading message.

$ git cherry-pick build/top
error: Your local changes to 'file.h' would be overwritten by merge.  Aborting.
Please, commit your changes or stash them before you can merge.

Noticed-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoapply: handle patches with funny filename and colon in timezone
Jonathan Nieder [Wed, 29 Sep 2010 21:41:08 +0000 (16:41 -0500)]
apply: handle patches with funny filename and colon in timezone

Some patches have a timezone formatted like '-08:00' instead of
'-0800' in their ---/+++ lines (e.g. http://lwn.net/Articles/131729/).
Take this into account when searching for the start of the timezone
(which is the end of the filename).

This does not actually affect the outcome of patching unless (1) a
file being patched has a non-' ' whitespace character (e.g., tab) in
its filename, or (2) the patch is whitespace-damaged, so the tab
between filename and timestamp has been replaced with spaces.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodocs: give more hints about how "add -e" works
Jeff King [Tue, 9 Nov 2010 04:58:20 +0000 (23:58 -0500)]
docs: give more hints about how "add -e" works

The previous text was not exactly accurate; it is OK to
change space and minus lines, but only in certain ways.

This patch takes a whole new approach, which is to describe
the sorts of conceptual operations you might want to
perform. It also includes a healthy dose of warnings about
how things can go wrong.

Since the size of the text is getting quite long, it also
splits this out into an "editing patches" section. This
makes more sense with the current structure, anyway, which
already splits out the interactive mode description.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot4124 (apply --whitespace): use test_might_fail
Jonathan Nieder [Sun, 31 Oct 2010 07:41:08 +0000 (02:41 -0500)]
t4124 (apply --whitespace): use test_might_fail

Use test_might_fail instead of ignoring the exit status from git
config --unset, and let the exit status propagate past rm -f (which
does not fail on ENOENT).  Otherwise bugs that lead git config to
crash would not be detected when this test runs.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3404: do not use 'describe' to implement test_cmp_rev
Junio C Hamano [Tue, 9 Nov 2010 23:20:20 +0000 (15:20 -0800)]
t3404: do not use 'describe' to implement test_cmp_rev

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3404 (rebase -i): introduce helper to check position of HEAD
Jonathan Nieder [Sun, 31 Oct 2010 07:40:30 +0000 (02:40 -0500)]
t3404 (rebase -i): introduce helper to check position of HEAD

The same code to check the position of HEAD is used by several
tests in this script.  Factor it out as a function and simplify it.

Noticed using an &&-chaining tester, because the current code
does not propagate the precise exit status from errors.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3404 (rebase -i): move comment to description
Jonathan Nieder [Sun, 31 Oct 2010 07:39:51 +0000 (02:39 -0500)]
t3404 (rebase -i): move comment to description

Add a comment describing the setup in t3404 to its --help output.

This should make it easier to decide where to put new functions
without disrupting the flow of the file or obstructing the description
of the test setup.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3404 (rebase -i): unroll test_commit loops
Jonathan Nieder [Sun, 31 Oct 2010 07:38:25 +0000 (02:38 -0500)]
t3404 (rebase -i): unroll test_commit loops

Allow test_commit failures in loop iterations before the last one to
cause the test assertion to fail.

More importantly, avoiding these loops makes the test a little
simpler to read and decreases the vertical screen footprint of
the setup test assertion by one line.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3301 (notes): use test_expect_code for clarity
Jonathan Nieder [Sun, 31 Oct 2010 07:36:57 +0000 (02:36 -0500)]
t3301 (notes): use test_expect_code for clarity

Use the test_expect_code helper instead of open-coding it.

The main behavior change is to print the command and actual exit
status when the test fails.  More importantly, this would make it
easier to add commands before "git notes show" as part of the
same test assertion if needed.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot1400 (update-ref): use test_must_fail
Jonathan Nieder [Sun, 31 Oct 2010 07:36:19 +0000 (02:36 -0500)]
t1400 (update-ref): use test_must_fail

As t/README explains:

When a gitcommand dies due to a segfault, test_must_fail
diagnoses it as an error; "! git <command>" treats it as
just another expected failure, which would let such a bug
go unnoticed.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot1502 (rev-parse --parseopt): test exit code from "-h"
Jonathan Nieder [Sun, 31 Oct 2010 07:35:49 +0000 (02:35 -0500)]
t1502 (rev-parse --parseopt): test exit code from "-h"

rev-parse --parseopt exits with code 129 (usage error) when asked
to dump usage with -h on behalf of another command.  Scripts can
take advantage of this to avoid trying to parse usage information
as though it were the regular output from some git command.

Noticed with an &&-chaining tester.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6022 (renaming merge): chain test commands with &&
Jonathan Nieder [Sun, 31 Oct 2010 07:34:44 +0000 (02:34 -0500)]
t6022 (renaming merge): chain test commands with &&

Using 'return' in an attempt to end a test assertion can have
unpredictable results (probably escaping from test_run_ and breaking
its bookkeeping).  Redo the control flow using helpers like
test_expect_code and git diff --exit-code, so each test assertion can
follow the usual form

command that should succeed &&
command that should succeed &&
command that should succeed &&
...

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest-lib: introduce test_line_count to measure files
Jonathan Nieder [Sun, 31 Oct 2010 07:33:50 +0000 (02:33 -0500)]
test-lib: introduce test_line_count to measure files

Some tests check their output with code like the following:

test "$(git ls-files -u B | wc -l)" -eq 3 || {
echo "BAD: should have left stages for B"
return 1
}

The verbose failure condition is used because test, unlike
diff, does not print any useful information about the
nature of the failure when it fails.

Introduce a test_line_count function to help. If used like

git ls-files -u B >output &&
test_line_count -eq 3 output

it will produce output like

test_line_count: line count for output !-eq 3
100644 b023018cabc396e7692c70bbf5784a93d3f738ab 2 hi.c
100644 45b983be36b73c0788dc9cbcb76cbb80fc7bb057 3 hi.c

on failure.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: add missing &&, batch 2
Jonathan Nieder [Sun, 31 Oct 2010 07:30:58 +0000 (02:30 -0500)]
tests: add missing &&, batch 2

Same rules as before: this patch only adds " &&" to the end of
some lines in the test suite.

Intended to be applied on top of or squashed with the last
batch if they look okay.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: add missing &&
Jonathan Nieder [Sun, 31 Oct 2010 01:46:54 +0000 (20:46 -0500)]
tests: add missing &&

Breaks in a test assertion's && chain can potentially hide
failures from earlier commands in the chain.

Commands intended to fail should be marked with !, test_must_fail, or
test_might_fail.  The examples in this patch do not require that.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Tue, 9 Nov 2010 17:45:16 +0000 (09:45 -0800)]
Merge branch 'maint'

* maint:
  Documentation: document show -s
  dir.c: fix EXC_FLAG_MUSTBEDIR match in sparse checkout

13 years agorebase: teach --autosquash to match on sha1 in addition to message
Kevin Ballard [Thu, 4 Nov 2010 22:36:32 +0000 (15:36 -0700)]
rebase: teach --autosquash to match on sha1 in addition to message

Support lines of the form "fixup! 7a235b" that specify an exact commit
in addition to the normal "squash! Old commit message" form.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorebase: better rearranging of fixup!/squash! lines with --autosquash
Kevin Ballard [Thu, 4 Nov 2010 22:36:31 +0000 (15:36 -0700)]
rebase: better rearranging of fixup!/squash! lines with --autosquash

The current behvaior of --autosquash can duplicate fixup!/squash! lines
if they match multiple commits, and it can also apply them to commits
that come after them in the todo list. Even more oddly, a commit that
looks like "fixup! fixup!" will match itself and be duplicated in the
todo list.

Change the todo list rearranging to mark all commits as used as soon
as they are emitted, and to avoid emitting a fixup/squash commit if the
commit has already been marked as used.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation: document show -s
Jonathan Nieder [Tue, 9 Nov 2010 17:12:48 +0000 (11:12 -0600)]
Documentation: document show -s

Git's diff machinery has supported a -s (silence diff output) option
as far back as v0.99~900 (Silent flag for show-diff, 2005-04-13), but
the option is only advertised in an odd corner of the git diff-tree
manual.

The main use is to retrieve basic metadata about a commit:

git show -s rev

Explain this in the 'git log' manual and provide an example in the
'git show' examples section.  This is kind of a cop-out, since it
would be more useful to explain it in the 'git show' manual proper,
which says:

The command takes options applicable to the git
diff-tree command to control how the changes the
commit introduces are shown.

This manual page describes only the most frequently
used options.

Fixing that is a larger task for another day.

Reported-by: Will Hall <will@gnatter.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agostatus: Quote paths with spaces in short format
Kevin Ballard [Tue, 9 Nov 2010 02:44:38 +0000 (18:44 -0800)]
status: Quote paths with spaces in short format

According to the documentation for git-status, in short-format mode,
paths with spaces or unprintable characters are quoted. However
28fba29 (Do not quote SP., 2005-10-17) removed the behavior that quotes
paths that have spaces but not unprintable characters. Unfortunately this
makes the output of `git status --porcelain` non-parseable in certain
(rather unusual) edge cases. In the interest of removing ambiguity when
parsing the output of `git status --porcelain`, restore the behavior of
quoting paths with spaces in git-status's short-format mode.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodir.c: fix EXC_FLAG_MUSTBEDIR match in sparse checkout
Nguyễn Thái Ngọc Duy [Sun, 7 Nov 2010 18:04:58 +0000 (01:04 +0700)]
dir.c: fix EXC_FLAG_MUSTBEDIR match in sparse checkout

Commit c84de70 (excluded_1(): support exclude files in index -
2009-08-20) tries to work around the fact that there is no
directory/file information in index entries, therefore
EXC_FLAG_MUSTBEDIR match would fail.

Unfortunately the workaround is flawed. This fixes it.

Reported-by: Thomas Rinderknecht <thomasr@sailguy.org>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest: git-apply -p2 rename/chmod only
Junio C Hamano [Fri, 22 Oct 2010 05:09:40 +0000 (22:09 -0700)]
test: git-apply -p2 rename/chmod only

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoFix git-apply with -p greater than 1
Federico Cuello [Thu, 21 Oct 2010 22:12:02 +0000 (19:12 -0300)]
Fix git-apply with -p greater than 1

Fix the case when the patch is a rename or mode-change only
and -p is used with a value greater than one.
The git_header_name function did not remove more than one path
component.

Signed-off-by: Federico Cuello <fedux@lugmen.org.ar>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot9001: send-email interation with --in-reply-to and --chain-reply-to
Junio C Hamano [Tue, 19 Oct 2010 18:46:31 +0000 (11:46 -0700)]
t9001: send-email interation with --in-reply-to and --chain-reply-to

 1. When --in-reply-to gives $reply_to, the first one becomes a reply to
    that message, with or without --chain-reply-to.

 2. When --chain-reply-to is in effect, all the messages are strung
    together to form a single chain.  The first message may be in reply to
    the $reply_to given by --in-reply-to command line option (see
    previous), or the root of the discussion thread.  The second one is a
    response to the first one, and the third one is a response to the
    second one, etc.

 3. When --chain-reply-to is not in effect:

    a. When --in-reply-to is used, too, the second and the subsequent ones
       become replies to $reply_to.  Together with the first rule, all
       messages become replies to $reply_to given by --in-reply-to.

    b. When --in-reply-to is not used, presumably the second and
       subsequent ones become replies to the first one, which would be the
       root.

The documentation is reasonably clear about the 1., 2. and 3a. above, I
think, even though I do not think 3b. is clearly specified.

The two tests added by this patch at least documents what happens between
these two options.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'aw/git-p4-deletion'
Junio C Hamano [Fri, 5 Nov 2010 17:42:46 +0000 (10:42 -0700)]
Merge branch 'aw/git-p4-deletion'

* aw/git-p4-deletion:
  Fix handling of git-p4 on deleted files

13 years agoMerge branch 'master' of git://repo.or.cz/git-gui
Junio C Hamano [Fri, 5 Nov 2010 17:41:09 +0000 (10:41 -0700)]
Merge branch 'master' of git://repo.or.cz/git-gui

* 'master' of git://repo.or.cz/git-gui:
  git-gui: apply color information from git diff output
  git-gui: use wordprocessor tab style to ensure tabs work as expected
  git-gui: correct assignment of work-tree
  git-gui: use full dialog width for old name when renaming branch
  git-gui: generic version trimming
  git-gui: enable the Tk console when tracing/debugging on Windows
  git-gui: show command-line errors in a messagebox on Windows
  On Windows, avoid git-gui to call Cygwin's nice utility

13 years agoMerge branch 'maint'
Junio C Hamano [Fri, 5 Nov 2010 17:36:49 +0000 (10:36 -0700)]
Merge branch 'maint'

* maint:
  Fix a formatting error in git-merge.txt

13 years agoclone: Add the --recurse-submodules option as alias for --recursive
Jens Lehmann [Thu, 4 Nov 2010 20:27:12 +0000 (21:27 +0100)]
clone: Add the --recurse-submodules option as alias for --recursive

Since 1.6.5 "git clone" honors the --recursive option to recursively check
out submodules too. As this option can easily be misinterpreted when it is
added to other commands like "git grep", add the new --recurse-submodules
option as an alias for --recursive so the same option can be used for all
commands recursing into submodules.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodocs: clarify git diff modes of operation
Jeff King [Thu, 4 Nov 2010 21:17:29 +0000 (17:17 -0400)]
docs: clarify git diff modes of operation

It is an oversimplification to say that we can take
"[<commit> [<commit>]]", as it really depends on what
options have been given. Instead, let's list the major modes
of operation separately, as we do in other manpages.

This patch also adjusts the text immediately after the
synopsis to match the lines given in the synopsis.

For git-difftool, which has the same issue, let's refer the
user to the git-diff manpage rather than spelling it all out
again.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodiff,difftool: Don't use the {0,2} notation in usage strings
Štěpán Němec [Thu, 4 Nov 2010 17:18:17 +0000 (18:18 +0100)]
diff,difftool: Don't use the {0,2} notation in usage strings

This was the only occurence of that usage, and square brackets are
sufficient and already well-established for that purpose.

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoCodingGuidelines: Add a section on writing documentation
Štěpán Němec [Thu, 4 Nov 2010 17:12:48 +0000 (18:12 +0100)]
CodingGuidelines: Add a section on writing documentation

Provide a few examples on argument and option notation in usage strings
and command synopses.

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodaemon: opt-out on features that require posix
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:24 +0000 (02:35 +0100)]
daemon: opt-out on features that require posix

Windows does not supply the POSIX-functions fork(), setuuid(), setgid(),
setsid() and initgroups(). Error out if --user or --detach is specified
when if so.

MinGW doesn't have prototypes and headers for inet_ntop and inet_pton,
so include our implementation instead. MSVC does, so avoid doing so
there.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodaemon: make --inetd and --detach incompatible
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:23 +0000 (02:35 +0100)]
daemon: make --inetd and --detach incompatible

Since --inetd makes main return with the result of execute() before
daemonize is gets called, these two options are already incompatible.

Document it, and add an error if attempted.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodaemon: use socklen_t
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:22 +0000 (02:35 +0100)]
daemon: use socklen_t

Windows's accept()-function takes the last argument as an int, but glibc
takes an unsigned int. Use socklen_t to get rid of a warning. This is
basically a revert of 7fa0908, but we have already been depending on
socklen_t existing since June 2006 (commit 5b276ee4). I guess this means
that socklen_t IS defined on OSX after all - at least in recent headers.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: use poll-emulation from gnulib
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:21 +0000 (02:35 +0100)]
mingw: use poll-emulation from gnulib

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: import poll-emulation from gnulib
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:20 +0000 (02:35 +0100)]
mingw: import poll-emulation from gnulib

copy lib/poll.c and lib/poll.in.h verbatim from commit 0a05120 in
git://git.savannah.gnu.org/gnulib.git to compat/win32/sys/poll.[ch]

To upgrade this code in the future, branch out from this commit, copy
new versions of the files above on top, and merge back the result.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodaemon: get remote host address from root-process
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:19 +0000 (02:35 +0100)]
daemon: get remote host address from root-process

Get remote host in the process that accept() and pass it through
the REMOTE_ADDR environment variable to the handler-process.
Introduce the REMOTE_PORT environmen variable for the port.

Use these variables for reporting instead of doing
getpeername(0, ...), which doesn't work on Windows.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoImprove the mingw getaddrinfo stub to handle more use cases
Martin Storsjö [Thu, 4 Nov 2010 01:35:18 +0000 (02:35 +0100)]
Improve the mingw getaddrinfo stub to handle more use cases

Allow the node parameter to be null, which is used for getting
the default bind address.

Also allow the hints parameter to be null, to improve standard
conformance of the stub implementation a little.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodaemon: use full buffered mode for stderr
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:17 +0000 (02:35 +0100)]
daemon: use full buffered mode for stderr

Windows doesn't support line buffered mode for file
streams, so let's just use full buffered mode with
a big buffer ("4096 should be enough for everyone")
and add explicit flushing.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodaemon: use run-command api for async serving
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:16 +0000 (02:35 +0100)]
daemon: use run-command api for async serving

fork() is only available on POSIX, so to support git-daemon
on Windows we have to use something else.

Instead we invent the flag --serve, which is a stripped down
version of --inetd-mode. We use start_command() to call
git-daemon with this flag appended to serve clients.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: add kill emulation
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:15 +0000 (02:35 +0100)]
mingw: add kill emulation

This is a quite limited kill-emulation; it can only handle
SIGTERM on positive pids. However, it's enough for git-daemon.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: support waitpid with pid > 0 and WNOHANG
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:14 +0000 (02:35 +0100)]
mingw: support waitpid with pid > 0 and WNOHANG

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: use real pid
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:13 +0000 (02:35 +0100)]
mingw: use real pid

The Windows port have so far been using process handles in place
of PID. However, this is not work consistent with what getpid
returns.

PIDs are system-global identifiers, but process handles are local
to a process. Using PIDs instead of process handles allows, for
instance, a user to kill a hung process with the Task Manager,
something that would have been impossible with process handles.

Change the code to use the real PID, and use OpenProcess to get a
process-handle. Store the PID and the process handle in a linked
list protected by a critical section, so we can safely close the
process handle later.

Linked list code written by Pat Thoyts.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoinet_ntop: fix a couple of old-style decls
Erik Faye-Lund [Thu, 4 Nov 2010 01:35:12 +0000 (02:35 +0100)]
inet_ntop: fix a couple of old-style decls

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocompat: add inet_pton and inet_ntop prototypes
Mike Pape [Thu, 4 Nov 2010 01:35:11 +0000 (02:35 +0100)]
compat: add inet_pton and inet_ntop prototypes

Windows doesn't have inet_pton and inet_ntop, so
add prototypes in git-compat-util.h for them.

At the same time include git-compat-util.h in
the sources for these functions, so they use the
network-wrappers from there on Windows.

Signed-off-by: Mike Pape <dotzenlabs@gmail.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: implement syslog
Mike Pape [Thu, 4 Nov 2010 01:35:10 +0000 (02:35 +0100)]
mingw: implement syslog

Syslog does not usually exist on Windows, so implement our own using
Window's ReportEvent mechanism.

Strings containing "%1" gets expanded into them selves by ReportEvent,
resulting in an unreadable string. "%2" and above is not a problem.
Unfortunately, on Windows an IPv6 address can contain "%1", so expand
"%1" to "% 1" before reporting. "%%1" is also a problem for ReportEvent,
but that string cannot occur in an IPv6 address.

Signed-off-by: Mike Pape <dotzenlabs@gmail.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomingw: add network-wrappers for daemon
Mike Pape [Thu, 4 Nov 2010 01:35:09 +0000 (02:35 +0100)]
mingw: add network-wrappers for daemon

git-daemon requires some socket-functionality that is not yet
supported in the Windows-port. This patch adds said functionality,
and makes sure WSAStartup gets called by socket(), since it is the
first network-call in git-daemon.

Signed-off-by: Mike Pape <dotzenlabs@gmail.com>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd tests of commit --squash
Pat Notz [Tue, 2 Nov 2010 19:59:12 +0000 (13:59 -0600)]
add tests of commit --squash

t7500: test expected behavior of commit --squash
t3415: test interaction of commit --squash with rebase --autosquash
t3900: test commit --squash with i18n encodings

Signed-off-by: Pat Notz <patnotz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit: --squash option for use with rebase --autosquash
Pat Notz [Tue, 2 Nov 2010 19:59:11 +0000 (13:59 -0600)]
commit: --squash option for use with rebase --autosquash

This option makes it convenient to construct commit messages for use
with 'rebase --autosquash'.  The resulting commit message will be
"squash! ..." where "..." is the subject line of the specified commit
message.  This option can be used with other commit message options
such as -m, -c, -C and -F.

If an editor is invoked (as with -c or -eF or no message options) the
commit message is seeded with the correctly formatted subject line.

Example usage:
  $ git commit --squash HEAD~2
  $ git commit --squash HEAD~2 -m "clever comment"
  $ git commit --squash HEAD~2 -F msgfile
  $ git commit --squash HEAD~2 -C deadbeef

Signed-off-by: Pat Notz <patnotz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd tests of commit --fixup
Pat Notz [Tue, 2 Nov 2010 19:59:10 +0000 (13:59 -0600)]
add tests of commit --fixup

t7500: test expected behavior of commit --fixup
t3415: test interaction of commit --fixup with rebase --autosquash
t3900: test commit --fixup with i18n encodings

Signed-off-by: Pat Notz <patnotz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit: --fixup option for use with rebase --autosquash
Pat Notz [Tue, 2 Nov 2010 19:59:09 +0000 (13:59 -0600)]
commit: --fixup option for use with rebase --autosquash

This option makes it convenient to construct commit messages for use
with 'rebase --autosquash'.  The resulting commit message will be
"fixup! ..." where "..." is the subject line of the specified commit
message.

Example usage:
  $ git commit --fixup HEAD~2

Signed-off-by: Pat Notz <patnotz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agopretty.c: teach format_commit_message() to reencode the output
Pat Notz [Tue, 2 Nov 2010 19:59:08 +0000 (13:59 -0600)]
pretty.c: teach format_commit_message() to reencode the output

format_commit_message() will now reencode the content if the desired
output encoding is different from the encoding in the passed in
commit.  Callers wanting to specify the output encoding do so via the
pretty_print_context struct.

Signed-off-by: Pat Notz <patnotz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocommit: helper methods to reduce redundant blocks of code
Pat Notz [Tue, 2 Nov 2010 19:59:07 +0000 (13:59 -0600)]
commit: helper methods to reduce redundant blocks of code

* builtin/commit.c: Replace block of code with a one-liner call to
  logmsg_reencode().

* commit.c: new function for looking up a comit by name

* pretty.c: helper methods for getting output encodings

  Add helpers get_log_output_encoding() and
  get_commit_output_encoding() that eliminate some messy and duplicate
  if-blocks.

Signed-off-by: Pat Notz <patnotz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agopull: Remove --tags option from manpage
Jens Lehmann [Wed, 3 Nov 2010 20:55:48 +0000 (21:55 +0100)]
pull: Remove --tags option from manpage

"Fetch all tags and merge them" does not make any sense as a request at
the logical level, even though it might be more convenient to type.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosubmodule: only preserve flags across recursive status/update invocations
Kevin Ballard [Wed, 3 Nov 2010 06:26:25 +0000 (23:26 -0700)]
submodule: only preserve flags across recursive status/update invocations

Recursive invocations of submodule update/status preserve all arguments,
so executing

        git submodule update --recursive -- foo

attempts to recursively update a submodule named "foo".

Naturally, this fails as one cannot have an infinitely-deep stack of
submodules each containing a submodule named "foo". The desired behavior
is instead to update foo and then recursively update all submodules
inside of foo.

This commit accomplishes that by only saving the flags for use in the
recursive invocation.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosubmodule: preserve all arguments exactly when recursing
Kevin Ballard [Wed, 3 Nov 2010 06:26:24 +0000 (23:26 -0700)]
submodule: preserve all arguments exactly when recursing

Shell variables only hold strings, not lists of parameters,
so $orig_args after

        orig_args="$@"

fails to remember where each parameter starts and ends, if
some include whitespace.  So

        git submodule update \
                --reference='/var/lib/common objects.git' \
                --recursive --init

becomes

        git submodule update --reference=/var/lib/common \
                objects.git --recursive --init

in the inner repositories.  Use "git rev-parse --sq-quote" to
save parameters in quoted form ready for evaluation by the
shell, avoiding this problem.

Helped-By: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-blame.el: Add (require 'format-spec)
David Kågedal [Tue, 25 May 2010 13:44:15 +0000 (15:44 +0200)]
git-blame.el: Add (require 'format-spec)

c5022f57 (git-blame.el: Change how blame information is shown,
2009-09-29) taught the "M-x git-blame" mode to format its output
in a more interesting way, making use of the format-spec function.

format-spec is included in Emacs 23 and is a useful function.
Older emacsen can get it from Gnus.  In all emacsen, we need
to 'require it before use to avoid warnings:

 git-blame.el:483:1:Warning: the function `format-spec' is not known to be
     defined.

Reported-by: Sergei Organov <osv@javad.com>
Reported-by: Kevin Ryde <user42@zip.com.au>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>