Clemens Buchacher [Sat, 3 Sep 2011 17:06:13 +0000 (19:06 +0200)]
send-email: add option -h
Most other git commands print a synopsis when passed -h. Make
send-email do the same.
Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 30 Aug 2011 19:35:51 +0000 (12:35 -0700)]
Merge branch 'maint'
* maint:
Documentation: clarify effects of -- <path> arguments
Thomas 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>
Junio 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>
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
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()
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
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
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
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
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
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
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
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
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
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
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
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
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
Junio 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>
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>
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
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
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
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
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
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
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
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
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
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
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>
Pang 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>
Junio 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>
Junio 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>
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
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>
Ben 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>
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>
Junio C Hamano [Tue, 23 Aug 2011 22:43:38 +0000 (15:43 -0700)]
Update draft release notes to 1.7.7
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
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_
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
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
Junio 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>
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
Junio 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
Junio 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
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
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
Dmitry 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>
Dmitry 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>
Junio 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>
Vitor 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>
Vitor 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>
Vitor 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>
Vitor 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>
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
Junio 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>
Conrad 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>
Conrad 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>
Heiko 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>
Nguyễ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>
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>
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>
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>
Vitor 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>
Vitor 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>
Vitor 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>
Vitor 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>
Vitor 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>
Michael 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>
Junio 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>
Jeff 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>
Jeff 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>
Jeff 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>
Jeff 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>
Jeff 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>
Junio 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>
Nguyễ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>
Michael 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>
David Aguilar [Fri, 19 Aug 2011 09:14:45 +0000 (02:14 -0700)]
mergetools/meld: Use '--output' when available
meld 1.5.0 and newer allow the output file to be specified
when merging multiple files. Check whether the meld command
supports '--output' and use it when available.
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Aguilar [Thu, 18 Aug 2011 07:23:46 +0000 (00:23 -0700)]
mergetool--lib: Refactor tools into separate files
Individual merge tools are now defined in a mergetools/$tool
file which is sourced at runtime.
The individual files are installed into $(git --exec-path)/mergetools/.
New tools can be added by creating a new file instead of editing the
git-mergetool--lib.sh scriptlet.
http://thread.gmane.org/gmane.comp.version-control.git/134906/focus=135006
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Aguilar [Thu, 18 Aug 2011 07:23:45 +0000 (00:23 -0700)]
mergetool--lib: Make style consistent with git
Use the predominant conditional style where "then" appears
alone on the line after the test expression.
Remove spaces after ">" output redirections.
Remove unnecessary parentheses around the kdiff3 commands.
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
David Aguilar [Thu, 18 Aug 2011 07:23:44 +0000 (00:23 -0700)]
difftool--helper: Make style consistent with git
Use the predominant conditional style where "then" appears
alone on the line after the test expression.
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 19 Aug 2011 05:10:23 +0000 (22:10 -0700)]
Update draft release notes to 1.7.7
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Fri, 19 Aug 2011 05:07:57 +0000 (22:07 -0700)]
Merge branch 'db/am-skip-blank-at-the-beginning'
* db/am-skip-blank-at-the-beginning:
am: ignore leading whitespace before patch
Junio C Hamano [Fri, 19 Aug 2011 05:07:54 +0000 (22:07 -0700)]
Merge branch 'ma/am-exclude'
* ma/am-exclude:
am: Document new --exclude=<path> option
am: pass exclude down to apply
Junio C Hamano [Fri, 19 Aug 2011 05:06:03 +0000 (22:06 -0700)]
Merge branch 'maint'
* maint:
fetch-pack: check for valid commit from server
Jeff King [Thu, 18 Aug 2011 05:03:48 +0000 (22:03 -0700)]
git_config_colorbool: refactor stdout_is_tty handling
Usually this function figures out for itself whether stdout
is a tty. However, it has an extra parameter just to allow
git-config to override the auto-detection for its
--get-colorbool option.
Instead of an extra parameter, let's just use a global
variable. This makes calling easier in the common case, and
will make refactoring the colorbool code much simpler.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Thu, 18 Aug 2011 05:03:12 +0000 (22:03 -0700)]
diff: refactor COLOR_DIFF from a flag into an int
This lets us store more than just a bit flag for whether we
want color; we can also store whether we want automatic
colors. This can be useful for making the automatic-color
decision closer to the point of use.
This mostly just involves replacing DIFF_OPT_* calls with
manipulations of the flag. The biggest exception is that
calls to DIFF_OPT_TST must check for "o->use_color > 0",
which lets an "unknown" value (i.e., the default) stay at
"no color". In the previous code, a value of "-1" was not
propagated at all.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Thu, 18 Aug 2011 05:02:29 +0000 (22:02 -0700)]
setup_pager: set GIT_PAGER_IN_USE
We have always set a global "spawned_pager" variable when we
start the pager. This lets us make the auto-color decision
later in the program as as "we are outputting to a terminal,
or to a pager which can handle colors".
Commit
6e9af86 added support for the GIT_PAGER_IN_USE
environment variable. An external program calling git (e.g.,
git-svn) could set this variable to indicate that it had
already started the pager, and that the decision about
auto-coloring should take that into account.
However,
6e9af86 failed to do the reverse, which is to tell
external programs when git itself has started the pager.
Thus a git command implemented as an external script that
has the pager turned on (e.g., "git -p stash show") would
not realize it was going to a pager, and would suppress
colors.
This patch remedies that; we always set GIT_PAGER_IN_USE
when we start the pager, and the value is respected by both
this program and any spawned children.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Thu, 18 Aug 2011 05:02:06 +0000 (22:02 -0700)]
t7006: use test_config helpers
In some cases, this is just making the test script a little
shorter and easier to read. However, there are several
places where we didn't take proper precautions against
polluting downstream tests with our config; this fixes them,
too.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Thu, 18 Aug 2011 05:01:15 +0000 (22:01 -0700)]
test-lib: add helper functions for config
There are a few common tasks when working with configuration
variables in tests; this patch aims to make them a little
easier to write and less error-prone.
When setting a variable, you should typically make sure to
clean it up after the test is finished, so as not to pollute
other tests. Like:
test_when_finished 'git config --unset foo.bar' &&
git config foo.bar baz
This patch lets you just write:
test_config foo.bar baz
When clearing a variable that does not exist, git-config
will report a specific non-zero error code. Meaning that
tests which call "git config --unset" often either rely on
the prior tests having actually set it, or must use
test_might_fail. With this patch, the previous:
test_might_fail git config --unset foo.bar
becomes:
test_unconfig foo.bar
Not only is this easier to type, but it is more robust; it
will correctly detect errors from git-config besides "key
was not set".
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Thu, 18 Aug 2011 05:00:47 +0000 (22:00 -0700)]
t7006: modernize calls to unset
These tests break &&-chaining to deal with broken "unset"
implementations. Instead, they should just use sane_unset.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Thu, 18 Aug 2011 13:36:03 +0000 (20:36 +0700)]
fetch-pack: check for valid commit from server
A malicious server can return ACK with non-existent SHA-1 or not a
commit. lookup_commit() in this case may return NULL. Do not let
fetch-pack crash by accessing NULL address in this case.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Thu, 18 Aug 2011 12:29:37 +0000 (19:29 +0700)]
log: decorate grafted commits with "grafted"
In shallow repositories, this may help detect whether a branch ends,
or it is deeper than current depth.
It also show graft points that extend a branch.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Thu, 18 Aug 2011 12:29:36 +0000 (19:29 +0700)]
Move write_shallow_commits to fetch-pack.c
This function produces network traffic and should be in fetch-pack. It
has been in commit.c because it needs to iterate (private) graft
list. It can now do so using for_each_commit_graft().
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Thu, 18 Aug 2011 12:29:35 +0000 (19:29 +0700)]
Add for_each_commit_graft() to iterate all grafts
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Nguyễn Thái Ngọc Duy [Thu, 18 Aug 2011 12:29:34 +0000 (19:29 +0700)]
decoration: do not mis-decorate refs with same prefix
We definitely do not want to decorate refs/headsandtails the same as
refs/heads/*, for example.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>