Code

git.git
12 years agoSync with 1.7.8.5
Junio C Hamano [Mon, 27 Feb 2012 00:42:35 +0000 (16:42 -0800)]
Sync with 1.7.8.5

12 years agoGit 1.7.8.5 v1.7.8.5
Junio C Hamano [Mon, 27 Feb 2012 00:40:20 +0000 (16:40 -0800)]
Git 1.7.8.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogrep -P: Fix matching ^ and $
Michał Kiedrowicz [Sat, 25 Feb 2012 09:24:28 +0000 (10:24 +0100)]
grep -P: Fix matching ^ and $

When "git grep" is run with -P/--perl-regexp, it doesn't match ^ and $ at
the beginning/end of the line.  This is because PCRE normally matches ^
and $ at the beginning/end of the whole text, not for each line, and "git
grep" passes a large chunk of text (possibly containing many lines) to
pcre_exec() and then splits the text into lines.

This makes "git grep -P" behave differently from "git grep -E" and also
from "grep -P" and "pcregrep":

$ cat file
a
 b
$ git grep --no-index -P '^ ' file
$ git grep --no-index -E '^ ' file
file: b
$ grep -c -P '^ ' file
 b
$ pcregrep -c '^ ' file
 b

Reported-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoam: don't infloop for an empty input file
Jim Meyering [Sat, 25 Feb 2012 17:34:26 +0000 (18:34 +0100)]
am: don't infloop for an empty input file

git-am.sh's check_patch_format function would attempt to preview
the patch to guess its format, but would go into an infinite loop
when the patch file happened to be empty.  The solution: exit the
loop when "read" fails, not when the line var, "$l1" becomes empty.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agorebase -m: only call "notes copy" when rewritten exists and is non-empty
Andrew Wong [Sat, 25 Feb 2012 04:31:22 +0000 (23:31 -0500)]
rebase -m: only call "notes copy" when rewritten exists and is non-empty

This prevents a shell error complaining rebase-merge/rewritten doesn't exist.

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-p4: remove bash-ism in t9800
Pete Wyckoff [Sun, 26 Feb 2012 15:37:27 +0000 (10:37 -0500)]
git-p4: remove bash-ism in t9800

This works in both bash and dash:

    $ bash -c 'VAR=1 env' | grep VAR
    VAR=1
    $ dash -c 'VAR=1 env' | grep VAR
    VAR=1

But environment variables assigned this way are not necessarily propagated
through a function in POSIX compliant shells:

    $ bash -c 'f() { "$@"
    }; VAR=1 f "env"' | grep VAR
    VAR=1
    $ dash -c 'f() { "$@"
    }; VAR=1 f "env"' | grep VAR

Fix constructs like this, in particular, setting variables through
test_must_fail.

Based-on-patch-by: Vitor Antunes <vitor.hda@gmail.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-p4: remove bash-ism in t9809
Pete Wyckoff [Sun, 26 Feb 2012 15:37:26 +0000 (10:37 -0500)]
git-p4: remove bash-ism in t9809

Plain old $# works to count the number of arguments in
either bash or dash, even if the arguments have spaces.

Based-on-patch-by: Vitor Antunes <vitor.hda@gmail.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-p4: fix submit regression with clientSpec and subdir clone
Pete Wyckoff [Sun, 26 Feb 2012 01:06:25 +0000 (20:06 -0500)]
git-p4: fix submit regression with clientSpec and subdir clone

When the --use-client-spec is given to clone, and the clone
path is a subset of the full tree as specified in the client,
future submits will go to the wrong place.

Factor out getClientSpec() so both clone/sync and submit can
use it.  Introduce getClientRoot() that is needed for the client
spec case, and use it instead of p4Where().

Test the five possible submit behaviors (add, modify, rename,
copy, delete).

Reported-by: Laurent Charrière <lcharriere@promptu.com>
Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-p4: set useClientSpec variable on initial clone
Pete Wyckoff [Sun, 26 Feb 2012 01:06:24 +0000 (20:06 -0500)]
git-p4: set useClientSpec variable on initial clone

If --use-client-spec was given, set the matching configuration
variable.  This is necessary to ensure that future submits
work properly.

The alternatives of requiring the user to set it, or providing
a command-line option on every submit, are error prone.

Signed-off-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMakefile: add thread-utils.h to LIB_H
Dmitry V. Levin [Fri, 24 Feb 2012 23:42:42 +0000 (03:42 +0400)]
Makefile: add thread-utils.h to LIB_H

Starting with commit v1.7.8-165-g0579f91, grep.h includes
thread-utils.h, so the latter has to be added to LIB_H.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
Acked-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoREADME: point to Documentation/SubmittingPatches
Matthieu Moy [Thu, 23 Feb 2012 12:52:06 +0000 (13:52 +0100)]
README: point to Documentation/SubmittingPatches

It was indeed not obvious for new contributors to find this document in
the source tree, since there were no reference to it outside the
Documentation/ directory.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDocument merge.branchdesc configuration variable
Junio C Hamano [Thu, 23 Feb 2012 19:20:15 +0000 (11:20 -0800)]
Document merge.branchdesc configuration variable

This was part of the "branch description" feature in the larger
"help people communicate better during their pull based workflow"
topic, but was never documented.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.9.2 v1.7.9.2
Junio C Hamano [Thu, 23 Feb 2012 01:48:01 +0000 (17:48 -0800)]
Git 1.7.9.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocompletion: use tabs for indentation
Philip Jägenstedt [Wed, 22 Feb 2012 08:58:13 +0000 (09:58 +0100)]
completion: use tabs for indentation

CodingGuidlines confidently declares "We use tabs for indentation."
It would be a shame if it were caught lying.

Signed-off-by: Philip Jägenstedt <philip@foolip.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocompletion: remove stale "to submit patches" documentation
Philip Jägenstedt [Wed, 22 Feb 2012 08:58:12 +0000 (09:58 +0100)]
completion: remove stale "to submit patches" documentation

It was out-of-sync with the reality of who works on this
script. Defer (silently) to Documentation/SubmittingPatches
like all other code.

Signed-off-by: Philip Jägenstedt <philip@foolip.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoUpdate draft release notes to 1.7.9.2
Junio C Hamano [Tue, 21 Feb 2012 23:16:34 +0000 (15:16 -0800)]
Update draft release notes to 1.7.9.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'cb/receive-pack-keep-errors' into maint
Junio C Hamano [Tue, 21 Feb 2012 23:14:41 +0000 (15:14 -0800)]
Merge branch 'cb/receive-pack-keep-errors' into maint

* cb/receive-pack-keep-errors:
  do not override receive-pack errors

12 years agoMerge branch 'cb/transfer-no-progress' into maint
Junio C Hamano [Tue, 21 Feb 2012 23:14:37 +0000 (15:14 -0800)]
Merge branch 'cb/transfer-no-progress' into maint

* cb/transfer-no-progress:
  push/fetch/clone --no-progress suppresses progress output

12 years agoMerge branch 'jk/git-dir-lookup' into maint
Junio C Hamano [Tue, 21 Feb 2012 23:13:16 +0000 (15:13 -0800)]
Merge branch 'jk/git-dir-lookup' into maint

* jk/git-dir-lookup:
  standardize and improve lookup rules for external local repos

12 years agoMerge branch 'jc/diff-stat-scaler' into maint
Junio C Hamano [Tue, 21 Feb 2012 23:00:33 +0000 (15:00 -0800)]
Merge branch 'jc/diff-stat-scaler' into maint

* jc/diff-stat-scaler:
  diff --stat: show bars of same length for paths with same amount of changes

12 years agoMerge branch 'zj/term-columns' into maint
Junio C Hamano [Tue, 21 Feb 2012 23:00:15 +0000 (15:00 -0800)]
Merge branch 'zj/term-columns' into maint

* zj/term-columns:
  pager: find out the terminal width before spawning the pager

12 years agoMerge branch 'cb/maint-rev-list-verify-object' into maint
Junio C Hamano [Tue, 21 Feb 2012 22:59:35 +0000 (14:59 -0800)]
Merge branch 'cb/maint-rev-list-verify-object' into maint

* cb/maint-rev-list-verify-object:
  git rev-list: fix invalid typecast

12 years agoMerge branch 'cb/maint-t5541-make-server-port-portable' into maint
Junio C Hamano [Tue, 21 Feb 2012 22:57:40 +0000 (14:57 -0800)]
Merge branch 'cb/maint-t5541-make-server-port-portable' into maint

* cb/maint-t5541-make-server-port-portable:
  t5541: check error message against the real port number used

12 years agoMerge branch 'dp/i18n-libcharset' into maint
Junio C Hamano [Tue, 21 Feb 2012 22:57:14 +0000 (14:57 -0800)]
Merge branch 'dp/i18n-libcharset' into maint

* dp/i18n-libcharset:
  Makefile: introduce CHARSET_LIB to link with -lcharset

12 years agoMerge branch 'jk/grep-binary-attribute' into maint
Junio C Hamano [Tue, 21 Feb 2012 22:57:05 +0000 (14:57 -0800)]
Merge branch 'jk/grep-binary-attribute' into maint

* jk/grep-binary-attribute:
  grep: pre-load userdiff drivers when threaded
  grep: load file data after checking binary-ness
  grep: respect diff attributes for binary-ness
  grep: cache userdiff_driver in grep_source
  grep: drop grep_buffer's "name" parameter
  convert git-grep to use grep_source interface
  grep: refactor the concept of "grep source" into an object
  grep: move sha1-reading mutex into low-level code
  grep: make locking flag global

12 years agoMerge branch 'nd/diffstat-gramnum' into maint
Junio C Hamano [Tue, 21 Feb 2012 22:56:39 +0000 (14:56 -0800)]
Merge branch 'nd/diffstat-gramnum' into maint

* nd/diffstat-gramnum:
  Use correct grammar in diffstat summary line

12 years agoMerge branch 'nd/find-pack-entry-recent-cache-invalidation' into maint
Junio C Hamano [Tue, 21 Feb 2012 22:56:36 +0000 (14:56 -0800)]
Merge branch 'nd/find-pack-entry-recent-cache-invalidation' into maint

* nd/find-pack-entry-recent-cache-invalidation:
  find_pack_entry(): do not keep packed_git pointer locally
  sha1_file.c: move the core logic of find_pack_entry() into fill_pack_entry()

12 years agoMerge branch 'tt/profile-build-fix' into maint
Junio C Hamano [Tue, 21 Feb 2012 22:56:06 +0000 (14:56 -0800)]
Merge branch 'tt/profile-build-fix' into maint

* tt/profile-build-fix:
  Makefile: fix syntax for older make
  Fix build problems related to profile-directed optimization

12 years agoMerge branch 'fc/zsh-completion' into maint
Junio C Hamano [Tue, 21 Feb 2012 22:55:50 +0000 (14:55 -0800)]
Merge branch 'fc/zsh-completion' into maint

* fc/zsh-completion:
  completion: simplify __gitcomp and __gitcomp_nl implementations
  completion: use ls -1 instead of rolling a loop to do that ourselves
  completion: work around zsh option propagation bug

12 years agocompletion: Allow dash as the first character for __git_ps1
Christian Hammerl [Mon, 20 Feb 2012 12:17:53 +0000 (13:17 +0100)]
completion: Allow dash as the first character for __git_ps1

If the argument for `__git_ps1` begins with a dash, `printf` tries to
interpret it as an option which results in an error message.
The problem is solved by adding '--' before the argument to tell
`printf` to not interpret the following argument as an option.
Adding '--' directly to the argument does not help because the argument
is enclosed by double quotes.

Signed-off-by: Christian Hammerl <info@christian-hammerl.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoUpdate draft release notes to 1.7.9.2
Junio C Hamano [Mon, 20 Feb 2012 08:14:00 +0000 (00:14 -0800)]
Update draft release notes to 1.7.9.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: Fix 'grep' search for multiple matches in file
Jakub Narebski [Wed, 15 Feb 2012 16:37:06 +0000 (17:37 +0100)]
gitweb: Fix 'grep' search for multiple matches in file

Commit ff7f218 (gitweb: Fix file links in "grep" search, 2012-01-05),
added $file_href variable, to reduce duplication and have the fix
applied in single place.

Unfortunately it made variable defined inside the loop, not taking into
account the fact that $file_href was set only if file changed.
Therefore for files with multiple matches $file_href was undefined for
second and subsequent matches.

Fix this bug by moving $file_href declaration outside loop.

Adds tests for almost all forms of sarch in gitweb, which were missing
from testuite.  Note that it only tests if there are no warnings, and
it doesn't check that gitweb finds what it should find.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoUpdate draft release notes to 1.7.9.2
Junio C Hamano [Thu, 16 Feb 2012 22:26:32 +0000 (14:26 -0800)]
Update draft release notes to 1.7.9.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/checkout-out-of-unborn' into maint
Junio C Hamano [Thu, 16 Feb 2012 22:18:06 +0000 (14:18 -0800)]
Merge branch 'jc/checkout-out-of-unborn' into maint

* jc/checkout-out-of-unborn:
  git checkout -b: allow switching out of an unborn branch

12 years agoMerge branch 'jc/maint-mailmap-output' into maint
Junio C Hamano [Thu, 16 Feb 2012 22:18:03 +0000 (14:18 -0800)]
Merge branch 'jc/maint-mailmap-output' into maint

* jc/maint-mailmap-output:
  mailmap: always return a plain mail address from map_user()

12 years agoMerge branch 'jk/prompt-fallback-to-tty' into maint
Junio C Hamano [Thu, 16 Feb 2012 22:18:00 +0000 (14:18 -0800)]
Merge branch 'jk/prompt-fallback-to-tty' into maint

* jk/prompt-fallback-to-tty:
  prompt: fall back to terminal if askpass fails
  prompt: clean up strbuf usage

12 years agoMerge branch 'jn/gitweb-search-utf-8' into maint
Junio C Hamano [Thu, 16 Feb 2012 22:17:58 +0000 (14:17 -0800)]
Merge branch 'jn/gitweb-search-utf-8' into maint

* jn/gitweb-search-utf-8:
  gitweb: Allow UTF-8 encoded CGI query parameters and path_info

12 years agoMerge branch 'jc/maint-commit-ignore-i-t-a' into maint
Junio C Hamano [Thu, 16 Feb 2012 22:08:00 +0000 (14:08 -0800)]
Merge branch 'jc/maint-commit-ignore-i-t-a' into maint

* jc/maint-commit-ignore-i-t-a:
  commit: ignore intent-to-add entries instead of refusing

Conflicts:
cache-tree.c

12 years agoMerge branch 'mm/empty-loose-error-message' into maint
Junio C Hamano [Thu, 16 Feb 2012 22:00:25 +0000 (14:00 -0800)]
Merge branch 'mm/empty-loose-error-message' into maint

* mm/empty-loose-error-message:
  fsck: give accurate error message on empty loose object files

12 years agoMerge branch 'nk/ctype-for-perf' into maint
Junio C Hamano [Thu, 16 Feb 2012 22:00:16 +0000 (14:00 -0800)]
Merge branch 'nk/ctype-for-perf' into maint

* nk/ctype-for-perf:
  ctype: implement islower/isupper macro
  ctype.c only wants git-compat-util.h

12 years agoMerge branch 'jx/i18n-more-marking' into maint
Junio C Hamano [Thu, 16 Feb 2012 21:59:53 +0000 (13:59 -0800)]
Merge branch 'jx/i18n-more-marking' into maint

* jx/i18n-more-marking:
  i18n: format_tracking_info "Your branch is behind" message
  i18n: git-commit whence_s "merge/cherry-pick" message

12 years agoman: rearrange git synopsis to fit in 80 lines
Zbigniew Jędrzejewski-Szmek [Tue, 14 Feb 2012 23:54:21 +0000 (00:54 +0100)]
man: rearrange git synopsis to fit in 80 lines

The line was extended in 2dd8c3 ('git: add --info-path and --man-path
options'), and the formatted man output stopped fitting into the 80
column window.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocompletion: --list option for git-branch
Ralf Thielow [Wed, 15 Feb 2012 20:36:58 +0000 (21:36 +0100)]
completion: --list option for git-branch

Signed-off-by: Ralf Thielow <ralf.thielow@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'rt/completion-branch-edit-desc' into maint
Junio C Hamano [Thu, 16 Feb 2012 20:33:46 +0000 (12:33 -0800)]
Merge branch 'rt/completion-branch-edit-desc' into maint

* rt/completion-branch-edit-desc:
  completion: --edit-description option for git-branch

12 years agodiff --stat: show bars of same length for paths with same amount of changes
Junio C Hamano [Tue, 14 Feb 2012 21:49:11 +0000 (13:49 -0800)]
diff --stat: show bars of same length for paths with same amount of changes

When commit 3ed74e6 (diff --stat: ensure at least one '-' for deletions,
and one '+' for additions, 2006-09-28) improved the output for files with
tiny modifications, we accidentally broke the logic to ensure that two
equal sized changes are shown with the bars of the same length, even when
rounding errors exist.

Compute the length of the graph bars, using the same "non-zero changes is
shown with at least one column" scaling logic, but by scaling the sum of
additions and deletions to come up with the total length of the bar (this
ensures that two equal sized changes result in bars of the same length),
and then scaling the smaller of the additions or deletions. The other side
is computed as the difference between the two.

This makes the apportioning between additions and deletions less accurate
due to rounding errors, but it is much less noticeable than two files with
the same amount of change showing bars of different length.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.9.1 v1.7.9.1
Junio C Hamano [Tue, 14 Feb 2012 17:53:38 +0000 (09:53 -0800)]
Git 1.7.9.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jk/maint-tag-show-fixes' into maint
Junio C Hamano [Tue, 14 Feb 2012 07:31:27 +0000 (23:31 -0800)]
Merge branch 'jk/maint-tag-show-fixes' into maint

* jk/maint-tag-show-fixes:
  tag: do not show non-tag contents with "-n"
  tag: die when listing missing or corrupt objects
  tag: fix output of "tag -n" when errors occur

Conflicts:
t/t7004-tag.sh

12 years agoMerge branch 'bw/inet-pton-ntop-compat' into maint
Junio C Hamano [Tue, 14 Feb 2012 07:26:31 +0000 (23:26 -0800)]
Merge branch 'bw/inet-pton-ntop-compat' into maint

* bw/inet-pton-ntop-compat:
  Drop system includes from inet_pton/inet_ntop compatibility wrappers

12 years agoMerge branch 'mp/make-cleanse-x-for-exe' into maint
Junio C Hamano [Tue, 14 Feb 2012 07:26:25 +0000 (23:26 -0800)]
Merge branch 'mp/make-cleanse-x-for-exe' into maint

* mp/make-cleanse-x-for-exe:
  Explicitly set X to avoid potential build breakage

12 years agoMerge branch 'jn/merge-no-edit-fix' into maint
Junio C Hamano [Tue, 14 Feb 2012 07:24:02 +0000 (23:24 -0800)]
Merge branch 'jn/merge-no-edit-fix' into maint

* jn/merge-no-edit-fix:
  merge: do not launch an editor on "--no-edit $tag"

12 years agopager: find out the terminal width before spawning the pager
Zbigniew Jędrzejewski-Szmek [Sun, 12 Feb 2012 14:12:32 +0000 (15:12 +0100)]
pager: find out the terminal width before spawning the pager

term_columns() checks for terminal width via ioctl(2) on the standard
output, but we spawn the pager too early for this check to be useful.

The effect of this buglet can be observed by opening a wide terminal and
running "git -p help --all", which still shows 80-column output, while
"git help --all" uses the full terminal width. Run the check before we
spawn the pager to fix this.

While at it, move term_columns() to pager.c and export it from cache.h so
that callers other than the help subsystem can use it.

Signed-off-by: Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodo not override receive-pack errors
Clemens Buchacher [Mon, 13 Feb 2012 20:17:12 +0000 (21:17 +0100)]
do not override receive-pack errors

Receive runs rev-list --verify-objects in order to detect missing
objects. However, such errors are ignored and overridden later.
Instead, consequently ignore all update commands for which an error has
already been detected.

Some tests in t5504 are obsoleted by this change, because invalid
objects are detected even if fsck is not enabled. Instead, they now test
for different error messages depending on whether or not fsck is turned
on. A better fix would be to force a corruption that will be detected by
fsck but not by rev-list.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot5541: check error message against the real port number used
Clemens Buchacher [Mon, 13 Feb 2012 20:17:14 +0000 (21:17 +0100)]
t5541: check error message against the real port number used

Otherwise the test cannot be run with custom port set to LIB_HTTPD_PORT.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agopush/fetch/clone --no-progress suppresses progress output
Clemens Buchacher [Mon, 13 Feb 2012 20:17:15 +0000 (21:17 +0100)]
push/fetch/clone --no-progress suppresses progress output

By default, progress output is disabled if stderr is not a terminal.
The --progress option can be used to force progress output anyways.
Conversely, --no-progress does not force progress output. In particular,
if stderr is a terminal, progress output is enabled.

This is unintuitive. Change --no-progress to force output off.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit rev-list: fix invalid typecast
Clemens Buchacher [Mon, 13 Feb 2012 20:17:11 +0000 (21:17 +0100)]
git rev-list: fix invalid typecast

git rev-list passes rev_list_info, not rev_list objects. Without this
fix, rev-list enables or disables the --verify-objects option depending
on a read from an undefined memory location.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoUpdate draft release notes to 1.7.9.1
Junio C Hamano [Mon, 13 Feb 2012 19:46:47 +0000 (11:46 -0800)]
Update draft release notes to 1.7.9.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'js/add-e-submodule-fix' into maint
Junio C Hamano [Mon, 13 Feb 2012 19:42:18 +0000 (11:42 -0800)]
Merge branch 'js/add-e-submodule-fix' into maint

* js/add-e-submodule-fix:
  add -e: do not show difference in a submodule that is merely dirty

12 years agoMerge branch 'jc/parse-date-raw' into maint
Junio C Hamano [Mon, 13 Feb 2012 19:42:15 +0000 (11:42 -0800)]
Merge branch 'jc/parse-date-raw' into maint

* jc/parse-date-raw:
  parse_date(): '@' prefix forces git-timestamp
  parse_date(): allow ancient git-timestamp

12 years agoMerge branch 'jc/merge-ff-only-stronger-than-signed-merge' into maint
Junio C Hamano [Mon, 13 Feb 2012 19:42:11 +0000 (11:42 -0800)]
Merge branch 'jc/merge-ff-only-stronger-than-signed-merge' into maint

* jc/merge-ff-only-stronger-than-signed-merge:
  merge: do not create a signed tag merge under --ff-only option

12 years agoMerge branch 'jc/branch-desc-typoavoidance' into maint
Junio C Hamano [Mon, 13 Feb 2012 19:42:07 +0000 (11:42 -0800)]
Merge branch 'jc/branch-desc-typoavoidance' into maint

* jc/branch-desc-typoavoidance:
  branch --edit-description: protect against mistyped branch name
  tests: add write_script helper function

12 years agoMerge branch 'jn/rpm-spec' into maint
Junio C Hamano [Mon, 13 Feb 2012 19:42:04 +0000 (11:42 -0800)]
Merge branch 'jn/rpm-spec' into maint

* jn/rpm-spec:
  git.spec: Workaround localized messages not put in any RPM

12 years agot: use sane_unset instead of unset
Ævar Arnfjörð Bjarmason [Sun, 12 Feb 2012 01:05:12 +0000 (01:05 +0000)]
t: use sane_unset instead of unset

Change several tests to use the sane_unset function introduced in
v1.7.3.1-35-g00648ba instead of the built-in unset function.

This fixes a failure I was having on t9130-git-svn-authors-file.sh on
Solaris, and prevents several other issues from occurring.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoRemove Git's support for smoke testing
Ævar Arnfjörð Bjarmason [Fri, 23 Dec 2011 17:08:18 +0000 (17:08 +0000)]
Remove Git's support for smoke testing

I'm no longer running the Git smoke testing service at
smoke.git.nix.is due to Smolder being a fragile piece of software not
having time to follow through on making it easy for third parties to
run and submit their own smoke tests.

So remove the support in Git for sending smoke tests to
smoke.git.nix.is, it's still easy to modify the test suite to submit
smokes somewhere else.

This reverts the following commits:

    Revert "t/README: Add SMOKE_{COMMENT,TAGS}= to smoke_report target" -- e38efac87d
    Revert "t/README: Document the Smoke testing" -- d15e9ebc5c
    Revert "t/Makefile: Create test-results dir for smoke target" -- 617344d77b
    Revert "tests: Infrastructure for Git smoke testing" -- b6b84d1b74

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMakefile: Change the default compiler from "gcc" to "cc"
Ævar Arnfjörð Bjarmason [Tue, 20 Dec 2011 23:40:47 +0000 (23:40 +0000)]
Makefile: Change the default compiler from "gcc" to "cc"

Ever since the very first commit to git.git we've been setting CC to
"gcc". Presumably this is behavior that Linus copied from the Linux
Makefile.

However unlike Linux Git is written in ANSI C and supports a multitude
of compilers, including Clang, Sun Studio, xlc etc. On my Linux box
"cc" is a symlink to clang, and on a Solaris box I have access to "cc"
is Sun Studio's CC.

Both of these are perfectly capable of compiling Git, and it's
annoying to have to specify CC=cc on the command-line when compiling
Git when that's the default behavior of most other portable programs.

So change the default to "cc". Users who want to compile with GCC can
still add "CC=gcc" to the make(1) command-line, but those users who
don't have GCC as their "cc" will see expected behavior, and as a
bonus we'll be more likely to smoke out new compilation warnings from
our distributors since they'll me using a more varied set of compilers
by default.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMakefile: introduce CHARSET_LIB to link with -lcharset
Дилян Палаузов [Sun, 12 Feb 2012 16:23:36 +0000 (17:23 +0100)]
Makefile: introduce CHARSET_LIB to link with -lcharset

On some systems, the function locale_charset() may not be exported from
libiconv but is available from libcharset, and we need -lcharset when
linking.

Introduce a make variable CHARSET_LIB that can be set to -lcharsetlib
on such systems.  Also autodetect this in the configure script by first
looking for the symbol in libiconv, and then libcharset.

Signed-off-by: Дилян Палаузов <dilyan.palauzov@aegee.org>
12 years agoUpdate draft release notes to 1.7.9.1
Junio C Hamano [Fri, 10 Feb 2012 22:04:20 +0000 (14:04 -0800)]
Update draft release notes to 1.7.9.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/maint-request-pull-for-tag' into maint
Junio C Hamano [Fri, 10 Feb 2012 21:59:02 +0000 (13:59 -0800)]
Merge branch 'jc/maint-request-pull-for-tag' into maint

* jc/maint-request-pull-for-tag:
  request-pull: explicitly ask tags/$name to be pulled

12 years agoMerge branch 'tr/grep-l-with-decoration' into maint
Junio C Hamano [Fri, 10 Feb 2012 21:59:02 +0000 (13:59 -0800)]
Merge branch 'tr/grep-l-with-decoration' into maint

* tr/grep-l-with-decoration:
  grep: fix -l/-L interaction with decoration lines

12 years agoMerge branch 'jl/submodule-re-add' into maint
Junio C Hamano [Fri, 10 Feb 2012 21:59:01 +0000 (13:59 -0800)]
Merge branch 'jl/submodule-re-add' into maint

* jl/submodule-re-add:
  submodule add: fix breakage when re-adding a deep submodule

12 years agoMerge branch 'da/maint-mergetool-twoway' into maint
Junio C Hamano [Fri, 10 Feb 2012 21:59:01 +0000 (13:59 -0800)]
Merge branch 'da/maint-mergetool-twoway' into maint

* da/maint-mergetool-twoway:
  mergetool: Provide an empty file when needed

12 years agoctype: implement islower/isupper macro
Namhyung Kim [Fri, 10 Feb 2012 02:13:31 +0000 (11:13 +0900)]
ctype: implement islower/isupper macro

"perf" uses a the forked copy of this file, and wants to use these two
macros.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoctype.c only wants git-compat-util.h
Namhyung Kim [Fri, 10 Feb 2012 02:13:30 +0000 (11:13 +0900)]
ctype.c only wants git-compat-util.h

The implementation of sane ctype macros only depends on symbols in
git-compat-util.h not cache.h

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoExplicitly set X to avoid potential build breakage
Michael Palimaka [Wed, 8 Feb 2012 10:59:04 +0000 (21:59 +1100)]
Explicitly set X to avoid potential build breakage

$X is appended to binary names for Windows builds (ie. git.exe).
Pollution from the environment can inadvertently trigger this behaviour,
resulting in 'git' turning into 'gitwhatever' without warning.

Signed-off-by: Michael Palimaka <kensington@astralcloak.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agomerge: do not launch an editor on "--no-edit $tag"
Junio C Hamano [Thu, 9 Feb 2012 21:30:52 +0000 (13:30 -0800)]
merge: do not launch an editor on "--no-edit $tag"

When the user explicitly asked us not to, don't launch an editor.

But do everything else the same way as the "edit" case, i.e. leave the
comment with verification result in the log template and record the
mergesig in the resulting merge commit for later inspection.

Based on initiail analysis by Jonathan Nieder.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMakefile: fix syntax for older make
Johannes Sixt [Thu, 9 Feb 2012 08:22:26 +0000 (09:22 +0100)]
Makefile: fix syntax for older make

It is necessary to write the else branch as a nested conditional. Also,
write the conditions with parentheses because we use them throughout the
Makefile.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agotag: do not show non-tag contents with "-n"
Junio C Hamano [Mon, 6 Feb 2012 18:13:27 +0000 (10:13 -0800)]
tag: do not show non-tag contents with "-n"

"git tag -n" did not check the type of the object it is reading the top n
lines from. At least, avoid showing the beginning of trees and blobs when
dealing with lightweight tags that point at them.

As the payload of a tag and a commit look similar in that they both start
with a header block, which is skipped for the purpose of "-n" output,
followed by human readable text, allow the message of commit objects to be
shown just like the contents of tag objects. This avoids regression for
people who have been using "tag -n" to show the log messages of commits
that are pointed at by lightweight tags.

Test script is from Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocommit: ignore intent-to-add entries instead of refusing
Junio C Hamano [Tue, 7 Feb 2012 19:55:48 +0000 (11:55 -0800)]
commit: ignore intent-to-add entries instead of refusing

Originally, "git add -N" was introduced to help users from forgetting to
add new files to the index before they ran "git commit -a".  As an attempt
to help them further so that they do not forget to say "-a", "git commit"
to commit the index as-is was taught to error out, reminding the user that
they may have forgotten to add the final contents of the paths before
running the command.

This turned out to be a false "safety" that is useless.  If the user made
changes to already tracked paths and paths added with "git add -N", and
then ran "git add" to register the final contents of the paths added with
"git add -N", "git commit" will happily create a commit out of the index,
without including the local changes made to the already tracked paths. It
was not a useful "safety" measure to prevent "forgetful" mistakes from
happening.

It turns out that this behaviour is not just a useless false "safety", but
actively hurts use cases of "git add -N" that were discovered later and
have become popular, namely, to tell Git to be aware of these paths added
by "git add -N", so that commands like "git status" and "git diff" would
include them in their output, even though the user is not interested in
including them in the next commit they are going to make.

Fix this ancient UI mistake, and instead make a commit from the index
ignoring the paths added by "git add -N" without adding real contents.

Based on the work by Nguyễn Thái Ngọc Duy, and helped by injection of
sanity from Jonathan Nieder and others on the Git mailing list.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoadd -e: do not show difference in a submodule that is merely dirty
Johannes Schindelin [Tue, 7 Feb 2012 04:05:48 +0000 (05:05 +0100)]
add -e: do not show difference in a submodule that is merely dirty

When the HEAD of the submodule matches what is recorded in the index of
the superproject, and it has local changes or untracked files, the patch
offered by "git add -e" for editing shows a diff like this:

    diff --git a/submodule b/submodule
    <header>
    -deadbeef...
    +deadbeef...-dirty

Because applying such a patch has no effect to the index, this is a
useless noise.  Generate the patch with IGNORE_DIRTY_SUBMODULES flag to
prevent such a change from getting reported.

This patch also loses the "-dirty" suffix from the output when the HEAD of
the submodule is different from what is in the index of the superproject.
As such dirtiness expressed by the suffix does not affect the result of
the patch application at all, there is no information lost if we remove
it. The user could still run "git status" before "git add -e" if s/he
cares about the dirtiness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit checkout -b: allow switching out of an unborn branch
Junio C Hamano [Mon, 30 Jan 2012 20:10:08 +0000 (12:10 -0800)]
git checkout -b: allow switching out of an unborn branch

Running "git checkout -b another" immediately after "git init" when you do
not even have a commit on 'master' fails with:

    $ git checkout -b another
    fatal: You are on a branch yet to be born

This is unnecessary, if we redefine "git checkout -b $name" that does not
take any $start_point (which has to be a commit) as "I want to check out a
new branch $name from the state I am in".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocompletion: simplify __gitcomp and __gitcomp_nl implementations
Felipe Contreras [Thu, 2 Feb 2012 19:48:08 +0000 (11:48 -0800)]
completion: simplify __gitcomp and __gitcomp_nl implementations

These shell functions are written in an unnecessarily verbose way;
simplify their "conditionally use $<number> after checking $# against
<number>" logic by using shell's built-in conditional substitution
facilities.

Also remove the first of the two assignments to IFS in __gitcomp_nl
that does not have any effect.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocompletion: use ls -1 instead of rolling a loop to do that ourselves
Felipe Contreras [Thu, 2 Feb 2012 09:05:29 +0000 (03:05 -0600)]
completion: use ls -1 instead of rolling a loop to do that ourselves

This simplifies the code a great deal.  In particular, it allows us to
get rid of __git_shopt, which is used only in this fuction to enable
'nullglob' in zsh.

[jn: squashed with a patch that actually gets rid of __git_shopt]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocompletion: work around zsh option propagation bug
Felipe Contreras [Thu, 2 Feb 2012 19:26:15 +0000 (11:26 -0800)]
completion: work around zsh option propagation bug

When listing commands in zsh (git <TAB><TAB>), all of them will show up,
instead of only porcelain ones.

The root cause of this is because zsh versions from 4.3.0 to present
(4.3.15) do not correctly propagate the SH_WORD_SPLIT option into the
subshell in ${foo:=$(bar)} expressions. Because of this bug, the list of
all commands was treated as a single word in __git_list_porcelain_commands
and did not match any of the patterns that would usually cause plumbing to
be excluded.

With problematic versions of zsh, after running

emulate sh
fn () {
var='one two'
for v in $var; do echo $v; done
}
x=$(fn)
: ${y=$(fn)}

printing "$x" results in two lines as expected, but printing "$y" results
in a single line because $var is expanded as a single word when evaluating
fn to compute y.

So avoid the construct, and use an explicit 'test -n "$foo" || foo=$(bar)'
instead.

[jn: clarified commit message, indentation style fix]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agomailmap: always return a plain mail address from map_user()
Junio C Hamano [Mon, 6 Feb 2012 01:31:51 +0000 (17:31 -0800)]
mailmap: always return a plain mail address from map_user()

The callers of map_user() give email and name to it, and expect to get the
up-to-date email and/or name to be used in their output. The function
rewrites the given buffers in place. To optimize the majority of cases,
the function returns 0 when it did not do anything, and it returns 1 when
the caller should use the updated contents.

The 'email' input to the function is terminated by '>' or a NUL (whichever
comes first) for historical reasons, but when a rewrite happens, the value
is replaced with the mailbox inside the <> pair.  However, it failed to
meet this expectation when it only rewrote the name part without rewriting
the email part, and the email in the input was terminated by '>'.

This causes an extra '>' to appear in the output of "blame -e", because the
caller does send in '>'-terminated email, and when the function returned 1
to tell it that rewriting happened, it appends '>' that is necessary when
the email part was rewritten.

The patch looks bigger than it actually is, because this change makes a
variable that points at the end of the email part in the input 'p' live
much longer than it used to, deserving a more descriptive name.

Noticed and diagnosed by Felipe Contreras and Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agofsck: give accurate error message on empty loose object files
Matthieu Moy [Mon, 6 Feb 2012 16:24:52 +0000 (17:24 +0100)]
fsck: give accurate error message on empty loose object files

Since 3ba7a065527a (A loose object is not corrupt if it
cannot be read due to EMFILE), "git fsck" on a repository with an empty
loose object file complains with the error message

  fatal: failed to read object <sha1>: Invalid argument

This comes from a failure of mmap on this empty file, which sets errno to
EINVAL. Instead of calling xmmap on empty file, we display a clean error
message ourselves, and return a NULL pointer. The new message is

  error: object file .git/objects/09/<rest-of-sha1> is empty
  fatal: loose object <sha1> (stored in .git/objects/09/<rest-of-sha1>) is corrupt

The second line was already there before the regression in 3ba7a065527a,
and the first is an additional message, that should help diagnosing the
problem for the user.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agotag: die when listing missing or corrupt objects
Jeff King [Mon, 6 Feb 2012 08:13:42 +0000 (03:13 -0500)]
tag: die when listing missing or corrupt objects

We don't usually bother looking at tagged objects at all
when listing. However, if "-n" is specified, we open the
objects to read the annotations of the tags.  If we fail to
read an object, or if the object has zero length, we simply
silently return.

The first case is an indication of a broken or corrupt repo,
and we should notify the user of the error.

The second case is OK to silently ignore; however, the
existing code leaked the buffer returned by read_sha1_file.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agotag: fix output of "tag -n" when errors occur
Jeff King [Mon, 6 Feb 2012 08:13:12 +0000 (03:13 -0500)]
tag: fix output of "tag -n" when errors occur

When "git tag" is instructed to print lines from annotated
tags via "-n", it first prints the tag name, then attempts
to parse and print the lines of the tag object, and then
finally adds a trailing newline.

If an error occurs, we return early from the function and
never print the newline, screwing up the output for the next
tag. Let's factor the line-printing into its own function so
we can manage the early returns better, and make sure that
we always terminate the line.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoFix build problems related to profile-directed optimization
Theodore Ts'o [Mon, 6 Feb 2012 06:00:17 +0000 (01:00 -0500)]
Fix build problems related to profile-directed optimization

There was a number of problems I ran into when trying the
profile-directed optimizations added by Andi Kleen in git commit
7ddc2710b9.  (This was using gcc 4.4 found on many enterprise
distros.)

1) The -fprofile-generate and -fprofile-use commands are incompatible
with ccache; the code ends up looking in the wrong place for the gcda
files based on the ccache object names.

2) If the makefile notices that CFLAGS are different, it will rebuild
all of the binaries.  Hence the recipe originally specified by the
INSTALL file ("make profile-all" followed by "make install") doesn't
work.  It will appear to work, but the binaries will end up getting
built with no optimization.

This patch fixes this by using an explicit set of options passed via
the PROFILE variable then using this to directly manipulate CFLAGS and
EXTLIBS.

The developer can run "make PROFILE=BUILD all ; sudo make
PROFILE=BUILD install" automatically run a two-pass build with the
test suite run in between as the sample workload for the purpose of
recording profiling information to do the profile-directed
optimization.

Alternatively, the profiling version of binaries can be built using:

make PROFILE=GEN PROFILE_DIR=/var/cache/profile all
make PROFILE=GEN install

and then after git has been used for a while, the optimized version of
the binary can be built as follows:

make PROFILE=USE PROFILE_DIR=/var/cache/profile all
make PROFILE=USE install

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoPrepare for 1.7.9.1
Junio C Hamano [Mon, 6 Feb 2012 08:03:18 +0000 (00:03 -0800)]
Prepare for 1.7.9.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocompletion: --edit and --no-edit for git-merge
Adrian Weimann [Mon, 30 Jan 2012 19:29:33 +0000 (20:29 +0100)]
completion: --edit and --no-edit for git-merge

Signed-off-by: Adrian Weimann <adrian.weimann@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'sp/smart-http-failure-to-push' into maint
Junio C Hamano [Mon, 6 Feb 2012 07:58:43 +0000 (23:58 -0800)]
Merge branch 'sp/smart-http-failure-to-push' into maint

* sp/smart-http-failure-to-push:
  remote-curl: Fix push status report when all branches fail

12 years agoMerge branch 'jc/maint-log-first-parent-pathspec' into maint
Junio C Hamano [Mon, 6 Feb 2012 07:58:42 +0000 (23:58 -0800)]
Merge branch 'jc/maint-log-first-parent-pathspec' into maint

* jc/maint-log-first-parent-pathspec:
  Making pathspec limited log play nicer with --first-parent

12 years agoMerge branch 'cb/push-quiet' into maint
Junio C Hamano [Mon, 6 Feb 2012 07:58:42 +0000 (23:58 -0800)]
Merge branch 'cb/push-quiet' into maint

* cb/push-quiet:
  t5541: avoid TAP test miscounting
  fix push --quiet: add 'quiet' capability to receive-pack
  server_supports(): parse feature list more carefully

12 years agoMerge branch 'cb/maint-kill-subprocess-upon-signal' into maint
Junio C Hamano [Mon, 6 Feb 2012 07:58:42 +0000 (23:58 -0800)]
Merge branch 'cb/maint-kill-subprocess-upon-signal' into maint

* cb/maint-kill-subprocess-upon-signal:
  dashed externals: kill children on exit
  run-command: optionally kill children on exit

12 years agoSync with 1.7.6.6
Junio C Hamano [Mon, 6 Feb 2012 07:53:21 +0000 (23:53 -0800)]
Sync with 1.7.6.6

* maint-1.7.8:
  Git 1.7.6.6
  imap-send: remove dead code

12 years agoSync with 1.7.6.6
Junio C Hamano [Mon, 6 Feb 2012 07:52:53 +0000 (23:52 -0800)]
Sync with 1.7.6.6

* maint-1.7.7:
  Git 1.7.6.6
  imap-send: remove dead code

12 years agoSync with 1.7.6.6
Junio C Hamano [Mon, 6 Feb 2012 07:52:25 +0000 (23:52 -0800)]
Sync with 1.7.6.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.6.6 v1.7.6.6
Junio C Hamano [Mon, 6 Feb 2012 07:46:44 +0000 (23:46 -0800)]
Git 1.7.6.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoimap-send: remove dead code
Jeff King [Mon, 6 Feb 2012 06:29:37 +0000 (01:29 -0500)]
imap-send: remove dead code

The imap-send code was adapted from another project, and
still contains many unused bits of code. One of these bits
contains a type "struct string_list" which bears no
resemblence to the "struct string_list" we use elsewhere in
git. This causes the compiler to complain if git's
string_list ever becomes part of cache.h.

Let's just drop the dead code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agobranch --edit-description: protect against mistyped branch name
Junio C Hamano [Mon, 6 Feb 2012 01:13:36 +0000 (17:13 -0800)]
branch --edit-description: protect against mistyped branch name

It is very easy to mistype the branch name when editing its description,
e.g.

$ git checkout -b my-topic master
: work work work
: now we are at a good point to switch working something else
$ git checkout master
: ah, let's write it down before we forget what we were doing
$ git branch --edit-description my-tpoic

The command does not notice that branch 'my-tpoic' does not exist.  It is
not lost (it becomes description of an unborn my-tpoic branch), but is not
very useful.  So detect such a case and error out to reduce the grief
factor from this common mistake.

This incidentally also errors out --edit-description when the HEAD points
at an unborn branch (immediately after "init", or "checkout --orphan"),
because at that point, you do not even have any commit that is part of
your history and there is no point in describing how this particular
branch is different from the branch it forked off of, which is the useful
bit of information the branch description is designed to capture.

We may want to special case the unborn case later, but that is outside the
scope of this patch to prevent more common mistakes before 1.7.9 series
gains too much widespread use.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDrop system includes from inet_pton/inet_ntop compatibility wrappers
Ben Walton [Sun, 5 Feb 2012 22:32:21 +0000 (17:32 -0500)]
Drop system includes from inet_pton/inet_ntop compatibility wrappers

As both of these compatibility wrappers include git-compat-utils.h,
all of the system includes were redundant.

Dropping these system includes also makes git-compat-utils.h the first
include which avoids a compiler warning on Solaris due to the
redefinition of _FILE_OFFSET_BITS.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>