Giuseppe Bilotta [Mon, 29 Aug 2011 14:51:48 +0000 (16:51 +0200)]
FIXME: hotpatch for compatibility with latest hg
Giuseppe Bilotta [Mon, 29 Aug 2011 14:52:14 +0000 (16:52 +0200)]
Add missing apply_delta function
When a message or author cannot be represented in hg's standard format,
a close approximation is stored in the changeset, and a diff from the
normalized format to the actual format is stored in the extra fields.
The function calls for the application of these diffs were present, but
the actual implementation was missing. Shamelessly steal the definition
of apply_delta() from dulwich.
Also add a FIXME TODO about the opportunity of storing extra information
in git notes.
Sverre Rabbelier [Sun, 24 Jul 2011 10:39:03 +0000 (12:39 +0200)]
git-remote-hg: add tests
Sverre Rabbelier [Sun, 24 Jul 2011 10:38:57 +0000 (12:38 +0200)]
git-remote-hg: add the helper
The helper uses the previously added infrastructure.
Sverre Rabbelier [Sun, 24 Jul 2011 10:38:43 +0000 (12:38 +0200)]
git-remote-hg: add GitExporter/GitImporter/NonLocalGit
This is inftrastructure required to implement git-remote-hg.
Sverre Rabbelier [Sun, 24 Jul 2011 10:37:06 +0000 (12:37 +0200)]
git-remote-hg: add hgexport, an hg-fast-export equivalent
This class will be used by git-remote-hg to do the heavy lifting.
Sverre Rabbelier [Sun, 24 Jul 2011 10:12:27 +0000 (12:12 +0200)]
git-remote-hg: add GitHg, a helper class for converting hg commits to git
This class will be used by HgExport.
Sverre Rabbelier [Sun, 24 Jul 2011 10:05:53 +0000 (12:05 +0200)]
git-remote-hg: add hgimport, an hg-fast-import equivalent
This class will be used by git-remote-hg to do the heavy lifting.
Sverre Rabbelier [Sun, 22 Aug 2010 06:22:14 +0000 (01:22 -0500)]
git_remote_helpers: add fastimport library
Sverre Rabbelier [Sun, 24 Jul 2011 11:43:34 +0000 (13:43 +0200)]
git-remote-testgit: make local a function
Other helpers (such as git-remote-hg) require that 'self.local' is a
function, rather than a variable.
Sverre Rabbelier [Sat, 23 Jul 2011 22:11:18 +0000 (00:11 +0200)]
remote-testgit: factor out RemoteHelper class
Facilitate writing import-export based helpers in python by
refactoring common code to a base class.
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Sverre Rabbelier [Sat, 23 Jul 2011 22:06:00 +0000 (00:06 +0200)]
remote-helper: check helper status after import/export
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Sverre Rabbelier [Sun, 29 Aug 2010 01:49:01 +0000 (20:49 -0500)]
transport-helper: add trailing --
Sverre Rabbelier [Fri, 15 Jul 2011 19:55:01 +0000 (21:55 +0200)]
t5800: point out that deleting branches does not work
This test actually breaks the repositories involved somehow, so it is
not enabled by default.
Sverre Rabbelier [Fri, 15 Jul 2011 14:37:28 +0000 (16:37 +0200)]
t5800: test pushing a new branch with old content
This works now that fast-export has been fixed to properly handle
refs that point to a commit that was not exported during the current
fast-export run.
Johannes Schindelin [Sat, 23 Jul 2011 15:14:47 +0000 (17:14 +0200)]
setup_revisions: remember whether a ref was positive or not
This will be required by fast-export, when no commits were
exported, but the refs should be set, of course.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Johannes Schindelin [Sat, 23 Jul 2011 13:40:23 +0000 (15:40 +0200)]
fast-export: do not export negative refs
When calling `git fast-export master..next` we want to export
refs/heads/next, but not refs/heads/master.
Currently this is not a problem, because negative refs' commits
are never shown. In the next commit this will be changed in order
to make sure that 'master..master' does export master. I.e. even
refs whose commits are not shown are exported.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Johannes Schindelin [Sat, 23 Jul 2011 15:14:47 +0000 (17:14 +0200)]
setup_revisions: remember whether a ref was positive or not
This will be required by fast-export, when no commits were
exported, but the refs should be set, of course.
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Johannes Schindelin [Sat, 23 Jul 2011 13:55:26 +0000 (15:55 +0200)]
fast-export: do not refer to non-existing marks
When calling `git fast-export a..a b` when a and b refer to the same
commit, nothing would be exported, and an incorrect reset line would
be printed for b ('from :0').
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Sverre Rabbelier [Sun, 24 Jul 2011 13:54:04 +0000 (15:54 +0200)]
t9350: point out that refs are not updated correctly
This happens only when the corresponding commits are not exported in
the current fast-export run. This can happen either when the relevant
commit is already marked, or when the commit is explicitly marked
as UNINTERESTING with a negative ref by another argument.
This breaks fast-export basec remote helpers.
Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Junio C Hamano [Wed, 24 Aug 2011 21:03:28 +0000 (14:03 -0700)]
Merge branch 'jc/merge-reword' into next
* jc/merge-reword:
merge: reword the final message
Junio C Hamano [Wed, 24 Aug 2011 21:03:28 +0000 (14:03 -0700)]
Merge branch 'nk/branch-v-abbrev' into next
* nk/branch-v-abbrev:
branch -v: honor core.abbrev
Junio C Hamano [Wed, 24 Aug 2011 20:03:35 +0000 (13:03 -0700)]
Merge branch 'hv/submodule-update-none' into next
* hv/submodule-update-none:
add update 'none' flag to disable update of submodule by default
submodule: move update configuration variable further up
Junio C Hamano [Wed, 24 Aug 2011 20:03:34 +0000 (13:03 -0700)]
Merge branch 'ci/forbid-unwanted-current-branch-update' into next
* ci/forbid-unwanted-current-branch-update:
Show interpreted branch name in error messages
Prevent force-updating of the current branch
Junio C Hamano [Wed, 24 Aug 2011 20:03:34 +0000 (13:03 -0700)]
Merge branch 'jc/lookup-object-hash' into next
* jc/lookup-object-hash:
object hash: replace linear probing with 4-way cuckoo hashing
object hash: we know the table size is a power of two
object hash: next_size() helper for readability
pack-objects --count-only
object.c: remove duplicated code for object hashing
object.c: code movement for readability
Junio C Hamano [Wed, 24 Aug 2011 19:37:16 +0000 (12:37 -0700)]
Merge branch 'di/fast-import-tagging' into next
* di/fast-import-tagging:
fast-import: allow to tag newly created objects
fast-import: add tests for tagging blobs
Junio C Hamano [Wed, 24 Aug 2011 19:37:16 +0000 (12:37 -0700)]
Merge branch 'di/fast-import-blob-tweak' into next
* 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 [Wed, 24 Aug 2011 19:37:15 +0000 (12:37 -0700)]
Merge branch 'va/p4-branch-import' into next
* 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
Junio C Hamano [Wed, 24 Aug 2011 19:37:15 +0000 (12:37 -0700)]
Merge branch 'va/p4-rename-copy' into next
* va/p4-rename-copy:
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 [Wed, 24 Aug 2011 19:37:15 +0000 (12:37 -0700)]
Merge branch 'jc/traverse-commit-list' into next
* jc/traverse-commit-list:
revision.c: update show_object_with_name() without using malloc()
revision.c: add show_object_with_name() helper function
rev-list: fix finish_object() call
Junio C Hamano [Wed, 24 Aug 2011 19:37:14 +0000 (12:37 -0700)]
Merge branch 'nd/maint-clone-gitdir' into next
* nd/maint-clone-gitdir:
clone: allow to clone from .git file
read_gitfile_gently(): rename misnamed function to read_gitfile()
Conflicts:
cache.h
Junio C Hamano [Wed, 24 Aug 2011 19:37:14 +0000 (12:37 -0700)]
Merge branch 'fg/submodule-ff-check-before-push' into next
* fg/submodule-ff-check-before-push:
push: teach --recurse-submodules the on-demand option
push: Don't push a repository with unpushed submodules
Junio C Hamano [Wed, 24 Aug 2011 19:37:14 +0000 (12:37 -0700)]
Merge branch 'jc/combine-diff-callback' into next
* jc/combine-diff-callback:
combine-diff: support format_callback
Junio C Hamano [Wed, 24 Aug 2011 19:37:13 +0000 (12:37 -0700)]
Merge branch 'jk/pager-with-external-command' into next
* jk/pager-with-external-command:
support pager.* for external commands
Junio C Hamano [Wed, 24 Aug 2011 19:37:13 +0000 (12:37 -0700)]
Merge branch 'fk/make-auto-header-dependencies' into next
* fk/make-auto-header-dependencies:
Makefile: Use computed header dependencies if the compiler supports it
Junio C Hamano [Wed, 24 Aug 2011 19:37:13 +0000 (12:37 -0700)]
Merge branch 'rr/revert-cherry-pick-continue' into next
* rr/revert-cherry-pick-continue:
revert: Propagate errors upwards from do_pick_commit
revert: Introduce --continue to continue the operation
revert: Don't implicitly stomp pending sequencer operation
revert: Remove sequencer state when no commits are pending
reset: Make reset remove the sequencer state
revert: Introduce --reset to remove sequencer state
revert: Make pick_commits functionally act on a commit list
revert: Save command-line options for continuing operation
revert: Save data for continuing after conflict resolution
revert: Don't create invalid replay_opts in parse_args
revert: Separate cmdline parsing from functional code
revert: Introduce struct to keep command-line options
revert: Eliminate global "commit" variable
revert: Rename no_replay to record_origin
revert: Don't check lone argument in get_encoding
revert: Simplify and inline add_message_to_msg
config: Introduce functions to write non-standard file
advice: Introduce error_resolve_conflict
Junio C Hamano [Wed, 24 Aug 2011 19:19:17 +0000 (12:19 -0700)]
Merge branch 'bw/doc-repo-layout' into next
* bw/doc-repo-layout:
Mark http-fetch without -a as deprecated
Documentation: Grammar correction, wording fixes and cleanup
Junio C Hamano [Wed, 24 Aug 2011 19:19:09 +0000 (12:19 -0700)]
Merge branch 'master' into next
* master:
Git 1.7.6.1
get_indexed_object can return NULL if nothing is in that slot; check for it
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 23:03:06 +0000 (16:03 -0700)]
Merge branch 'ac/describe-dirty-refresh' into next
* ac/describe-dirty-refresh:
describe: Refresh the index when run with --dirty
Junio C Hamano [Tue, 23 Aug 2011 22:58:50 +0000 (15:58 -0700)]
Merge branch 'jc/maint-clone-alternates' into next
* 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 [Tue, 23 Aug 2011 22:58:50 +0000 (15:58 -0700)]
Merge branch 'fk/use-kwset-pickaxe-grep-f' into next
* fk/use-kwset-pickaxe-grep-f:
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
Junio C Hamano [Tue, 23 Aug 2011 22:58:50 +0000 (15:58 -0700)]
Merge branch 'mg/branch-set-upstream-previous' into next
* mg/branch-set-upstream-previous:
branch.c: use the parsed branch name
Junio C Hamano [Tue, 23 Aug 2011 22:58:50 +0000 (15:58 -0700)]
Merge branch 'da/difftool-mergtool-refactor' into next
* 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 [Tue, 23 Aug 2011 22:58:49 +0000 (15:58 -0700)]
Merge branch 'jc/maint-autofix-tag-in-head' into next
* jc/maint-autofix-tag-in-head:
commit: reduce use of redundant global variables
Conflicts:
builtin/commit.c
Junio C Hamano [Tue, 23 Aug 2011 22:58:48 +0000 (15:58 -0700)]
Merge branch 'di/fast-import-doc' into next
* di/fast-import-doc:
doc/fast-import: document feature import-marks-if-exists
Junio C Hamano [Tue, 23 Aug 2011 22:58:48 +0000 (15:58 -0700)]
Merge branch 'rc/diff-cleanup-records' into next
* rc/diff-cleanup-records:
xdiff/xprepare: improve O(n*m) performance in xdl_cleanup_records()
Junio C Hamano [Tue, 23 Aug 2011 22:58:48 +0000 (15:58 -0700)]
Merge branch 'di/fast-import-deltified-tree' into next
* di/fast-import-deltified-tree:
fast-import: prevent producing bad delta
fast-import: add a test for tree delta base corruption
Junio C Hamano [Tue, 23 Aug 2011 22:58:48 +0000 (15:58 -0700)]
Merge branch 'di/fast-import-ident' into next
* 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 [Tue, 23 Aug 2011 22:58:47 +0000 (15:58 -0700)]
Merge branch 'fg/submodule-git-file-git-dir' into next
* fg/submodule-git-file-git-dir:
Move git-dir for submodules
rev-parse: add option --resolve-git-dir <path>
Conflicts:
git-submodule.sh
Junio C Hamano [Tue, 23 Aug 2011 22:58:47 +0000 (15:58 -0700)]
Merge branch 'nd/decorate-grafts' into next
* nd/decorate-grafts:
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 [Tue, 23 Aug 2011 22:58:47 +0000 (15:58 -0700)]
Merge branch 'jk/color-and-pager' into next
* 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:
parse-options.c
Junio C Hamano [Tue, 23 Aug 2011 22:58:46 +0000 (15:58 -0700)]
Merge branch 'jn/plug-empty-tree-leak' into next
* 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 [Tue, 23 Aug 2011 22:58:46 +0000 (15:58 -0700)]
Merge branch 'en/merge-recursive-2' into next
* 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
...
Junio C Hamano [Tue, 23 Aug 2011 22:58:46 +0000 (15:58 -0700)]
Merge branch 'mh/attr' into next
* 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 [Tue, 23 Aug 2011 22:58:46 +0000 (15:58 -0700)]
Merge branch 'di/parse-options-split' into next
* di/parse-options-split:
Reduce parse-options.o dependencies
parse-options: export opterr, optbug
Junio C Hamano [Tue, 23 Aug 2011 22:58:45 +0000 (15:58 -0700)]
Merge branch 'js/i18n-scripts' into next
* 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 [Tue, 23 Aug 2011 22:45:29 +0000 (15:45 -0700)]
Merge branch 'master' into next
* master:
Update draft release notes to 1.7.7
Update draft release notes for 1.7.6.1
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:04:15 +0000 (21:04 -0700)]
Merge branch 'master' into next
* master:
add technical documentation about ref iteration
Do not use C++-style comments
Fredrik Gustafsson [Mon, 15 Aug 2011 21:17:47 +0000 (23:17 +0200)]
Move git-dir for submodules
Move git-dir for submodules into $GIT_DIR/modules/[name_of_submodule] of
the superproject. This is a step towards being able to delete submodule
directories without loosing the information from their .git directory
as that is now stored outside the submodules work tree.
This is done relying on the already existent .git-file functionality.
When adding or updating a submodule whose git directory is found under
$GIT_DIR/modules/[name_of_submodule], don't clone it again but simply
point the .git-file to it and remove the now stale index file from it.
The index will be recreated by the following checkout.
This patch will not affect already cloned submodules at all.
Tests that rely on .git being a directory have been fixed.
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>
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>
Junio C Hamano [Wed, 17 Aug 2011 21:30:35 +0000 (14:30 -0700)]
revision.c: update show_object_with_name() without using malloc()
Allocating and then immediately freeing temporary memory a million times
when listing a million objects is distasteful.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 17 Aug 2011 21:30:34 +0000 (14:30 -0700)]
revision.c: add show_object_with_name() helper function
There are two copies of traverse_commit_list callback that show the object
name followed by pathname the object was found, to produce output similar
to "rev-list --objects".
Unify them.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 17 Aug 2011 21:30:33 +0000 (14:30 -0700)]
rev-list: fix finish_object() call
The callback to traverse_commit_list() are to take linked name_path and
a string for the last path component.
If the callee used its parameters, it would have seen duplicated leading
paths. In this particular case, the callee does not use this argument but
that is not a reason to leave the call broken.
Signed-off-by: Junio C Hamano <gitster@pobox.com>