зеркало из https://github.com/microsoft/git.git
Merge branch 'maint' to sync with 1.6.0.1
This commit is contained in:
Коммит
49d3536594
|
@ -4,6 +4,9 @@ GIT v1.6.0.1 Release Notes
|
||||||
Fixes since v1.6.0
|
Fixes since v1.6.0
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
* "git diff --cc" did not honor content mangling specified by
|
||||||
|
gitattributes and core.autocrlf when reading from the work tree.
|
||||||
|
|
||||||
* "git diff --check" incorrectly detected new trailing blank lines when
|
* "git diff --check" incorrectly detected new trailing blank lines when
|
||||||
whitespace check was in effect.
|
whitespace check was in effect.
|
||||||
|
|
||||||
|
@ -13,6 +16,8 @@ Fixes since v1.6.0
|
||||||
* "git format-patch" peeked before the beginning of a string when
|
* "git format-patch" peeked before the beginning of a string when
|
||||||
"format.headers" variable is empty (a misconfiguration).
|
"format.headers" variable is empty (a misconfiguration).
|
||||||
|
|
||||||
|
* "git help help" did not work correctly.
|
||||||
|
|
||||||
* "git mailinfo" (hence "git am") was unhappy when MIME multipart message
|
* "git mailinfo" (hence "git am") was unhappy when MIME multipart message
|
||||||
contained garbage after the finishing boundary.
|
contained garbage after the finishing boundary.
|
||||||
|
|
||||||
|
@ -22,10 +27,10 @@ Fixes since v1.6.0
|
||||||
* "git merge" did not refresh the index correctly when a merge resulted in
|
* "git merge" did not refresh the index correctly when a merge resulted in
|
||||||
a fast-forward.
|
a fast-forward.
|
||||||
|
|
||||||
Contains other various documentation fixes.
|
* "git merge" did not resolve a truly trivial merges that can be done
|
||||||
|
without content level merges.
|
||||||
|
|
||||||
--
|
* "git svn dcommit" to a repository with URL that has embedded usernames
|
||||||
exec >/var/tmp/1
|
did not work correctly.
|
||||||
O=v1.6.0-14-g3a634dc
|
|
||||||
echo O=$(git describe maint)
|
Contains other various documentation fixes.
|
||||||
git shortlog --no-merges $O..maint
|
|
||||||
|
|
|
@ -358,8 +358,13 @@ core.editor::
|
||||||
`EDITOR` environment variables and then finally `vi`.
|
`EDITOR` environment variables and then finally `vi`.
|
||||||
|
|
||||||
core.pager::
|
core.pager::
|
||||||
The command that git will use to paginate output. Can be overridden
|
The command that git will use to paginate output. Can
|
||||||
with the `GIT_PAGER` environment variable.
|
be overridden with the `GIT_PAGER` environment
|
||||||
|
variable. Note that git sets the `LESS` environment
|
||||||
|
variable to `FRSX` if it is unset when it runs the
|
||||||
|
pager. One can change these settings by setting the
|
||||||
|
`LESS` variable to some other value or by giving the
|
||||||
|
`core.pager` option a value such as "`less -+FRSX`".
|
||||||
|
|
||||||
core.whitespace::
|
core.whitespace::
|
||||||
A comma separated list of common whitespace problems to
|
A comma separated list of common whitespace problems to
|
||||||
|
@ -983,9 +988,11 @@ pack.packSizeLimit::
|
||||||
linkgit:git-repack[1].
|
linkgit:git-repack[1].
|
||||||
|
|
||||||
pager.<cmd>::
|
pager.<cmd>::
|
||||||
Allows to set your own pager preferences for each command, overriding
|
Allows turning on or off pagination of the output of a
|
||||||
the default. If `\--pager` or `\--no-pager` is specified on the command
|
particular git subcommand when writing to a tty. If
|
||||||
line, it takes precedence over this option.
|
`\--paginate` or `\--no-pager` is specified on the command line,
|
||||||
|
it takes precedence over this option. To disable pagination for
|
||||||
|
all commands, set `core.pager` or 'GIT_PAGER' to "`cat`".
|
||||||
|
|
||||||
pull.octopus::
|
pull.octopus::
|
||||||
The default merge strategy to use when pulling multiple branches
|
The default merge strategy to use when pulling multiple branches
|
||||||
|
|
|
@ -43,9 +43,10 @@ unreleased) version of git, that is available from 'master'
|
||||||
branch of the `git.git` repository.
|
branch of the `git.git` repository.
|
||||||
Documentation for older releases are available here:
|
Documentation for older releases are available here:
|
||||||
|
|
||||||
* link:v1.6.0/git.html[documentation for release 1.6.0]
|
* link:v1.6.1/git.html[documentation for release 1.6.1]
|
||||||
|
|
||||||
* release notes for
|
* release notes for
|
||||||
|
link:RelNotes-1.6.1.txt[1.6.1],
|
||||||
link:RelNotes-1.6.0.txt[1.6.0].
|
link:RelNotes-1.6.0.txt[1.6.0].
|
||||||
|
|
||||||
* link:v1.5.6.5/git.html[documentation for release 1.5.6.5]
|
* link:v1.5.6.5/git.html[documentation for release 1.5.6.5]
|
||||||
|
@ -497,7 +498,8 @@ other
|
||||||
'GIT_PAGER'::
|
'GIT_PAGER'::
|
||||||
This environment variable overrides `$PAGER`. If it is set
|
This environment variable overrides `$PAGER`. If it is set
|
||||||
to an empty string or to the value "cat", git will not launch
|
to an empty string or to the value "cat", git will not launch
|
||||||
a pager.
|
a pager. See also the `core.pager` option in
|
||||||
|
linkgit:git-config[1].
|
||||||
|
|
||||||
'GIT_SSH'::
|
'GIT_SSH'::
|
||||||
If this environment variable is set then 'git-fetch'
|
If this environment variable is set then 'git-fetch'
|
||||||
|
|
1
Makefile
1
Makefile
|
@ -735,6 +735,7 @@ ifeq ($(uname_S),HP-UX)
|
||||||
NO_UNSETENV = YesPlease
|
NO_UNSETENV = YesPlease
|
||||||
NO_HSTRERROR = YesPlease
|
NO_HSTRERROR = YesPlease
|
||||||
NO_SYS_SELECT_H = YesPlease
|
NO_SYS_SELECT_H = YesPlease
|
||||||
|
SNPRINTF_RETURNS_BOGUS = YesPlease
|
||||||
endif
|
endif
|
||||||
ifneq (,$(findstring MINGW,$(uname_S)))
|
ifneq (,$(findstring MINGW,$(uname_S)))
|
||||||
NO_MMAP = YesPlease
|
NO_MMAP = YesPlease
|
||||||
|
|
|
@ -564,8 +564,6 @@ static int checkout_fast_forward(unsigned char *head, unsigned char *remote)
|
||||||
struct dir_struct dir;
|
struct dir_struct dir;
|
||||||
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
|
struct lock_file *lock_file = xcalloc(1, sizeof(struct lock_file));
|
||||||
|
|
||||||
if (read_cache_unmerged())
|
|
||||||
die("you need to resolve your current index first");
|
|
||||||
refresh_cache(REFRESH_QUIET);
|
refresh_cache(REFRESH_QUIET);
|
||||||
|
|
||||||
fd = hold_locked_index(lock_file, 1);
|
fd = hold_locked_index(lock_file, 1);
|
||||||
|
@ -651,13 +649,15 @@ static void add_strategies(const char *string, unsigned attr)
|
||||||
static int merge_trivial(void)
|
static int merge_trivial(void)
|
||||||
{
|
{
|
||||||
unsigned char result_tree[20], result_commit[20];
|
unsigned char result_tree[20], result_commit[20];
|
||||||
struct commit_list parent;
|
struct commit_list *parent = xmalloc(sizeof(struct commit_list *));
|
||||||
|
|
||||||
write_tree_trivial(result_tree);
|
write_tree_trivial(result_tree);
|
||||||
printf("Wonderful.\n");
|
printf("Wonderful.\n");
|
||||||
parent.item = remoteheads->item;
|
parent->item = lookup_commit(head);
|
||||||
parent.next = NULL;
|
parent->next = xmalloc(sizeof(struct commit_list *));
|
||||||
commit_tree(merge_msg.buf, result_tree, &parent, result_commit);
|
parent->next->item = remoteheads->item;
|
||||||
|
parent->next->next = NULL;
|
||||||
|
commit_tree(merge_msg.buf, result_tree, parent, result_commit);
|
||||||
finish(result_commit, "In-index merge");
|
finish(result_commit, "In-index merge");
|
||||||
drop_save();
|
drop_save();
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -743,6 +743,7 @@ static int evaluate_result(void)
|
||||||
int cnt = 0;
|
int cnt = 0;
|
||||||
struct rev_info rev;
|
struct rev_info rev;
|
||||||
|
|
||||||
|
discard_cache();
|
||||||
if (read_cache() < 0)
|
if (read_cache() < 0)
|
||||||
die("failed to read the cache");
|
die("failed to read the cache");
|
||||||
|
|
||||||
|
@ -776,7 +777,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
||||||
struct commit_list **remotes = &remoteheads;
|
struct commit_list **remotes = &remoteheads;
|
||||||
|
|
||||||
setup_work_tree();
|
setup_work_tree();
|
||||||
if (unmerged_cache())
|
if (read_cache_unmerged())
|
||||||
die("You are in the middle of a conflicted merge.");
|
die("You are in the middle of a conflicted merge.");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -1078,6 +1079,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Automerge succeeded. */
|
/* Automerge succeeded. */
|
||||||
|
discard_cache();
|
||||||
write_tree_trivial(result_tree);
|
write_tree_trivial(result_tree);
|
||||||
automerge_was_ok = 1;
|
automerge_was_ok = 1;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -723,6 +723,18 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
|
||||||
die("early EOF '%s'", elem->path);
|
die("early EOF '%s'", elem->path);
|
||||||
|
|
||||||
result[len] = 0;
|
result[len] = 0;
|
||||||
|
|
||||||
|
/* If not a fake symlink, apply filters, e.g. autocrlf */
|
||||||
|
if (is_file) {
|
||||||
|
struct strbuf buf;
|
||||||
|
|
||||||
|
strbuf_init(&buf, 0);
|
||||||
|
if (convert_to_git(elem->path, result, len, &buf, safe_crlf)) {
|
||||||
|
free(result);
|
||||||
|
result = strbuf_detach(&buf, &len);
|
||||||
|
result_size = len;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
deleted_file:
|
deleted_file:
|
||||||
|
|
|
@ -3,14 +3,16 @@ git-p4 - Perforce <-> Git converter using git-fast-import
|
||||||
Usage
|
Usage
|
||||||
=====
|
=====
|
||||||
|
|
||||||
git-p4 supports two main modes: Importing from Perforce to a Git repository is
|
git-p4 can be used in two different ways:
|
||||||
done using "git-p4 sync" or "git-p4 rebase". Submitting changes from Git back
|
|
||||||
to Perforce is done using "git-p4 submit".
|
1) To import changes from Perforce to a Git repository, using "git-p4 sync".
|
||||||
|
|
||||||
|
2) To submit changes from Git back to Perforce, using "git-p4 submit".
|
||||||
|
|
||||||
Importing
|
Importing
|
||||||
=========
|
=========
|
||||||
|
|
||||||
You can simply start with
|
Simply start with
|
||||||
|
|
||||||
git-p4 clone //depot/path/project
|
git-p4 clone //depot/path/project
|
||||||
|
|
||||||
|
@ -18,11 +20,18 @@ or
|
||||||
|
|
||||||
git-p4 clone //depot/path/project myproject
|
git-p4 clone //depot/path/project myproject
|
||||||
|
|
||||||
This will create an empty git repository in a subdirectory called "project" (or
|
This will:
|
||||||
"myproject" with the second command), import the head revision from the
|
|
||||||
specified perforce path into a git "p4" branch (remotes/p4 actually), create a
|
1) Create an empty git repository in a subdirectory called "project" (or
|
||||||
master branch off it and check it out. If you want the entire history (not just
|
"myproject" with the second command)
|
||||||
the head revision) then you can simply append a "@all" to the depot path:
|
|
||||||
|
2) Import the head revision from the given Perforce path into a git branch
|
||||||
|
called "p4" (remotes/p4 actually)
|
||||||
|
|
||||||
|
3) Create a master branch based on it and check it out.
|
||||||
|
|
||||||
|
If you want the entire history (not just the head revision) then you can simply
|
||||||
|
append a "@all" to the depot path:
|
||||||
|
|
||||||
git-p4 clone //depot/project/main@all myproject
|
git-p4 clone //depot/project/main@all myproject
|
||||||
|
|
||||||
|
@ -37,31 +46,40 @@ If you want more control you can also use the git-p4 sync command directly:
|
||||||
|
|
||||||
This will import the current head revision of the specified depot path into a
|
This will import the current head revision of the specified depot path into a
|
||||||
"remotes/p4/master" branch of your git repository. You can use the
|
"remotes/p4/master" branch of your git repository. You can use the
|
||||||
--branch=mybranch option to use a different branch.
|
--branch=mybranch option to import into a different branch.
|
||||||
|
|
||||||
If you want to import the entire history of a given depot path just use
|
If you want to import the entire history of a given depot path simply use:
|
||||||
|
|
||||||
git-p4 sync //path/in/depot@all
|
git-p4 sync //path/in/depot@all
|
||||||
|
|
||||||
|
|
||||||
|
Note:
|
||||||
|
|
||||||
To achieve optimal compression you may want to run 'git repack -a -d -f' after
|
To achieve optimal compression you may want to run 'git repack -a -d -f' after
|
||||||
a big import. This may take a while.
|
a big import. This may take a while.
|
||||||
|
|
||||||
Support for Perforce integrations is still work in progress. Don't bother
|
|
||||||
trying it unless you want to hack on it :)
|
|
||||||
|
|
||||||
Incremental Imports
|
Incremental Imports
|
||||||
===================
|
===================
|
||||||
|
|
||||||
After an initial import you can easily synchronize your git repository with
|
After an initial import you can continue to synchronize your git repository
|
||||||
newer changes from the Perforce depot by just calling
|
with newer changes from the Perforce depot by just calling
|
||||||
|
|
||||||
git-p4 sync
|
git-p4 sync
|
||||||
|
|
||||||
in your git repository. By default the "remotes/p4/master" branch is updated.
|
in your git repository. By default the "remotes/p4/master" branch is updated.
|
||||||
|
|
||||||
It is recommended to run 'git repack -a -d -f' from time to time when using
|
Advanced Setup
|
||||||
incremental imports to optimally combine the individual git packs that each
|
==============
|
||||||
incremental import creates through the use of git-fast-import.
|
|
||||||
|
Suppose you have a periodically updated git repository somewhere, containing a
|
||||||
|
complete import of a Perforce project. This repository can be cloned and used
|
||||||
|
with git-p4. When updating the cloned repository with the "sync" command,
|
||||||
|
git-p4 will try to fetch changes from the original repository first. The git
|
||||||
|
protocol used with this is usually faster than importing from Perforce
|
||||||
|
directly.
|
||||||
|
|
||||||
|
This behaviour can be disabled by setting the "git-p4.syncFromOrigin" git
|
||||||
|
configuration variable to "false".
|
||||||
|
|
||||||
Updating
|
Updating
|
||||||
========
|
========
|
||||||
|
@ -79,7 +97,7 @@ Submitting
|
||||||
==========
|
==========
|
||||||
|
|
||||||
git-p4 has support for submitting changes from a git repository back to the
|
git-p4 has support for submitting changes from a git repository back to the
|
||||||
Perforce depot. This requires a Perforce checkout separate to your git
|
Perforce depot. This requires a Perforce checkout separate from your git
|
||||||
repository. To submit all changes that are in the current git branch but not in
|
repository. To submit all changes that are in the current git branch but not in
|
||||||
the "p4" branch (or "origin" if "p4" doesn't exist) simply call
|
the "p4" branch (or "origin" if "p4" doesn't exist) simply call
|
||||||
|
|
||||||
|
@ -97,17 +115,6 @@ continue importing the remaining changes with
|
||||||
|
|
||||||
git-p4 submit --continue
|
git-p4 submit --continue
|
||||||
|
|
||||||
After submitting you should sync your perforce import branch ("p4" or "origin")
|
|
||||||
from Perforce using git-p4's sync command.
|
|
||||||
|
|
||||||
If you have changes in your working directory that you haven't committed into
|
|
||||||
git yet but that you want to commit to Perforce directly ("quick fixes") then
|
|
||||||
you do not have to go through the intermediate step of creating a git commit
|
|
||||||
first but you can just call
|
|
||||||
|
|
||||||
git-p4 submit --direct
|
|
||||||
|
|
||||||
|
|
||||||
Example
|
Example
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
|
|
@ -269,6 +269,17 @@ test_expect_success 'merge-recursive result' '
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'fail if the index has unresolved entries' '
|
||||||
|
|
||||||
|
rm -fr [abcd] &&
|
||||||
|
git checkout -f "$c1" &&
|
||||||
|
|
||||||
|
test_must_fail git merge "$c5" &&
|
||||||
|
test_must_fail git merge "$c5" 2> out &&
|
||||||
|
grep "You are in the middle of a conflicted merge" out
|
||||||
|
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'merge-recursive remove conflict' '
|
test_expect_success 'merge-recursive remove conflict' '
|
||||||
|
|
||||||
rm -fr [abcd] &&
|
rm -fr [abcd] &&
|
||||||
|
|
|
@ -352,4 +352,20 @@ test_expect_success 'checkdiff allows new blank lines' '
|
||||||
git diff --check
|
git diff --check
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'combined diff with autocrlf conversion' '
|
||||||
|
|
||||||
|
git reset --hard &&
|
||||||
|
echo >x hello &&
|
||||||
|
git commit -m "one side" x &&
|
||||||
|
git checkout HEAD^ &&
|
||||||
|
echo >x goodbye &&
|
||||||
|
git commit -m "the other side" x &&
|
||||||
|
git config core.autocrlf true &&
|
||||||
|
test_must_fail git merge master &&
|
||||||
|
|
||||||
|
git diff | sed -e "1,/^@@@/d" >actual &&
|
||||||
|
! grep "^-" actual
|
||||||
|
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
|
@ -498,4 +498,13 @@ test_expect_success 'merge fast-forward in a dirty tree' '
|
||||||
|
|
||||||
test_debug 'gitk --all'
|
test_debug 'gitk --all'
|
||||||
|
|
||||||
|
test_expect_success 'in-index merge' '
|
||||||
|
git reset --hard c0 &&
|
||||||
|
git merge --no-ff -s resolve c1 > out &&
|
||||||
|
grep "Wonderful." out &&
|
||||||
|
verify_parents $c0 $c1
|
||||||
|
'
|
||||||
|
|
||||||
|
test_debug 'gitk --all'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
|
@ -36,7 +36,9 @@ test_expect_success 'merge c1 to c2' '
|
||||||
git diff --exit-code &&
|
git diff --exit-code &&
|
||||||
test -f c0.c &&
|
test -f c0.c &&
|
||||||
test -f c1.c &&
|
test -f c1.c &&
|
||||||
test -f c2.c
|
test -f c2.c &&
|
||||||
|
test 3 = $(git ls-tree -r HEAD | wc -l) &&
|
||||||
|
test 3 = $(git ls-files | wc -l)
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'merge c2 to c3 (fails)' '
|
test_expect_success 'merge c2 to c3 (fails)' '
|
||||||
|
|
Загрузка…
Ссылка в новой задаче