gitweb.git
Merge branch 'bg/t5540-osx-grep'Junio C Hamano Fri, 2 Sep 2011 20:17:50 +0000 (13:17 -0700)

Merge branch 'bg/t5540-osx-grep'

* bg/t5540-osx-grep:
t5540-http-test: shorten grep pattern

Merge branch 'jc/clean-exclude-doc'Junio C Hamano Fri, 2 Sep 2011 20:17:46 +0000 (13:17 -0700)

Merge branch 'jc/clean-exclude-doc'

* jc/clean-exclude-doc:
Documentation: clarify "git clean -e <pattern>"

Merge branch 'mg/maint-notes-C-doc'Junio C Hamano Fri, 2 Sep 2011 20:17:40 +0000 (13:17 -0700)

Merge branch 'mg/maint-notes-C-doc'

* mg/maint-notes-C-doc:
git-notes.txt: clarify -C vs. copy and -F

Merge branch 'fg/submodule-ff-check-before-push'Junio C Hamano Fri, 2 Sep 2011 20:07:58 +0000 (13:07 -0700)

Merge branch 'fg/submodule-ff-check-before-push'

* fg/submodule-ff-check-before-push:
push: Don't push a repository with unpushed submodules

Merge branch 'rc/diff-cleanup-records'Junio C Hamano Fri, 2 Sep 2011 19:07:11 +0000 (12:07 -0700)

Merge branch 'rc/diff-cleanup-records'

* rc/diff-cleanup-records:
xdiff/xprepare: improve O(n*m) performance in xdl_cleanup_records()

Merge branch 'fk/use-kwset-pickaxe-grep-f'Junio C Hamano Fri, 2 Sep 2011 17:00:38 +0000 (10:00 -0700)

Merge branch 'fk/use-kwset-pickaxe-grep-f'

* fk/use-kwset-pickaxe-grep-f:
obstack: Fix portability issues
Use kwset in grep
Use kwset in pickaxe
Adapt the kwset code to Git
Add string search routines from GNU grep
Add obstack.[ch] from EGLIBC 2.10

Merge branch 'en/merge-recursive-2'Junio C Hamano Fri, 2 Sep 2011 17:00:18 +0000 (10:00 -0700)

Merge branch 'en/merge-recursive-2'

* en/merge-recursive-2: (57 commits)
merge-recursive: Don't re-sort a list whose order we depend upon
merge-recursive: Fix virtual merge base for rename/rename(1to2)/add-dest
t6036: criss-cross + rename/rename(1to2)/add-dest + simple modify
merge-recursive: Avoid unnecessary file rewrites
t6022: Additional tests checking for unnecessary updates of files
merge-recursive: Fix spurious 'refusing to lose untracked file...' messages
t6022: Add testcase for spurious "refusing to lose untracked" messages
t3030: fix accidental success in symlink rename
merge-recursive: Fix working copy handling for rename/rename/add/add
merge-recursive: add handling for rename/rename/add-dest/add-dest
merge-recursive: Have conflict_rename_delete reuse modify/delete code
merge-recursive: Make modify/delete handling code reusable
merge-recursive: Consider modifications in rename/rename(2to1) conflicts
merge-recursive: Create function for merging with branchname:file markers
merge-recursive: Record more data needed for merging with dual renames
merge-recursive: Defer rename/rename(2to1) handling until process_entry
merge-recursive: Small cleanups for conflict_rename_rename_1to2
merge-recursive: Fix rename/rename(1to2) resolution for virtual merge base
merge-recursive: Introduce a merge_file convenience function
merge-recursive: Fix modify/delete resolution in the recursive case
...

git-svn: Teach dcommit --mergeinfo to handle multiple... Bryan Jacobs Wed, 31 Aug 2011 16:48:39 +0000 (12:48 -0400)

git-svn: Teach dcommit --mergeinfo to handle multiple lines

"svn dcommit --mergeinfo" replaces the svn:mergeinfo property in an
upstream SVN repository with the given text. The svn:mergeinfo
property may contain commits originating on multiple branches,
separated by newlines.

Cause space characters in the mergeinfo to be replaced by newlines,
allowing a user to create history representing multiple branches being
merged into one.

Update the corresponding documentation and add a test for the new
functionality.

Signed-off-by: Bryan Jacobs <bjacobs@woti.com>
Acked-by: Sam Vilain <sam@vilain.net>
Acked-by: Eric Wong <normalperson@yhbt.net>

git-svn: fix fetch with moved path when using rewriteRootEric Wong Mon, 29 Aug 2011 00:45:44 +0000 (00:45 +0000)

git-svn: fix fetch with moved path when using rewriteRoot

The matching step in commit 3235b7053c45a734c1cdf9b117bda68b7ced29c9
did not properly account for users of the "rewriteRoot"
configuration parameter.

ref: <CANWsHyfHtr0EaJtNsDK9UTcmb_AbLg-1jUA-0uWJ-nEeNosb7w@mail.gmail.com>

Suggested-by: H Krishnan <hetchkay@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>

git-svn: New flag to emulate empty directoriesRay Chen Wed, 20 Jul 2011 22:37:26 +0000 (18:37 -0400)

git-svn: New flag to emulate empty directories

Adds a --preserve-empty-dirs flag to the clone operation that will detect
empty directories in the remote Subversion repository and create placeholder
files in the corresponding local Git directories. This allows "empty"
directories to exist in the history of a Git repository.

Also adds the --placeholder-file flag to control the name of any placeholder
files created. Default value is ".gitignore".

Signed-off-by: Ray Chen <rchen@cs.umd.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>

Merge branch 'maint'Junio C Hamano Tue, 30 Aug 2011 19:35:51 +0000 (12:35 -0700)

Merge branch 'maint'

* maint:
Documentation: clarify effects of -- <path> arguments

Documentation: clarify effects of -- <path> argumentsThomas Rast Tue, 30 Aug 2011 09:21:07 +0000 (11:21 +0200)

Documentation: clarify effects of -- <path> arguments

'git log -- <path>' does not "show commits that affect the specified
paths" in a literal sense unless --full-history is given (for example,
a file that only existed on a side branch will turn up no commits at
all!).

Reword it to specify the actual intent of the filtering, and point to
the "History Simplification" section.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5540-http-test: shorten grep patternBrian Gernhardt Mon, 29 Aug 2011 06:42:21 +0000 (02:42 -0400)

t5540-http-test: shorten grep pattern

On OS X, the grep pattern

"\"OP .*/objects/$x2/X38_X40 HTTP/[.0-9]*\" 20[0-9] "

is too long ($x38 and $x40 represent 38 and 40 copies of [0-9a-f]) for
grep to handle. In order to still be able to match this, use the sed
invocation to replace what we're looking for with a token.

Improved-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: clarify "git clean -e <pattern>"Junio C Hamano Thu, 25 Aug 2011 18:29:57 +0000 (11:29 -0700)

Documentation: clarify "git clean -e <pattern>"

The current explanation of -e can be misread as allowing the user to say

I know 'git clean -XYZ' (substitute -XYZ with any option and/or
parameter) will remove paths A, B, and C, and I want them all removed
except for paths matching this pattern by adding '-e C' to the same
command line, i.e. 'git clean -e C -XYZ'.

But that is not what this option does. It augments the set of ignore rules
from the command line, just like the same "-e <pattern>" argument does
with the "ls-files" command (the user could probably pass "-e \!C" to tell
the command to clean everything the command would normally remove, except
for C). Also error out when both -x and -e are given with an explanation of
what -e means---it is a symptom of misunderstanding what -e does.

It also fixes small style nit in the parameter to add_exclude() call. The
current code only works because EXC_CMDL happens to be defined as 0.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

obstack: Fix portability issuesFredrik Kuivinen Sun, 28 Aug 2011 20:08:46 +0000 (22:08 +0200)

obstack: Fix portability issues

i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1, SunOS 5.10, and possibly
others do not have exit.h and exitfail.h. Remove the use of these in
obstack.c.

The __block variable was renamed to block to avoid a gcc error:

compat/obstack.h:190: error: __block attribute can be specified on variables only

Initial-patch-by: David Aguilar <davvid@gmail.com>
Reported-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Acked-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.7Junio C Hamano Mon, 29 Aug 2011 04:49:35 +0000 (21:49 -0700)

Update draft release notes to 1.7.7

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'nd/decorate-grafts'Junio C Hamano Mon, 29 Aug 2011 04:22:58 +0000 (21:22 -0700)

Merge branch 'nd/decorate-grafts'

* nd/decorate-grafts:
log: Do not decorate replacements with --no-replace-objects
log: decorate "replaced" on to replaced commits
log: decorate grafted commits with "grafted"
Move write_shallow_commits to fetch-pack.c
Add for_each_commit_graft() to iterate all grafts
decoration: do not mis-decorate refs with same prefix

Merge branch 'nd/maint-clone-gitdir'Junio C Hamano Mon, 29 Aug 2011 04:20:28 +0000 (21:20 -0700)

Merge branch 'nd/maint-clone-gitdir'

* nd/maint-clone-gitdir:
clone: allow to clone from .git file
read_gitfile_gently(): rename misnamed function to read_gitfile()

Merge branch 'ci/forbid-unwanted-current-branch-update'Junio C Hamano Mon, 29 Aug 2011 04:19:31 +0000 (21:19 -0700)

Merge branch 'ci/forbid-unwanted-current-branch-update'

* ci/forbid-unwanted-current-branch-update:
Show interpreted branch name in error messages
Prevent force-updating of the current branch

Merge branch 'jk/pager-with-external-command'Junio C Hamano Mon, 29 Aug 2011 04:19:25 +0000 (21:19 -0700)

Merge branch 'jk/pager-with-external-command'

* jk/pager-with-external-command:
support pager.* for external commands

Merge branch 'jc/maint-clone-alternates'Junio C Hamano Mon, 29 Aug 2011 04:19:21 +0000 (21:19 -0700)

Merge branch 'jc/maint-clone-alternates'

* jc/maint-clone-alternates:
clone: clone from a repository with relative alternates
clone: allow more than one --reference

Conflicts:
builtin/clone.c

Merge branch 'jk/color-and-pager'Junio C Hamano Mon, 29 Aug 2011 04:19:16 +0000 (21:19 -0700)

Merge branch 'jk/color-and-pager'

* jk/color-and-pager:
want_color: automatically fallback to color.ui
diff: don't load color config in plumbing
config: refactor get_colorbool function
color: delay auto-color decision until point of use
git_config_colorbool: refactor stdout_is_tty handling
diff: refactor COLOR_DIFF from a flag into an int
setup_pager: set GIT_PAGER_IN_USE
t7006: use test_config helpers
test-lib: add helper functions for config
t7006: modernize calls to unset

Conflicts:
builtin/commit.c
parse-options.c

Merge branch 'mh/attr'Junio C Hamano Mon, 29 Aug 2011 04:19:12 +0000 (21:19 -0700)

Merge branch 'mh/attr'

* mh/attr:
Unroll the loop over passes
Change while loop into for loop
Determine the start of the states outside of the pass loop
Change parse_attr() to take a pointer to struct attr_state
Increment num_attr in parse_attr_line(), not parse_attr()
Document struct match_attr
Add a file comment

Merge branch 'di/fast-import-tagging'Junio C Hamano Mon, 29 Aug 2011 04:18:48 +0000 (21:18 -0700)

Merge branch 'di/fast-import-tagging'

* di/fast-import-tagging:
fast-import: allow to tag newly created objects
fast-import: add tests for tagging blobs

Merge branch 'di/fast-import-blob-tweak'Junio C Hamano Mon, 29 Aug 2011 04:18:47 +0000 (21:18 -0700)

Merge branch 'di/fast-import-blob-tweak'

* di/fast-import-blob-tweak:
fast-import: treat cat-blob as a delta base hint for next blob
fast-import: count and report # of calls to diff_delta in stats

Merge branch 'di/fast-import-deltified-tree'Junio C Hamano Mon, 29 Aug 2011 04:18:47 +0000 (21:18 -0700)

Merge branch 'di/fast-import-deltified-tree'

* di/fast-import-deltified-tree:
fast-import: prevent producing bad delta
fast-import: add a test for tree delta base corruption

Merge branch 'di/fast-import-ident'Junio C Hamano Mon, 29 Aug 2011 04:18:47 +0000 (21:18 -0700)

Merge branch 'di/fast-import-ident'

* di/fast-import-ident:
fsck: improve committer/author check
fsck: add a few committer name tests
fast-import: check committer name more strictly
fast-import: don't fail on omitted committer name
fast-import: add input format tests

Merge branch 'bw/doc-repo-layout'Junio C Hamano Mon, 29 Aug 2011 04:15:34 +0000 (21:15 -0700)

Merge branch 'bw/doc-repo-layout'

* bw/doc-repo-layout:
Mark http-fetch without -a as deprecated
Documentation: Grammar correction, wording fixes and cleanup

Merge branch 'va/p4-branch-import'Junio C Hamano Mon, 29 Aug 2011 04:15:34 +0000 (21:15 -0700)

Merge branch 'va/p4-branch-import'

* va/p4-branch-import:
git-p4: Add simple test case for branch import
git-p4: Allow branch definition with git config
git-p4: Allow filtering Perforce branches by user
git-p4: Correct branch base depot path detection
git-p4: Process detectCopiesHarder with --bool
git-p4: Add test case for copy detection
git-p4: Add test case for rename detection
git-p4: Add description of rename/copy detection options
git-p4: Allow setting rename/copy detection threshold

Merge branch 'jc/combine-diff-callback'Junio C Hamano Mon, 29 Aug 2011 04:15:33 +0000 (21:15 -0700)

Merge branch 'jc/combine-diff-callback'

* jc/combine-diff-callback:
combine-diff: support format_callback

Merge branch 'nk/branch-v-abbrev'Junio C Hamano Mon, 29 Aug 2011 04:15:33 +0000 (21:15 -0700)

Merge branch 'nk/branch-v-abbrev'

* nk/branch-v-abbrev:
branch -v: honor core.abbrev

Git 1.7.7-rc0 v1.7.7-rc0Junio C Hamano Fri, 26 Aug 2011 04:00:46 +0000 (21:00 -0700)

Git 1.7.7-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>

log: Do not decorate replacements with --no-replace... Michael J Gruber Thu, 25 Aug 2011 15:09:30 +0000 (17:09 +0200)

log: Do not decorate replacements with --no-replace-objects

5267d29 (log: decorate "replaced" on to replaced commits, 2011-08-19)
introduced textual decorations for replaced commits, based on the
detection of refs/replace.

Make it so that additionally the use of --no-replace-objects is
detected: I.e. replaced commits are only decorated as replaced when they
are actually replaced.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/merge-reword'Junio C Hamano Thu, 25 Aug 2011 23:00:53 +0000 (16:00 -0700)

Merge branch 'jc/merge-reword'

* jc/merge-reword:
merge: reword the final message

Merge branch 'mg/branch-set-upstream-previous'Junio C Hamano Thu, 25 Aug 2011 23:00:49 +0000 (16:00 -0700)

Merge branch 'mg/branch-set-upstream-previous'

* mg/branch-set-upstream-previous:
branch.c: use the parsed branch name

Merge branch 'da/difftool-mergtool-refactor'Junio C Hamano Thu, 25 Aug 2011 23:00:43 +0000 (16:00 -0700)

Merge branch 'da/difftool-mergtool-refactor'

* da/difftool-mergtool-refactor:
mergetools/meld: Use '--output' when available
mergetool--lib: Refactor tools into separate files
mergetool--lib: Make style consistent with git
difftool--helper: Make style consistent with git

Merge branch 'jc/maint-autofix-tag-in-head'Junio C Hamano Thu, 25 Aug 2011 23:00:37 +0000 (16:00 -0700)

Merge branch 'jc/maint-autofix-tag-in-head'

* jc/maint-autofix-tag-in-head:
commit: reduce use of redundant global variables

Merge branch 'di/fast-import-doc'Junio C Hamano Thu, 25 Aug 2011 23:00:32 +0000 (16:00 -0700)

Merge branch 'di/fast-import-doc'

* di/fast-import-doc:
doc/fast-import: document feature import-marks-if-exists

Merge branch 'jn/plug-empty-tree-leak'Junio C Hamano Thu, 25 Aug 2011 23:00:29 +0000 (16:00 -0700)

Merge branch 'jn/plug-empty-tree-leak'

* jn/plug-empty-tree-leak:
merge-recursive: take advantage of hardcoded empty tree
revert: plug memory leak in "cherry-pick root commit" codepath

Merge branch 'ac/describe-dirty-refresh'Junio C Hamano Thu, 25 Aug 2011 23:00:24 +0000 (16:00 -0700)

Merge branch 'ac/describe-dirty-refresh'

* ac/describe-dirty-refresh:
describe: Refresh the index when run with --dirty

Merge branch 'di/parse-options-split'Junio C Hamano Thu, 25 Aug 2011 23:00:20 +0000 (16:00 -0700)

Merge branch 'di/parse-options-split'

* di/parse-options-split:
Reduce parse-options.o dependencies
parse-options: export opterr, optbug

Merge branch 'js/i18n-scripts'Junio C Hamano Thu, 25 Aug 2011 23:00:16 +0000 (16:00 -0700)

Merge branch 'js/i18n-scripts'

* js/i18n-scripts:
submodule: take advantage of gettextln and eval_gettextln.
stash: take advantage of eval_gettextln
pull: take advantage of eval_gettextln
git-am: take advantage of gettextln and eval_gettextln.
gettext: add gettextln, eval_gettextln to encode common idiom

Merge branch 'maint'Junio C Hamano Thu, 25 Aug 2011 23:00:07 +0000 (16:00 -0700)

Merge branch 'maint'

* maint:
whitespace: have SP on both sides of an assignment "="
update-ref: whitespace fix

whitespace: have SP on both sides of an assignment "="Junio C Hamano Thu, 25 Aug 2011 21:46:52 +0000 (14:46 -0700)

whitespace: have SP on both sides of an assignment "="

I've deliberately excluded the borrowed code in compat/nedmalloc
directory.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

update-ref: whitespace fixPang Yan Han Thu, 25 Aug 2011 15:40:50 +0000 (23:40 +0800)

update-ref: whitespace fix

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-notes.txt: clarify -C vs. copy and -FMichael J Gruber Thu, 25 Aug 2011 10:26:37 +0000 (12:26 +0200)

git-notes.txt: clarify -C vs. copy and -F

The current description of '-C' together with the analogy to 'git commit
-C' can lead to the wrong conclusion that '-C' copies notes between
objects. Make this clearer by rewording and pointing to 'copy'.

The example for attaching binary notes with 'git hash-object' followed
by 'git notes add -C' immediately raises the question: "Why not use 'git
notes add -F'?". Answer it (the latter is not binary-safe).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 1.7.6.1Junio C Hamano Wed, 24 Aug 2011 19:18:02 +0000 (12:18 -0700)

Sync with 1.7.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.7.6.1 v1.7.6.1Junio C Hamano Wed, 24 Aug 2011 19:16:58 +0000 (12:16 -0700)

Git 1.7.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/maint-smart-http-race-upload-pack... Junio C Hamano Wed, 24 Aug 2011 19:16:15 +0000 (12:16 -0700)

Merge branch 'jc/maint-smart-http-race-upload-pack' into maint

* jc/maint-smart-http-race-upload-pack:
get_indexed_object can return NULL if nothing is in that slot; check for it

get_indexed_object can return NULL if nothing is in... Brian Harring Wed, 24 Aug 2011 05:47:17 +0000 (22:47 -0700)

get_indexed_object can return NULL if nothing is in that slot; check for it

This fixes a segfault introduced by 051e400; via it, no longer able to
trigger the http/smartserv race.

Signed-off-by: Brian Harring <ferringb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Mark http-fetch without -a as deprecatedBen Walton Wed, 24 Aug 2011 00:29:51 +0000 (20:29 -0400)

Mark http-fetch without -a as deprecated

As the use of http-fetch without -a can create an object store that is
invalid to the point where it cannot even be fsck'd, mark it as
deprecated. A future release should change the default and then
remove the option entirely.

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

Documentation: Grammar correction, wording fixes and... Ben Walton Wed, 24 Aug 2011 00:32:35 +0000 (20:32 -0400)

Documentation: Grammar correction, wording fixes and cleanup

Correct a few grammar issues in gitrepository-layout.txt and also
rewords a few sections for clarity.

Remove references to using http-fetch without -a to create a broken
repository.

Mark a few areas of the repository structure as legacy.

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

Update draft release notes to 1.7.7Junio C Hamano Tue, 23 Aug 2011 22:43:38 +0000 (15:43 -0700)

Update draft release notes to 1.7.7

Merge branch 'rt/zlib-smaller-window'Junio C Hamano Tue, 23 Aug 2011 22:40:33 +0000 (15:40 -0700)

Merge branch 'rt/zlib-smaller-window'

* rt/zlib-smaller-window:
test: consolidate definition of $LF
Tolerate zlib deflation with window size < 32Kb

Merge branch 'jn/maint-test-return'Junio C Hamano Tue, 23 Aug 2011 22:35:26 +0000 (15:35 -0700)

Merge branch 'jn/maint-test-return'

* jn/maint-test-return:
t3900: do not reference numbered arguments from the test script
test: cope better with use of return for errors
test: simplify return value of test_run_

Merge branch 'cb/maint-ls-files-error-report'Junio C Hamano Tue, 23 Aug 2011 22:34:31 +0000 (15:34 -0700)

Merge branch 'cb/maint-ls-files-error-report'

* cb/maint-ls-files-error-report:
ls-files: fix pathspec display on error

Merge branch 'maint'Junio C Hamano Tue, 23 Aug 2011 22:29:08 +0000 (15:29 -0700)

Merge branch 'maint'

* maint:
Update draft release notes for 1.7.6.1

Update draft release notes for 1.7.6.1Junio C Hamano Tue, 23 Aug 2011 22:28:18 +0000 (15:28 -0700)

Update draft release notes for 1.7.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jc/maint-combined-diff-work-tree' into... Junio C Hamano Tue, 23 Aug 2011 22:27:30 +0000 (15:27 -0700)

Merge branch 'jc/maint-combined-diff-work-tree' into maint

* jc/maint-combined-diff-work-tree:
diff -c/--cc: do not mistake "resolved as deletion" as "use working tree"

Conflicts:
combine-diff.c

Merge branch 'cb/maint-exec-error-report' into maintJunio C Hamano Tue, 23 Aug 2011 22:20:06 +0000 (15:20 -0700)

Merge branch 'cb/maint-exec-error-report' into maint

* cb/maint-exec-error-report:
notice error exit from pager
error_routine: use parent's stderr if exec fails

Merge branch 'cb/maint-quiet-push' into maintJunio C Hamano Tue, 23 Aug 2011 22:19:45 +0000 (15:19 -0700)

Merge branch 'cb/maint-quiet-push' into maint

* cb/maint-quiet-push:
receive-pack: do not overstep command line argument array
propagate --quiet to send-pack/receive-pack

Conflicts:
Documentation/git-receive-pack.txt
Documentation/git-send-pack.txt

Merge branch 'jc/maint-smart-http-race-upload-pack... Junio C Hamano Tue, 23 Aug 2011 22:17:50 +0000 (15:17 -0700)

Merge branch 'jc/maint-smart-http-race-upload-pack' into maint

* jc/maint-smart-http-race-upload-pack:
helping smart-http/stateless-rpc fetch race

Merge branch 'jc/no-gitweb-test-without-cgi-etc' into... Junio C Hamano Tue, 23 Aug 2011 22:17:14 +0000 (15:17 -0700)

Merge branch 'jc/no-gitweb-test-without-cgi-etc' into maint

* jc/no-gitweb-test-without-cgi-etc:
t/gitweb-lib.sh: skip gitweb tests when perl dependencies are not met

fast-import: allow to tag newly created objectsDmitry Ivankov Mon, 22 Aug 2011 12:10:19 +0000 (18:10 +0600)

fast-import: allow to tag newly created objects

fast-import allows to tag objects by sha1 and to query sha1 of objects
being imported. So it should allow to tag these objects, make it do so.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: add tests for tagging blobsDmitry Ivankov Mon, 22 Aug 2011 12:10:18 +0000 (18:10 +0600)

fast-import: add tests for tagging blobs

fast-import allows to create an annotated tag that annotates a blob,
via mark or direct sha1 specification.

For mark it works, for sha1 it tries to read the object. It tries to
do so via read_sha1_file, and then checks the size to be at least 46.

That's weird, let's just allow to (annotated) tag any object referenced
by sha1. If the object originates from our packfile, we still fail though.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clone: clone from a repository with relative alternatesJunio C Hamano Tue, 23 Aug 2011 01:05:16 +0000 (18:05 -0700)

clone: clone from a repository with relative alternates

Cloning from a local repository blindly copies or hardlinks all the files
under objects/ hierarchy. This results in two issues:

- If the repository cloned has an "objects/info/alternates" file, and the
command line of clone specifies --reference, the ones specified on the
command line get overwritten by the copy from the original repository.

- An entry in a "objects/info/alternates" file can specify the object
stores it borrows objects from as a path relative to the "objects/"
directory. When cloning a repository with such an alternates file, if
the new repository is not sitting next to the original repository, such
relative paths needs to be adjusted so that they can be used in the new
repository.

This updates add_to_alternates_file() to take the path to the alternate
object store, including the "/objects" part at the end (earlier, it was
taking the path to $GIT_DIR and was adding "/objects" itself), as it is
technically possible to specify in objects/info/alternates file the path
of a directory whose name does not end with "/objects".

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Add simple test case for branch importVitor Antunes Thu, 18 Aug 2011 23:44:06 +0000 (00:44 +0100)

git-p4: Add simple test case for branch import

Create a basic branch structure in P4 and clone it with git-p4.
Also, make an update on P4 side and check if git-p4 imports it correctly.
The branch structure is created in such a way that git-p4 will fail to import
updates if patch "git-p4: Correct branch base depot path detection" is not
applied.

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Allow branch definition with git configVitor Antunes Thu, 18 Aug 2011 23:44:05 +0000 (00:44 +0100)

git-p4: Allow branch definition with git config

Perforce does not strictly require the usage of branch specifications to create
branches. In these cases the branch detection code of git-p4 will not be able to
import them.
This patch adds support for git-p4.branchList configuration option, allowing
branches to be defined in git config.

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Allow filtering Perforce branches by userVitor Antunes Thu, 18 Aug 2011 23:44:04 +0000 (00:44 +0100)

git-p4: Allow filtering Perforce branches by user

All branches in the Perforce server are downloaded to allow branch detection. If
you have a centralized server on a remote location and there is a big number of
branches this operation can take some time.
This patch adds the configuration option git-p4.branchUser to allow filtering
the branch list by user. Although this limits the branch maintenance in Perforce
to be done by a single user, it might be an advantage when the number of
branches being used in a specific depot is very small when compared with the
branches available in the server.

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Correct branch base depot path detectionVitor Antunes Thu, 18 Aug 2011 23:44:03 +0000 (00:44 +0100)

git-p4: Correct branch base depot path detection

When branch detection is enabled each branch is named in git after their
relative depot path in Perforce. To do this the depot paths are compared against
each other to find their common base path. The current algorithm makes this
comparison on a character by character basis.
Assuming we have the following branches:

//depot/branches/featureA
//depot/branches/featureB

Then the base depot path would be //depot/branches/feature, which is an invalid
depot path.

The current patch fixes this by splitting the path into a list and comparing the
list entries, making it choose correctly //depot/branches as the base path.

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 23 Aug 2011 04:02:41 +0000 (21:02 -0700)

Merge branch 'maint'

* maint:
add technical documentation about ref iteration
Do not use C++-style comments

clone: allow more than one --referenceJunio C Hamano Tue, 23 Aug 2011 01:05:15 +0000 (18:05 -0700)

clone: allow more than one --reference

Also add a test to expose a long-standing bug that is triggered when
cloning with --reference option from a local repository that has its own
alternates. The alternate object stores specified on the command line
are lost, and only alternates copied from the source repository remain.
The bug will be fixed in the next patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Show interpreted branch name in error messagesConrad Irwin Sat, 20 Aug 2011 21:49:49 +0000 (14:49 -0700)

Show interpreted branch name in error messages

Change the error message when doing: "git branch @{-1}",
"git checkout -b @{-1}", or "git branch -m foo @{-1}"

* was: A branch named '@{-1}' already exists.
* now: A branch named 'bar' already exists.

Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Prevent force-updating of the current branchConrad Irwin Sat, 20 Aug 2011 21:49:48 +0000 (14:49 -0700)

Prevent force-updating of the current branch

"git branch -M <foo> <current-branch>" allows updating the current branch
which HEAD points, without the necessary house-keeping that git reset
normally does to make this operation sensible. It also leaves the reflog
in a confusing state (you would be warned when trying to read it).

"git checkout -B <current branch> <foo>" is also partly vulnerable to this
bug; due to inconsistent pre-flight checks it would perform half of its
task and then abort just before rewriting the branch. Again this
manifested itself as the index file getting out-of-sync with HEAD.

"git branch -f" already guarded against this problem, and aborts with
a fatal error.

Update "git branch -M", "git checkout -B" and "git branch -f" to share the
same check before allowing a branch to be created. These prevent you from
updating the current branch.

We considered suggesting the use of "git reset" in the failure message
but concluded that it was not possible to discern what the user was
actually trying to do.

Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add technical documentation about ref iterationHeiko Voigt Mon, 22 Aug 2011 20:36:45 +0000 (22:36 +0200)

add technical documentation about ref iteration

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

clone: allow to clone from .git fileNguyễn Thái Ngọc Duy Sun, 21 Aug 2011 11:58:09 +0000 (18:58 +0700)

clone: allow to clone from .git file

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_gitfile_gently(): rename misnamed function to... Junio C Hamano Mon, 22 Aug 2011 21:04:56 +0000 (14:04 -0700)

read_gitfile_gently(): rename misnamed function to read_gitfile()

The function was not gentle at all to the callers and died without giving
them a chance to deal with possible errors. Rename it to read_gitfile(),
and update all the callers.

As no existing caller needs a true "gently" variant, we do not bother
adding one at this point.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: treat cat-blob as a delta base hint for... Dmitry Ivankov Sat, 20 Aug 2011 19:04:12 +0000 (01:04 +0600)

fast-import: treat cat-blob as a delta base hint for next blob

Delta base for blobs is chosen as a previously saved blob. If we
treat cat-blob's blob as a delta base for the next blob, nothing
is likely to become worse.

For fast-import stream producer like svn-fe cat-blob is used like
following:
- svn-fe reads file delta in svn format
- to apply it, svn-fe asks cat-blob 'svn delta base'
- applies 'svn delta' to the response
- produces a blob command to store the result

Currently there is no way for svn-fe to give fast-import a hint on
object delta base. While what's requested in cat-blob is most of
the time a best delta base possible. Of course, it could be not a
good delta base, but we don't know any better one anyway.

So do treat cat-blob's result as a delta base for next blob. The
profit is nice: 2x to 7x reduction in pack size AND 1.2x to 3x
time speedup due to diff_delta being faster on good deltas. git gc
--aggressive can compress it even more, by 10% to 70%, utilizing
more cpu time, real time and 3 cpu cores.

Tested on 213M and 2.7G fast-import streams, resulting packs are 22M
and 113M, import time is 7s and 60s, both streams are produced by
svn-fe, sniffed and then used as raw input for fast-import.

For git-fast-export produced streams there is no change as it doesn't
use cat-blob and doesn't try to reorder blobs in some smart way to
make successive deltas small.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
Acked-by: David Barr <davidbarr@google.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: count and report # of calls to diff_delta... Dmitry Ivankov Sat, 20 Aug 2011 19:04:11 +0000 (01:04 +0600)

fast-import: count and report # of calls to diff_delta in stats

It's an interesting number, how often do we try to deltify each type of
objects and how often do we succeed. So do add it to stats.

Success doesn't mean much gain in pack size though. As we allow delta to
be as big as (data.len - 20). And delta close to data.len gains nothing
compared to no delta at all even after zlib compression (delta is pretty
much the same as data, just with few modifications).

We should try to make less attempts that result in huge deltas as these
consume more cpu than trivial small deltas. Either by choosing a better
delta base or reducing delta size upper bound or doing less delta attempts
at all.

Currently, delta base for blobs is a waste literally. Each blob delta
base is chosen as a previously stored blob. Disabling deltas for blobs
doesn't increase pack size and reduce import time, or at least doesn't
increase time for all fast-import streams I've tried.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
Acked-by: David Barr <davidbarr@google.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Process detectCopiesHarder with --boolVitor Antunes Mon, 22 Aug 2011 08:33:09 +0000 (09:33 +0100)

git-p4: Process detectCopiesHarder with --bool

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Add test case for copy detectionVitor Antunes Mon, 22 Aug 2011 08:33:08 +0000 (09:33 +0100)

git-p4: Add test case for copy detection

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Add test case for rename detectionVitor Antunes Mon, 22 Aug 2011 08:33:07 +0000 (09:33 +0100)

git-p4: Add test case for rename detection

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Add description of rename/copy detection optionsVitor Antunes Mon, 22 Aug 2011 08:33:06 +0000 (09:33 +0100)

git-p4: Add description of rename/copy detection options

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Allow setting rename/copy detection thresholdVitor Antunes Mon, 22 Aug 2011 08:33:05 +0000 (09:33 +0100)

git-p4: Allow setting rename/copy detection threshold

Copy and rename detection arguments (-C and -M) allow setting a threshold value
for the similarity ratio. If the similarity is below this threshold the rename
or copy is ignored and the file is added as new.
This patch allows setting git-p4.detectRenames and git-p4.detectCopies options
to an integer value to set the respective threshold.

Signed-off-by: Vitor Antunes <vitor.hda@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Do not use C++-style commentsMichael Haggerty Mon, 22 Aug 2011 10:33:52 +0000 (12:33 +0200)

Do not use C++-style comments

Detected by "gcc -std=iso9899:1990 ...". This patch applies against
"maint".

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

push: Don't push a repository with unpushed submodulesFredrik Gustafsson Fri, 19 Aug 2011 22:08:47 +0000 (00:08 +0200)

push: Don't push a repository with unpushed submodules

When working with submodules it is easy to forget to push a
submodule to the server but pushing a super-project that
contains a commit for that submodule. The result is that the
superproject points at a submodule commit that is not available
on the server.

This adds the option --recurse-submodules=check to push. When
using this option git will check that all submodule commits that
are about to be pushed are present on a remote of the submodule.

To be able to use a combined diff, disabling a diff callback has
been removed from combined-diff.c.

Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com>
Mentored-by: Jens Lehmann <Jens.Lehmann@web.de>
Mentored-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

combine-diff: support format_callbackJunio C Hamano Sat, 20 Aug 2011 06:32:51 +0000 (23:32 -0700)

combine-diff: support format_callback

This teaches combine-diff machinery to feed a combined merge to a callback
function when DIFF_FORMAT_CALLBACK is specified.

So far, format callback functions are not used for anything but 2-way
diffs. A callback is given a diff_queue_struct, which is an array of
diff_filepair. As its name suggests, a diff_filepair is a _pair_ of
diff_filespec that represents a single preimage and a single postimage.

Since "diff -c" is to compare N parents with a single merge result and
filter out any paths whose result match one (or more) of the parent(s),
its output has to be able to represent N preimages and 1 postimage. For
this reason, a callback function that inspects a diff_filepair that
results from this new infrastructure can and is expected to view the
preimage side (i.e. pair->one) as an array of diff_filespec. Each element
in the array, except for the last one, is marked with "has_more_entries"
bit, so that the same callback function can be used for 2-way diffs and
combined diffs.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use kwset in grepFredrik Kuivinen Sat, 20 Aug 2011 22:42:18 +0000 (00:42 +0200)

Use kwset in grep

Benchmarks for the hot cache case:

before:
$ perf stat --repeat=5 git grep qwerty > /dev/null

Performance counter stats for 'git grep qwerty' (5 runs):

3,478,085 cache-misses # 2.322 M/sec ( +- 2.690% )
11,356,177 cache-references # 7.582 M/sec ( +- 2.598% )
3,872,184 branch-misses # 0.363 % ( +- 0.258% )
1,067,367,848 branches # 712.673 M/sec ( +- 2.622% )
3,828,370,782 instructions # 0.947 IPC ( +- 0.033% )
4,043,832,831 cycles # 2700.037 M/sec ( +- 0.167% )
8,518 page-faults # 0.006 M/sec ( +- 3.648% )
847 CPU-migrations # 0.001 M/sec ( +- 3.262% )
6,546 context-switches # 0.004 M/sec ( +- 2.292% )
1497.695495 task-clock-msecs # 3.303 CPUs ( +- 2.550% )

0.453394396 seconds time elapsed ( +- 0.912% )

after:
$ perf stat --repeat=5 git grep qwerty > /dev/null

Performance counter stats for 'git grep qwerty' (5 runs):

2,989,918 cache-misses # 3.166 M/sec ( +- 5.013% )
10,986,041 cache-references # 11.633 M/sec ( +- 4.899% ) (scaled from 95.06%)
3,511,993 branch-misses # 1.422 % ( +- 0.785% )
246,893,561 branches # 261.433 M/sec ( +- 3.967% )
1,392,727,757 instructions # 0.564 IPC ( +- 0.040% )
2,468,142,397 cycles # 2613.494 M/sec ( +- 0.110% )
7,747 page-faults # 0.008 M/sec ( +- 3.995% )
897 CPU-migrations # 0.001 M/sec ( +- 2.383% )
6,535 context-switches # 0.007 M/sec ( +- 1.993% )
944.384228 task-clock-msecs # 3.177 CPUs ( +- 0.268% )

0.297257643 seconds time elapsed ( +- 0.450% )

So we gain about 35% by using the kwset code.

As a side effect of using kwset two grep tests are fixed by this
patch. The first is fixed because kwset can deal with case-insensitive
search containing NULs, something strcasestr cannot do. The second one
is fixed because we consider patterns containing NULs as fixed strings
(regcomp cannot accept patterns with NULs).

Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use kwset in pickaxeFredrik Kuivinen Sat, 20 Aug 2011 22:41:57 +0000 (00:41 +0200)

Use kwset in pickaxe

Benchmarks in the hot cache case:

before:
$ perf stat --repeat=5 git log -Sqwerty

Performance counter stats for 'git log -Sqwerty' (5 runs):

47,092,744 cache-misses # 2.825 M/sec ( +- 1.607% )
123,368,389 cache-references # 7.400 M/sec ( +- 0.812% )
330,040,998 branch-misses # 3.134 % ( +- 0.257% )
10,530,896,750 branches # 631.663 M/sec ( +- 0.121% )
62,037,201,030 instructions # 1.399 IPC ( +- 0.142% )
44,331,294,321 cycles # 2659.073 M/sec ( +- 0.326% )
96,794 page-faults # 0.006 M/sec ( +- 11.952% )
25 CPU-migrations # 0.000 M/sec ( +- 25.266% )
1,424 context-switches # 0.000 M/sec ( +- 0.540% )
16671.708650 task-clock-msecs # 0.997 CPUs ( +- 0.343% )

16.728692052 seconds time elapsed ( +- 0.344% )

after:
$ perf stat --repeat=5 git log -Sqwerty

Performance counter stats for 'git log -Sqwerty' (5 runs):

51,385,522 cache-misses # 4.619 M/sec ( +- 0.565% )
129,177,880 cache-references # 11.611 M/sec ( +- 0.219% )
319,222,775 branch-misses # 6.946 % ( +- 0.134% )
4,595,913,233 branches # 413.086 M/sec ( +- 0.112% )
31,395,042,533 instructions # 1.062 IPC ( +- 0.129% )
29,558,348,598 cycles # 2656.740 M/sec ( +- 0.204% )
93,224 page-faults # 0.008 M/sec ( +- 4.487% )
19 CPU-migrations # 0.000 M/sec ( +- 10.425% )
950 context-switches # 0.000 M/sec ( +- 0.360% )
11125.796039 task-clock-msecs # 0.997 CPUs ( +- 0.239% )

11.164216599 seconds time elapsed ( +- 0.240% )

So the kwset code is about 33% faster.

Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Adapt the kwset code to GitFredrik Kuivinen Sat, 20 Aug 2011 22:41:41 +0000 (00:41 +0200)

Adapt the kwset code to Git

Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add string search routines from GNU grepFredrik Kuivinen Sat, 20 Aug 2011 22:41:11 +0000 (00:41 +0200)

Add string search routines from GNU grep

kwset.c and kwset.h have been copied unmodified from commit e7ac713d^
in the GNU grep git repository (this is the last commit in the
repository licensed under GPLv2).

Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add obstack.[ch] from EGLIBC 2.10Fredrik Kuivinen Sat, 20 Aug 2011 22:40:40 +0000 (00:40 +0200)

Add obstack.[ch] from EGLIBC 2.10

Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

support pager.* for external commandsJeff King Thu, 18 Aug 2011 22:01:32 +0000 (15:01 -0700)

support pager.* for external commands

Without this patch, any commands that are not builtin would
not respect pager.* config. For example:

git config pager.stash false
git stash list

would still use a pager. With this patch, pager.stash now
has an effect. If it is not specified, we will still fall
back to pager.log when we invoke "log" from "stash list".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

want_color: automatically fallback to color.uiJeff King Thu, 18 Aug 2011 05:05:35 +0000 (22:05 -0700)

want_color: automatically fallback to color.ui

All of the "do we want color" flags default to -1 to
indicate that we don't have any color configured. This value
is handled in one of two ways:

1. In porcelain, we check early on whether the value is
still -1 after reading the config, and set it to the
value of color.ui (which defaults to 0).

2. In plumbing, it stays untouched as -1, and want_color
defaults it to off.

This works fine, but means that every porcelain has to check
and reassign its color flag. Now that want_color gives us a
place to put this check in a single spot, we can do that,
simplifying the calling code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: don't load color config in plumbingJeff King Thu, 18 Aug 2011 05:05:08 +0000 (22:05 -0700)

diff: don't load color config in plumbing

The diff config callback is split into two functions: one
which loads "ui" config, and one which loads "basic" config.
The former chains to the latter, as the diff UI config is a
superset of the plumbing config.

The color.diff variable is only loaded in the UI config.
However, the basic config actually chains to
git_color_default_config, which loads color.ui. This doesn't
actually cause any bugs, because the plumbing diff code does
not actually look at the value of color.ui.

However, it is somewhat nonsensical, and it makes it
difficult to refactor the color code. It probably came about
because there is no git_color_config to load only color
config, but rather just git_color_default_config, which
loads color config and chains to git_default_config.

This patch splits out the color-specific portion of
git_color_default_config so that the diff UI config can call
it directly. This is perhaps better explained by the
chaining of callbacks. Before we had:

git_diff_ui_config
-> git_diff_basic_config
-> git_color_default_config
-> git_default_config

Now we have:

git_diff_ui_config
-> git_color_config
-> git_diff_basic_config
-> git_default_config

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: refactor get_colorbool functionJeff King Thu, 18 Aug 2011 05:04:56 +0000 (22:04 -0700)

config: refactor get_colorbool function

For "git config --get-colorbool color.foo", we use a custom
callback that looks not only for the key that the user gave
us, but also for "diff.color" (for backwards compatibility)
and "color.ui" (as a fallback).

For the former, we use a custom variable to store the
diff.color value. For the latter, though, we store it in the
main "git_use_color_default" variable, turning on color.ui
for any other parts of git that respect this value.

In practice, this doesn't cause any bugs, because git-config
runs without caring about git_use_color_default, and then
exits. But it crosses module boundaries in an unusual and
confusing way, and it makes refactoring color handling
harder than it needs to be.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

color: delay auto-color decision until point of useJeff King Thu, 18 Aug 2011 05:04:23 +0000 (22:04 -0700)

color: delay auto-color decision until point of use

When we read a color value either from a config file or from
the command line, we use git_config_colorbool to convert it
from the tristate always/never/auto into a single yes/no
boolean value.

This has some timing implications with respect to starting
a pager.

If we start (or decide not to start) the pager before
checking the colorbool, everything is fine. Either isatty(1)
will give us the right information, or we will properly
check for pager_in_use().

However, if we decide to start a pager after we have checked
the colorbool, things are not so simple. If stdout is a tty,
then we will have already decided to use color. However, the
user may also have configured color.pager not to use color
with the pager. In this case, we need to actually turn off
color. Unfortunately, the pager code has no idea which color
variables were turned on (and there are many of them
throughout the code, and they may even have been manipulated
after the colorbool selection by something like "--color" on
the command line).

This bug can be seen any time a pager is started after
config and command line options are checked. This has
affected "git diff" since 89d07f7 (diff: don't run pager if
user asked for a diff style exit code, 2007-08-12). It has
also affect the log family since 1fda91b (Fix 'git log'
early pager startup error case, 2010-08-24).

This patch splits the notion of parsing a colorbool and
actually checking the configuration. The "use_color"
variables now have an additional possible value,
GIT_COLOR_AUTO. Users of the variable should use the new
"want_color()" wrapper, which will lazily determine and
cache the auto-color decision.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit: reduce use of redundant global variablesJunio C Hamano Fri, 19 Aug 2011 18:58:18 +0000 (11:58 -0700)

commit: reduce use of redundant global variables

The file-scope global variable head_sha1[] was used to hold the object
name of the current HEAD commit (unless we are about to make an initial
commit). Also there is an independent "static int initial_commit".

Fix all the functions on the call-chain that use these two variables to
take a new "(const) struct commit *current_head" argument instead, and
replace their uses, e.g. "if (initial_commit)" becomes "if (!current_head)"
and a reference to "head_sha1" becomes "current_head->object.sha1".

Signed-off-by: Junio C Hamano <gitster@pobox.com>

log: decorate "replaced" on to replaced commitsNguyễn Thái Ngọc Duy Fri, 19 Aug 2011 12:43:50 +0000 (19:43 +0700)

log: decorate "replaced" on to replaced commits

Old code also decorates "new" commits with "refs/replace/SHA1". This
is now gone, but I guess no one will miss it.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch.c: use the parsed branch nameMichael J Gruber Fri, 19 Aug 2011 11:45:43 +0000 (13:45 +0200)

branch.c: use the parsed branch name

When setting up tracking info, branch.c uses the given branch specifier
("name"). Use the parsed name ("ref.buf") instead so that

git branch --set-upstream @{-1} foo

sets up tracking info for the previous branch rather than for a branch
named "@{-1}".

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>