* Re: [RFC/PATCH] lockfile: show absolute filename in unable_to_lock_message.
From: Johannes Sixt @ 2010-01-06 18:50 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git
In-Reply-To: <1262797288-23004-1-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy schrieb:
> - path, strerror(err));
> + make_absolute_path(path), strerror(err));
> } else
> - strbuf_addf(&buf, "Unable to create '%s.lock': %s", path, strerror(err));
> + strbuf_addf(&buf, "Unable to create '%s.lock': %s",
> + make_absolute_path(path), strerror(err));
Since these are merely informative, wouldn't it be more suitable to use
make_nonrelative_path()?
-- Hannes
^ permalink raw reply
* git pull --all fails (possible options handling bug in git pull?)
From: Zing @ 2010-01-06 19:05 UTC (permalink / raw)
To: git
In 1.6.6, if I do:
$ git pull --all
Fetching origin
Fetching gnome
You asked to pull from the remote '--all', but did not specify
a branch. Because this is not the default configured remote
for your current branch, you must specify a branch on the command line.
The fetch all remotes works, but shouldn't the "--all" option only apply
to the fetch operation? It looks like it's getting noticed by the merge
part of the pull.
^ permalink raw reply
* Re: git file sharing/versioning.
From: Nicolas Sebrecht @ 2010-01-06 19:42 UTC (permalink / raw)
To: Bas Driessen; +Cc: Nicolas Sebrecht, git
In-Reply-To: <1262732791.14714.7.camel@ams.xobas.net>
[ Please, don't top post and don't answer to me in private for public
questions. ]
The 06/01/10, Bas Driessen wrote:
> Btw, this list does not appear to be a "user" list, more a "developer"
> list. Is there a list specifically for users only?
They are the manual pages... for end-users.
--
Nicolas Sebrecht
^ permalink raw reply
* Re: [RFC/PATCH] commit: make the error message on unmerged entries user-friendly.
From: Matthieu Moy @ 2010-01-06 19:53 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v8wcbw14f.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
>> # Unmerged paths:
>> # (use "git add/rm <file>..." as appropriate to mark resolution)
[...]
> That one line we see above is concise and does mention "rm" as
> well. Why not use it?
Fine, you convinced me. I was thinking of a longer sentence, but "/rm"
doesn't harm.
>>> I think we should consolidate them all.
>>
>> Right, although "commit" is definitely the most important (dumb users
>> don't need "git merge").
>
> Your "dumb users" don't get the unmerged error from commit, either, if
> they don't need "git merge".
They'd use "pull", not merge. Anyway, I did it for commit, merge,
pull, revert, cherry-pick. I guess we covered the common cases.
The patch seems to have a lot of redundancies, but I think trying to
factor this into helper functions would be much more effort than the
few cut-and-paste that I had to do, since each instance is a slight
variant of each other ...
Patch follows. Let me know in case you prefer to split it.
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* Re: submodules' shortcomings, was Re: RFC: display dirty submodule working directory in git gui and gitk
From: Junio C Hamano @ 2010-01-06 20:01 UTC (permalink / raw)
To: Jens Lehmann
Cc: Nguyen Thai Ngoc Duy, Johannes Schindelin, Git Mailing List,
Shawn O. Pearce, Paul Mackerras, Heiko Voigt, Lars Hjemli,
Avery Pennarun
In-Reply-To: <4B44D73F.6000607@web.de>
Jens Lehmann <Jens.Lehmann@web.de> writes:
> Am 06.01.2010 18:55, schrieb Junio C Hamano:
>> I was envisioning that the "git status" in submodule will be run with its
>> recent --porcelain option, and "git status" or "git commit" would read it
>> to postprocess and incorporate into its own output.
>
> And i thought about printing just one line for each dirty submodule that
> contains uncommitted and/or new files. I did not intend to list every
> file, for the same reason a "git diff --submodule" only shows the first
> line of the commit messages, not the actual differences of all changed
> files in the submodule. I am not against being able to show all files
> too, but i really would want to have an option to get a short output for
> git gui and gitk.
I don't think what you are saying is inconsistent with "git status/commit
that reads from 'git status --porcelain' it runs in a submodule directory,
postprocesses it and incorporates it into its own output." When the
sub-status reports changes, your "postprocess" would condense it down to
"this has a potential change that user could want to commit". How the
dirtiness is shown is entirely up to the caller that detected that change.
Let's explain it in another way.
The original "diff" for a submodule entry was implemented by preparing a
"Subproject commit %s\n"
line for the submodule commit recorded in the preimage and postimage, and
compare these as if they are one-line files. When the postimage was work
tree, it looked at submodule's .git/HEAD to learn what to stuff in %s
there.
But nobody forced you to limit the check only to .git/HEAD in the
submodule. To make the comparison richer, you could check if the
submodule directory is dirty (and we have already discussed the potential
definition of dirtiness earlier), and add "-dirty" in the string as well.
With such a change, if you make some changes to a file in the work tree of
the submodule after a clean "clone", "git diff" between the index and the
work tree would report:
-Subproject commit 37bae10e38a66e4f1ddd5350daded00b21735126
+Subproject commit 37bae10e38a66e4f1ddd5350daded00b21735126-dirty
The suggestion to read from "status --porcelain" that is run in the
submodule directory was about how to implement the part that determines
this "dirtiness" information, and not about how that dirtiness is
expressed in the output. The above is an illustration that even the
traditional output format can be made aware of this submodule dirtiness
check. "diff --submodule" can express that dirtiness information in any
way it wants.
^ permalink raw reply
* Re: [RFC/PATCH] commit: make the error message on unmerged entries user-friendly.
From: Junio C Hamano @ 2010-01-06 20:05 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git
In-Reply-To: <vpqocl76mdo.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
> They'd use "pull", not merge. Anyway, I did it for commit, merge,
> pull, revert, cherry-pick. I guess we covered the common cases.
> The patch seems to have a lot of redundancies, but I think trying to
> factor this into helper functions would be much more effort than the
> few cut-and-paste that I had to do, since each instance is a slight
> variant of each other ...
I'd be more worried about longer term maintainability than one time
expediency of producing your single patch to add these messages. If the
messages are cast in stone, we can just verify they are consistent _now_
and forget about them, but I suspect not even you are perfect to predict
that we won't come up with different/better ways to resolve and mark them
resolved in the future and write a set of messages that won't have to
change.
^ permalink raw reply
* [PATCH 1/2] git-svn: ignore changeless commits when checking for a cherry-pick
From: Andrew Myrick @ 2010-01-06 20:08 UTC (permalink / raw)
To: git; +Cc: sam, normalperson, Andrew Myrick
Update git-svn to ignore commits that do not change the tree when it is
deciding if an svn merge ticket represents a real branch merge or just a
cherry-pick.
Consider the following integration model in the svn repository:
F---G branch1
/ \
D tag1 \ E tag2
/ \ /
A---B C trunk
branch1 is merged to trunk in commit C.
With this patch, git-svn will correctly identify branch1 as a proper merge
parent, instead of incorrectly ignoring it as a cherry-pick.
Signed-off-by: Andrew Myrick <amyrick@apple.com>
---
git-svn.perl | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 650c9e5..8c7c034 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3052,12 +3052,36 @@ sub check_cherry_pick {
for my $range ( @ranges ) {
delete @commits{_rev_list($range)};
}
+ for my $commit (keys %commits) {
+ if (has_no_changes($commit)) {
+ delete $commits{$commit};
+ }
+ }
return (keys %commits);
}
+sub has_no_changes {
+ my $commit = shift;
+
+ my @revs = split / /, command_oneline(
+ qw(rev-list --parents -1 -m), $commit);
+
+ # Commits with no parents, e.g. the start of a partial branch,
+ # have changes by definition.
+ return 1 if (@revs < 2);
+
+ # Commits with multiple parents, e.g a merge, have no changes
+ # by definition.
+ return 0 if (@revs > 2);
+
+ return (command_oneline("rev-parse", "$commit^{tree}") eq
+ command_oneline("rev-parse", "$commit~1^{tree}"));
+}
+
BEGIN {
memoize 'lookup_svn_merge';
memoize 'check_cherry_pick';
+ memoize 'has_no_changes';
}
sub parents_exclude {
--
1.6.6.2.g18c9a
^ permalink raw reply related
* [PATCH 2/2] git-svn: handle merge-base failures
From: Andrew Myrick @ 2010-01-06 20:08 UTC (permalink / raw)
To: git; +Cc: sam, normalperson, Andrew Myrick
In-Reply-To: <1262808529-1575-1-git-send-email-amyrick@apple.com>
Change git-svn to warn and continue when merge-base fails while processing svn
merge tickets.
merge-base can fail when a partial branch is created and merged back to trunk
in svn, because it cannot find a common ancestor between the partial branch and
trunk.
Signed-off-by: Andrew Myrick <amyrick@apple.com>
---
git-svn.perl | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 8c7c034..d58982b 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3158,10 +3158,21 @@ sub find_extra_svn_parents {
my $ranges = $ranges{$merge_tip};
# check out 'new' tips
- my $merge_base = command_oneline(
- "merge-base",
- @$parents, $merge_tip,
- );
+ my $merge_base;
+ eval {
+ $merge_base = command_oneline(
+ "merge-base",
+ @$parents, $merge_tip,
+ );
+ };
+ if ($@) {
+ die "An error occurred during merge-base"
+ unless $@->isa("Git::Error::Command");
+
+ warn "W: Cannot find common ancestor between ".
+ "@$parents and $merge_tip. Ignoring merge info.\n";
+ next;
+ }
# double check that there are no missing non-merge commits
my (@incomplete) = check_cherry_pick(
--
1.6.6.2.g18c9a
^ permalink raw reply related
* Re: [RFC/PATCH] commit: make the error message on unmerged entries user-friendly.
From: Matthieu Moy @ 2010-01-06 20:15 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7vy6kbt2ww.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
>
>> They'd use "pull", not merge. Anyway, I did it for commit, merge,
>> pull, revert, cherry-pick. I guess we covered the common cases.
>> The patch seems to have a lot of redundancies, but I think trying to
>> factor this into helper functions would be much more effort than the
>> few cut-and-paste that I had to do, since each instance is a slight
>> variant of each other ...
>
> I'd be more worried about longer term maintainability than one time
> expediency of producing your single patch to add these messages. If the
> messages are cast in stone, we can just verify they are consistent _now_
> and forget about them, but I suspect not even you are perfect to predict
> that we won't come up with different/better ways to resolve and mark them
> resolved in the future and write a set of messages that won't have to
> change.
Sorry, I sent the message a bit too early. Re-reading the patch, there
were actually pieces to factor. There's still duplication between C
and shell, and sentences which are actually reworded from a place to
another.
OTOH, maybe this reveals some differences that should be eliminated.
For example, 'git cherry-pick' has no problem with
$GIT_DIR/MERGE_HEAD, while 'git merge' will immediately if it exists.
Maybe we should write a helper like
ensure_everything_is_ok_for_a_merge_or_die() called by both
cherry-pick and merge?
This time, patch actually follows ;-).
--
Matthieu Moy
http://www-verimag.imag.fr/~moy/
^ permalink raw reply
* [PATCH v2] Be more user-friendly when refusing to do something because of conflict.
From: Matthieu Moy @ 2010-01-06 20:17 UTC (permalink / raw)
To: git, gitster; +Cc: Matthieu Moy
In-Reply-To: <vpqhbqz6lcr.fsf@bauges.imag.fr>
Various commands refuse to run in the presence of conflicts (commit,
merge, pull, cherry-pick/revert). They all used to provide rough, and
inconsistant error messages.
A new variable advice.resolveconflict is introduced, and allows more
verbose messages, pointing the user to the appropriate solution.
For commit, the error message used to look like this:
$ git commit
foo.txt: needs merge
foo.txt: unmerged (c34a92682e0394bc0d6f4d4a67a8e2d32395c169)
foo.txt: unmerged (3afcd75de8de0bb5076942fcb17446be50451030)
foo.txt: unmerged (c9785d77b76dfe4fb038bf927ee518f6ae45ede4)
error: Error building trees
The "need merge" line is given by refresh_cache. We add the IN_PORCELAIN
option to make the output more consistant with the other porcelain
commands, and catch the error in return, to stop with a clean error
message. The next lines were displayed by a call to cache_tree_update(),
which is not reached anymore if we noticed the conflict.
Pull is slightly modified to abort immediately if $GIT_DIR/MERGE_HEAD
exists instead of waiting for merge to complain.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
Documentation/config.txt | 4 ++++
advice.c | 12 ++++++++++++
advice.h | 3 +++
builtin-commit.c | 15 +++++++++++++--
builtin-merge.c | 15 ++++++++++-----
builtin-revert.c | 15 ++++++++++++++-
git-pull.sh | 25 +++++++++++++++++++++++--
7 files changed, 79 insertions(+), 10 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 23a965e..5078d26 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -130,6 +130,10 @@ advice.*::
Advice shown when linkgit:git-merge[1] refuses to
merge to avoid overwritting local changes.
Default: true.
+ resolveConflict::
+ Advices shown by various commands when conflicts
+ prevent the operation from being performed.
+ Default: true.
--
core.fileMode::
diff --git a/advice.c b/advice.c
index cb666ac..ec2bd82 100644
--- a/advice.c
+++ b/advice.c
@@ -3,6 +3,7 @@
int advice_push_nonfastforward = 1;
int advice_status_hints = 1;
int advice_commit_before_merge = 1;
+int advice_resolve_conflict = 1;
static struct {
const char *name;
@@ -11,6 +12,7 @@ static struct {
{ "pushnonfastforward", &advice_push_nonfastforward },
{ "statushints", &advice_status_hints },
{ "commitbeforemerge", &advice_commit_before_merge },
+ { "resolveconflict", &advice_resolve_conflict },
};
int git_default_advice_config(const char *var, const char *value)
@@ -27,3 +29,13 @@ int git_default_advice_config(const char *var, const char *value)
return 0;
}
+
+void NORETURN die_resolve_conflict(const char *me)
+{
+ if (advice_resolve_conflict)
+ die("'%s' is not possible because you have unmerged files.\n"
+ "Please, fix them up in the work tree, and then use 'git add/rm <file>'\n"
+ "as appropriate to mark resolution, or use 'git commit -a'.", me);
+ else
+ die("'%s' is not possible because you have unmerged files.", me);
+}
diff --git a/advice.h b/advice.h
index 3de5000..a6b4422 100644
--- a/advice.h
+++ b/advice.h
@@ -4,7 +4,10 @@
extern int advice_push_nonfastforward;
extern int advice_status_hints;
extern int advice_commit_before_merge;
+extern int advice_resolve_conflict;
int git_default_advice_config(const char *var, const char *value);
+extern void NORETURN die_resolve_conflict(const char *me);
+
#endif /* ADVICE_H */
diff --git a/builtin-commit.c b/builtin-commit.c
index 3dfcd77..a4977ac 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -235,6 +235,17 @@ static void create_base_index(void)
exit(128); /* We've already reported the error, finish dying */
}
+static void refresh_cache_or_die(int refresh_flags)
+{
+ /*
+ * refresh_flags contains REFRESH_QUIET, so the only errors
+ * are for unmerged entries.
+ */
+ if(refresh_cache(refresh_flags | REFRESH_IN_PORCELAIN)) {
+ die_resolve_conflict("commit");
+ }
+}
+
static char *prepare_index(int argc, const char **argv, const char *prefix, int is_status)
{
int fd;
@@ -274,7 +285,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
if (all || (also && pathspec && *pathspec)) {
int fd = hold_locked_index(&index_lock, 1);
add_files_to_cache(also ? prefix : NULL, pathspec, 0);
- refresh_cache(refresh_flags);
+ refresh_cache_or_die(refresh_flags);
if (write_cache(fd, active_cache, active_nr) ||
close_lock_file(&index_lock))
die("unable to write new_index file");
@@ -293,7 +304,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
*/
if (!pathspec || !*pathspec) {
fd = hold_locked_index(&index_lock, 1);
- refresh_cache(refresh_flags);
+ refresh_cache_or_die(refresh_flags);
if (write_cache(fd, active_cache, active_nr) ||
commit_locked_index(&index_lock))
die("unable to write new_index file");
diff --git a/builtin-merge.c b/builtin-merge.c
index f1c84d7..abe6c03 100644
--- a/builtin-merge.c
+++ b/builtin-merge.c
@@ -847,11 +847,16 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
const char *best_strategy = NULL, *wt_strategy = NULL;
struct commit_list **remotes = &remoteheads;
- if (file_exists(git_path("MERGE_HEAD")))
- die("You have not concluded your merge. (MERGE_HEAD exists)");
- if (read_cache_unmerged())
- die("You are in the middle of a conflicted merge."
- " (index unmerged)");
+ if (read_cache_unmerged()) {
+ die_resolve_conflict("merge");
+ }
+ if (file_exists(git_path("MERGE_HEAD"))) {
+ if (advice_resolve_conflict)
+ die("You have not concluded your merge (MERGE_HEAD exists).\n"
+ "Please, commit your changes before you can merge.");
+ else
+ die("You have not concluded your merge (MERGE_HEAD exists).");
+ }
/*
* Check if we are _not_ on a detached HEAD, i.e. if there is a
diff --git a/builtin-revert.c b/builtin-revert.c
index 151aa6a..d14dde3 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -233,6 +233,19 @@ static struct tree *empty_tree(void)
return tree;
}
+static NORETURN void die_dirty_index(const char *me)
+{
+ if (read_cache_unmerged()) {
+ die_resolve_conflict(me);
+ } else {
+ if (advice_commit_before_merge)
+ die("Your local changes would be overwritten by %s.\n"
+ "Please, commit your changes or stash them to proceed.", me);
+ else
+ die("Your local changes would be overwritten by %s.\n", me);
+ }
+}
+
static int revert_or_cherry_pick(int argc, const char **argv)
{
unsigned char head[20];
@@ -269,7 +282,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
if (get_sha1("HEAD", head))
die ("You do not have a valid HEAD");
if (index_differs_from("HEAD", 0))
- die ("Dirty index: cannot %s", me);
+ die_dirty_index(me);
}
discard_cache();
diff --git a/git-pull.sh b/git-pull.sh
index 9e69ada..54ce0af 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -13,8 +13,29 @@ set_reflog_action "pull $*"
require_work_tree
cd_to_toplevel
-test -z "$(git ls-files -u)" ||
- die "You are in the middle of a conflicted merge."
+
+die_conflict () {
+ git diff-index --cached --name-status -r --ignore-submodules HEAD --
+ if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
+ die "Pull is not possible because you have unmerged files.
+Please, fix them up in the work tree, and then use 'git add/rm <file>'
+as appropriate to mark resolution, or use 'git commit -a'."
+ else
+ die "Pull is not possible because you have unmerged files."
+ fi
+}
+
+die_merge () {
+ if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
+ die "You have not concluded your merge (MERGE_HEAD exists).
+Please, commit your changes before you can merge."
+ else
+ die "You have not concluded your merge (MERGE_HEAD exists)."
+ fi
+}
+
+test -z "$(git ls-files -u)" || die_conflict
+test -f "$GIT_DIR/MERGE_HEAD" && die_merge
strategy_args= diffstat= no_commit= squash= no_ff= ff_only=
log_arg= verbosity=
--
1.6.6.81.g35ec3e.dirty
^ permalink raw reply related
* [PATCH v3] Be more user-friendly when refusing to do something because of conflict.
From: Matthieu Moy @ 2010-01-06 20:36 UTC (permalink / raw)
To: git, gitster; +Cc: Matthieu Moy
In-Reply-To: <1262809074-27137-1-git-send-email-Matthieu.Moy@imag.fr>
Various commands refuse to run in the presence of conflicts (commit,
merge, pull, cherry-pick/revert). They all used to provide rough, and
inconsistant error messages.
A new variable advice.resolveconflict is introduced, and allows more
verbose messages, pointing the user to the appropriate solution.
For commit, the error message used to look like this:
$ git commit
foo.txt: needs merge
foo.txt: unmerged (c34a92682e0394bc0d6f4d4a67a8e2d32395c169)
foo.txt: unmerged (3afcd75de8de0bb5076942fcb17446be50451030)
foo.txt: unmerged (c9785d77b76dfe4fb038bf927ee518f6ae45ede4)
error: Error building trees
The "need merge" line is given by refresh_cache. We add the IN_PORCELAIN
option to make the output more consistant with the other porcelain
commands, and catch the error in return, to stop with a clean error
message. The next lines were displayed by a call to cache_tree_update(),
which is not reached anymore if we noticed the conflict.
Pull is slightly modified to abort immediately if $GIT_DIR/MERGE_HEAD
exists instead of waiting for merge to complain.
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
---
Sorry, v2 missed a #include "git-compat-utils.h", it's not even compilable.
Documentation/config.txt | 4 ++++
advice.c | 12 ++++++++++++
advice.h | 5 +++++
builtin-commit.c | 15 +++++++++++++--
builtin-merge.c | 15 ++++++++++-----
builtin-revert.c | 15 ++++++++++++++-
git-pull.sh | 25 +++++++++++++++++++++++--
7 files changed, 81 insertions(+), 10 deletions(-)
diff --git a/Documentation/config.txt b/Documentation/config.txt
index 23a965e..5078d26 100644
--- a/Documentation/config.txt
+++ b/Documentation/config.txt
@@ -130,6 +130,10 @@ advice.*::
Advice shown when linkgit:git-merge[1] refuses to
merge to avoid overwritting local changes.
Default: true.
+ resolveConflict::
+ Advices shown by various commands when conflicts
+ prevent the operation from being performed.
+ Default: true.
--
core.fileMode::
diff --git a/advice.c b/advice.c
index cb666ac..ec2bd82 100644
--- a/advice.c
+++ b/advice.c
@@ -3,6 +3,7 @@
int advice_push_nonfastforward = 1;
int advice_status_hints = 1;
int advice_commit_before_merge = 1;
+int advice_resolve_conflict = 1;
static struct {
const char *name;
@@ -11,6 +12,7 @@ static struct {
{ "pushnonfastforward", &advice_push_nonfastforward },
{ "statushints", &advice_status_hints },
{ "commitbeforemerge", &advice_commit_before_merge },
+ { "resolveconflict", &advice_resolve_conflict },
};
int git_default_advice_config(const char *var, const char *value)
@@ -27,3 +29,13 @@ int git_default_advice_config(const char *var, const char *value)
return 0;
}
+
+void NORETURN die_resolve_conflict(const char *me)
+{
+ if (advice_resolve_conflict)
+ die("'%s' is not possible because you have unmerged files.\n"
+ "Please, fix them up in the work tree, and then use 'git add/rm <file>'\n"
+ "as appropriate to mark resolution, or use 'git commit -a'.", me);
+ else
+ die("'%s' is not possible because you have unmerged files.", me);
+}
diff --git a/advice.h b/advice.h
index 3de5000..acd5fdd 100644
--- a/advice.h
+++ b/advice.h
@@ -1,10 +1,15 @@
#ifndef ADVICE_H
#define ADVICE_H
+#include "git-compat-util.h"
+
extern int advice_push_nonfastforward;
extern int advice_status_hints;
extern int advice_commit_before_merge;
+extern int advice_resolve_conflict;
int git_default_advice_config(const char *var, const char *value);
+extern void NORETURN die_resolve_conflict(const char *me);
+
#endif /* ADVICE_H */
diff --git a/builtin-commit.c b/builtin-commit.c
index 3dfcd77..a4977ac 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -235,6 +235,17 @@ static void create_base_index(void)
exit(128); /* We've already reported the error, finish dying */
}
+static void refresh_cache_or_die(int refresh_flags)
+{
+ /*
+ * refresh_flags contains REFRESH_QUIET, so the only errors
+ * are for unmerged entries.
+ */
+ if(refresh_cache(refresh_flags | REFRESH_IN_PORCELAIN)) {
+ die_resolve_conflict("commit");
+ }
+}
+
static char *prepare_index(int argc, const char **argv, const char *prefix, int is_status)
{
int fd;
@@ -274,7 +285,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
if (all || (also && pathspec && *pathspec)) {
int fd = hold_locked_index(&index_lock, 1);
add_files_to_cache(also ? prefix : NULL, pathspec, 0);
- refresh_cache(refresh_flags);
+ refresh_cache_or_die(refresh_flags);
if (write_cache(fd, active_cache, active_nr) ||
close_lock_file(&index_lock))
die("unable to write new_index file");
@@ -293,7 +304,7 @@ static char *prepare_index(int argc, const char **argv, const char *prefix, int
*/
if (!pathspec || !*pathspec) {
fd = hold_locked_index(&index_lock, 1);
- refresh_cache(refresh_flags);
+ refresh_cache_or_die(refresh_flags);
if (write_cache(fd, active_cache, active_nr) ||
commit_locked_index(&index_lock))
die("unable to write new_index file");
diff --git a/builtin-merge.c b/builtin-merge.c
index f1c84d7..abe6c03 100644
--- a/builtin-merge.c
+++ b/builtin-merge.c
@@ -847,11 +847,16 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
const char *best_strategy = NULL, *wt_strategy = NULL;
struct commit_list **remotes = &remoteheads;
- if (file_exists(git_path("MERGE_HEAD")))
- die("You have not concluded your merge. (MERGE_HEAD exists)");
- if (read_cache_unmerged())
- die("You are in the middle of a conflicted merge."
- " (index unmerged)");
+ if (read_cache_unmerged()) {
+ die_resolve_conflict("merge");
+ }
+ if (file_exists(git_path("MERGE_HEAD"))) {
+ if (advice_resolve_conflict)
+ die("You have not concluded your merge (MERGE_HEAD exists).\n"
+ "Please, commit your changes before you can merge.");
+ else
+ die("You have not concluded your merge (MERGE_HEAD exists).");
+ }
/*
* Check if we are _not_ on a detached HEAD, i.e. if there is a
diff --git a/builtin-revert.c b/builtin-revert.c
index 151aa6a..d14dde3 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -233,6 +233,19 @@ static struct tree *empty_tree(void)
return tree;
}
+static NORETURN void die_dirty_index(const char *me)
+{
+ if (read_cache_unmerged()) {
+ die_resolve_conflict(me);
+ } else {
+ if (advice_commit_before_merge)
+ die("Your local changes would be overwritten by %s.\n"
+ "Please, commit your changes or stash them to proceed.", me);
+ else
+ die("Your local changes would be overwritten by %s.\n", me);
+ }
+}
+
static int revert_or_cherry_pick(int argc, const char **argv)
{
unsigned char head[20];
@@ -269,7 +282,7 @@ static int revert_or_cherry_pick(int argc, const char **argv)
if (get_sha1("HEAD", head))
die ("You do not have a valid HEAD");
if (index_differs_from("HEAD", 0))
- die ("Dirty index: cannot %s", me);
+ die_dirty_index(me);
}
discard_cache();
diff --git a/git-pull.sh b/git-pull.sh
index 9e69ada..54ce0af 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -13,8 +13,29 @@ set_reflog_action "pull $*"
require_work_tree
cd_to_toplevel
-test -z "$(git ls-files -u)" ||
- die "You are in the middle of a conflicted merge."
+
+die_conflict () {
+ git diff-index --cached --name-status -r --ignore-submodules HEAD --
+ if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
+ die "Pull is not possible because you have unmerged files.
+Please, fix them up in the work tree, and then use 'git add/rm <file>'
+as appropriate to mark resolution, or use 'git commit -a'."
+ else
+ die "Pull is not possible because you have unmerged files."
+ fi
+}
+
+die_merge () {
+ if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
+ die "You have not concluded your merge (MERGE_HEAD exists).
+Please, commit your changes before you can merge."
+ else
+ die "You have not concluded your merge (MERGE_HEAD exists)."
+ fi
+}
+
+test -z "$(git ls-files -u)" || die_conflict
+test -f "$GIT_DIR/MERGE_HEAD" && die_merge
strategy_args= diffstat= no_commit= squash= no_ff= ff_only=
log_arg= verbosity=
--
1.6.6.81.g2955.dirty
^ permalink raw reply related
* Re: [PATCH v2] Be more user-friendly when refusing to do something because of conflict.
From: Junio C Hamano @ 2010-01-06 21:04 UTC (permalink / raw)
To: Matthieu Moy; +Cc: git
In-Reply-To: <1262809074-27137-1-git-send-email-Matthieu.Moy@imag.fr>
Matthieu Moy <Matthieu.Moy@imag.fr> writes:
> Various commands refuse to run in the presence of conflicts (commit,
> merge, pull, cherry-pick/revert). They all used to provide rough, and
> inconsistant error messages.
>
> A new variable advice.resolveconflict is introduced, and allows more
> verbose messages, pointing the user to the appropriate solution.
>
> For commit, the error message used to look like this:
>
> $ git commit
> foo.txt: needs merge
> foo.txt: unmerged (c34a92682e0394bc0d6f4d4a67a8e2d32395c169)
> foo.txt: unmerged (3afcd75de8de0bb5076942fcb17446be50451030)
> foo.txt: unmerged (c9785d77b76dfe4fb038bf927ee518f6ae45ede4)
> error: Error building trees
>
> The "need merge" line is given by refresh_cache. We add the IN_PORCELAIN
> option to make the output more consistant with the other porcelain
> commands, and catch the error in return, to stop with a clean error
> message. The next lines were displayed by a call to cache_tree_update(),
> which is not reached anymore if we noticed the conflict.
"The new output looks like this, which is much better..." is missing
here.
> @@ -27,3 +29,13 @@ int git_default_advice_config(const char *var, const char *value)
>
> return 0;
> }
> +
> +void NORETURN die_resolve_conflict(const char *me)
> +{
> + if (advice_resolve_conflict)
> + die("'%s' is not possible because you have unmerged files.\n"
> + "Please, fix them up in the work tree, and then use 'git add/rm <file>'\n"
> + "as appropriate to mark resolution, or use 'git commit -a'.", me);
> + else
> + die("'%s' is not possible because you have unmerged files.", me);
> +}
Nice, but the advice contrasts between squirrels and oranges.
One advice, "use add/rm as appropriate to mark resolution" goes only as
far as making the index in order, without recording it in a commit. The
other, "commit -a", will make a commit, I suspect that "commit -a" needs
to be matched with "commit" if the user chooses to take the first advice
of resolving paths incrementally. IOW
use 'git add/rm <file>' as appropriate to mark resolution and make a
commit, or use 'commit -a', before running me again.
might be more appropriate.
> diff --git a/builtin-commit.c b/builtin-commit.c
> index 3dfcd77..a4977ac 100644
> --- a/builtin-commit.c
> +++ b/builtin-commit.c
> @@ -235,6 +235,17 @@ static void create_base_index(void)
> exit(128); /* We've already reported the error, finish dying */
> }
>
> +static void refresh_cache_or_die(int refresh_flags)
> +{
> + /*
> + * refresh_flags contains REFRESH_QUIET, so the only errors
> + * are for unmerged entries.
> + */
Mixed indentation.
> + if(refresh_cache(refresh_flags | REFRESH_IN_PORCELAIN)) {
SP after "if".
What should we see upon "commit --dry-run" and what does the code after
the patch produce? Are we sure refresh_flags always lack REFRESH_UNMERGED
that allows unmerged entries and produces the unmerged error messages when
needed?
> diff --git a/builtin-merge.c b/builtin-merge.c
> index f1c84d7..abe6c03 100644
> --- a/builtin-merge.c
> +++ b/builtin-merge.c
> @@ -847,11 +847,16 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
> const char *best_strategy = NULL, *wt_strategy = NULL;
> struct commit_list **remotes = &remoteheads;
>
> - if (file_exists(git_path("MERGE_HEAD")))
> - die("You have not concluded your merge. (MERGE_HEAD exists)");
> - if (read_cache_unmerged())
> - die("You are in the middle of a conflicted merge."
> - " (index unmerged)");
> + if (read_cache_unmerged()) {
> + die_resolve_conflict("merge");
> + }
> + if (file_exists(git_path("MERGE_HEAD"))) {
> + if (advice_resolve_conflict)
> + die("You have not concluded your merge (MERGE_HEAD exists).\n"
> + "Please, commit your changes before you can merge.");
> + else
> + die("You have not concluded your merge (MERGE_HEAD exists).");
> + }
It is not a very big deal, but why are these checked in different order
after the patch? Unless the new order is justifiably better, I'd rather
see the order kept as before. Otherwise please justify it in the proposed
commit log message.
Note that the user might have already run "add -u" to mark everything
resolved, in which case MERGE_HEAD will still exist even though the index
is free of ummerged entries.
> diff --git a/builtin-revert.c b/builtin-revert.c
Nice.
> diff --git a/git-pull.sh b/git-pull.sh
> index 9e69ada..54ce0af 100755
> --- a/git-pull.sh
> +++ b/git-pull.sh
> @@ -13,8 +13,29 @@ set_reflog_action "pull $*"
> require_work_tree
> cd_to_toplevel
>
> -test -z "$(git ls-files -u)" ||
> - die "You are in the middle of a conflicted merge."
> +
> +die_conflict () {
> + git diff-index --cached --name-status -r --ignore-submodules HEAD --
> + if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
> + die "Pull is not possible because you have unmerged files.
> +Please, fix them up in the work tree, and then use 'git add/rm <file>'
> +as appropriate to mark resolution, or use 'git commit -a'."
> + else
> + die "Pull is not possible because you have unmerged files."
> + fi
> +}
> +
> +die_merge () {
> + if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
> + die "You have not concluded your merge (MERGE_HEAD exists).
> +Please, commit your changes before you can merge."
> + else
> + die "You have not concluded your merge (MERGE_HEAD exists)."
> + fi
> +}
> +
> +test -z "$(git ls-files -u)" || die_conflict
> +test -f "$GIT_DIR/MERGE_HEAD" && die_merge
Nice. Maybe we want to handle other cases like:
$ git rebase master
... conflicted
... called away for a 30-minutes meeting
... forgot the user was in the middle of the rebase
$ git pull
and the "pull" refused to run because the earlier "rebase" hasn't been
concluded (I suspect an earlier "am" failure would be the same issue).
Thanks.
^ permalink raw reply
* Re: submodules' shortcomings, was Re: RFC: display dirty submodule working directory in git gui and gitk
From: Jens Lehmann @ 2010-01-06 21:19 UTC (permalink / raw)
To: Junio C Hamano
Cc: Nguyen Thai Ngoc Duy, Johannes Schindelin, Git Mailing List,
Shawn O. Pearce, Paul Mackerras, Heiko Voigt, Lars Hjemli,
Avery Pennarun
In-Reply-To: <7vbph7uhn9.fsf@alter.siamese.dyndns.org>
Am 06.01.2010 21:01, schrieb Junio C Hamano:
> Jens Lehmann <Jens.Lehmann@web.de> writes:
>
>> Am 06.01.2010 18:55, schrieb Junio C Hamano:
>>> I was envisioning that the "git status" in submodule will be run with its
>>> recent --porcelain option, and "git status" or "git commit" would read it
>>> to postprocess and incorporate into its own output.
>>
>> And i thought about printing just one line for each dirty submodule that
>> contains uncommitted and/or new files. I did not intend to list every
>> file, for the same reason a "git diff --submodule" only shows the first
>> line of the commit messages, not the actual differences of all changed
>> files in the submodule. I am not against being able to show all files
>> too, but i really would want to have an option to get a short output for
>> git gui and gitk.
>
> I don't think what you are saying is inconsistent with "git status/commit
> that reads from 'git status --porcelain' it runs in a submodule directory,
> postprocesses it and incorporates it into its own output." When the
> sub-status reports changes, your "postprocess" would condense it down to
> "this has a potential change that user could want to commit". How the
> dirtiness is shown is entirely up to the caller that detected that change.
>
> Let's explain it in another way.
>
> The original "diff" for a submodule entry was implemented by preparing a
>
> "Subproject commit %s\n"
>
> line for the submodule commit recorded in the preimage and postimage, and
> compare these as if they are one-line files. When the postimage was work
> tree, it looked at submodule's .git/HEAD to learn what to stuff in %s
> there.
>
> But nobody forced you to limit the check only to .git/HEAD in the
> submodule. To make the comparison richer, you could check if the
> submodule directory is dirty (and we have already discussed the potential
> definition of dirtiness earlier), and add "-dirty" in the string as well.
> With such a change, if you make some changes to a file in the work tree of
> the submodule after a clean "clone", "git diff" between the index and the
> work tree would report:
>
> -Subproject commit 37bae10e38a66e4f1ddd5350daded00b21735126
> +Subproject commit 37bae10e38a66e4f1ddd5350daded00b21735126-dirty
>
> The suggestion to read from "status --porcelain" that is run in the
> submodule directory was about how to implement the part that determines
> this "dirtiness" information, and not about how that dirtiness is
> expressed in the output. The above is an illustration that even the
> traditional output format can be made aware of this submodule dirtiness
> check. "diff --submodule" can express that dirtiness information in any
> way it wants.
I see, we seem to agree again :-)
While looking into "git status" in the last hours i became aware that
there is some infrastructure for calling "git submodule summary" (when
that is enabled via "git config status.submodulesummary"). I think this
can be extended to transfer the dirty information from "git diff
--submodule" (which can and should replace "git submodule summary" IMO)
into "git status".
Will send a patch for discussion tomorrow, i have to get some sleep now.
^ permalink raw reply
* Re: [PATCH v3 5/6] transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed
From: Tay Ray Chuan @ 2010-01-06 21:41 UTC (permalink / raw)
To: Jeff King; +Cc: git, Shawn O. Pearce, Daniel Barkalow, Junio C Hamano
In-Reply-To: <20100106120456.GA7221@coredump.intra.peff.net>
Hi,
On Wed, Jan 6, 2010 at 8:04 PM, Jeff King <peff@peff.net> wrote:
> On Tue, Jan 05, 2010 at 06:01:13PM +0800, Tay Ray Chuan wrote:
>
> > > It seems like this should be checking for REF_STATUS_NONE explicitly
> > > instead of trying to enumerate the reasons we might not have tried to
> > > push. Shouldn't helpers _only_ be pushing REF_STATUS_NONE refs?
> > >
> > > I think right now the two cases are equivalent, since non-ff and
> > > uptodate are the only two states set before the helper is invoked. But
> > > we have discussed in the past (and I still have a patch floating around
> > > for) a REF_STATUS_REWIND which would treat strict rewinds differently
> > > (silently ignoring them instead of making an error). Explicitly checking
> > > REF_STATUS_NONE future-proofs against new states being added.
> >
> > I'm not really sure if this is true (ie. that if status is not non-ff
> > or uptodate, then it is REF_STATUS_NONE), but we could step around this
>
> Well, consider it this way. If it's _not_ REF_STATUS_NONE, then what is
> it, and what does it mean to be overwriting it?
Ok, I'll take your suggestion from your previous email and do this:
@@ -429,8 +429,16 @@ static int push_refs(struct transport *transport,
continue;
}
- ref->status = status;
- ref->remote_status = msg;
+ if (ref->status == REF_STATUS_NONE) {
+ ref->status = status;
+ ref->remote_status = msg;
+ } else {
+ /*
+ * Earlier, the ref was marked not to be pushed, so ignore what
+ * the remote helper said about the ref.
+ */
+ continue;
+ }
}
strbuf_release(&buf);
return 0;
Going by this principle (only refs with status of none will be pushed),
I think I should also squash the below into patch 3 (refactor ref status
logic for pushing):
@@ -336,11 +336,10 @@ static int push_refs(struct transport *transport,
continue;
switch (ref->status) {
- case REF_STATUS_REJECT_NONFASTFORWARD:
- case REF_STATUS_UPTODATE:
- continue;
+ case REF_STATUS_NONE:
+ ; /* carry on with pushing */
default:
- ; /* do nothing */
+ continue;
}
if (force_all)
> Maybe I am misunderstanding the problem the patch is addressing, but the
> point of these REF_STATUS feels was to act as a small state machine.
> Everything starts as NONE, and then:
>
> - we compare locally against remote refs. We may transition:
> NONE -> UPTODATE
> NONE -> REJECT_NONFASTFORWARD
> NONE -> REJECT_NODELETE
>
> - we send the push list
> NONE -> EXPECTING_REPORT (if the remote supports individual status)
> NONE -> OK (otherwise)
>
> - we get back status responses
> EXPECTING_REPORT -> OK
> EXPECTING_REPORT -> REMOTE_REJECT
>
> I haven't looked closely at the new transport helper code, but I would
> think it should stick more or less to those transitions. The exception
> would be that some transports don't necessarily handle EXPECTING_REPORT
> in the same way, and may transition directly from NONE to
> OK/REMOTE_REJECT.
minor nit: yes, this may differ from transport-to-transport, but
EXPECTING_REPORT is not used at all in the top-level transport (the
level above the helper).
There's also something I'd like to point out for accuracy: it's that
this sequence of transitions occur at two levels, separately: one at
the top-level transport/transport-helper, and another at the helper.
So, for certain non-ff refs (the type this patch series is looking at),
the sequence of state transitions stops and doesn't continue to step 2
in the top-level transport (sending the push list); but separately, in
the helper, the ref goes through another sequence of state transitions.
What this patch touches is the part in the top-level transport that
syncs the ref status between the helper and the top-level transport: do
we take and present to the user what the helper has done, or not?
Regarding this point, I now think that we should ignore the
helper-reported status only if that status is none, and continue
updating the ref status in the top-level transport if the helper did
push successfully/failed, even if we didn't tell it to push:
@@ -429,7 +429,7 @@ static int push_refs(struct transport *transport,
ref->status = status;
ref->remote_status = msg;
- if (ref->status == REF_STATUS_NONE) {
+ if (ref->status == REF_STATUS_NONE && status == REF_STATUS_NONE) {
ref->status = status;
ref->remote_status = msg;
} else {
> So offhand, I would say that your list should also probably include
> REJECT_NODELETE. However, I think that status is just for old servers
> which didn't support the delete-refs protocol extension. So presumably
> that is none of the new helpers, as they all post-date the addition of
> that feature by quite a few years.
You're right, AFAIK, for the smart http protocol; I don't think it
supports NODELETE.
> > by introducing a property, say, ref->should_push, that is set to 1,
> > after all the vetting has been carried out and just before we talk to
> > the server.
>
> I'd rather not introduce new state. The point of the status flag was to
> encapsulate all of that information, and a new state variable just seems
> like introducing extra complexity. If we are not in the NONE state, I
> don't see why we would tell the helper about a ref at all.
Noted.
--
Cheers,
Ray Chuan
^ permalink raw reply
* Re: [PATCH 1/2] git-svn: ignore changeless commits when checking for a cherry-pick
From: Eric Wong @ 2010-01-06 21:43 UTC (permalink / raw)
To: Andrew Myrick; +Cc: git, sam
In-Reply-To: <1262808529-1575-1-git-send-email-amyrick@apple.com>
Andrew Myrick <amyrick@apple.com> wrote:
> diff --git a/git-svn.perl b/git-svn.perl
> index 650c9e5..8c7c034 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -3052,12 +3052,36 @@ sub check_cherry_pick {
> for my $range ( @ranges ) {
> delete @commits{_rev_list($range)};
> }
> + for my $commit (keys %commits) {
Hi Andrew,
I'll again defer to Sam for Acks on these. Test cases would be nice to
have, too.
A few notes:
The prevailing standard for indentation in git is with hard tabs and
that's certainly the case with the rest of git-svn.perl.
> +sub has_no_changes {
> + my $commit = shift;
> +
> + my @revs = split / /, command_oneline(
> + qw(rev-list --parents -1 -m), $commit);
> +
> + # Commits with no parents, e.g. the start of a partial branch,
> + # have changes by definition.
> + return 1 if (@revs < 2);
> +
I've become very picky about trailing whitespace (from Junio :), too.
"git diff --check" is helpful for this, especially in the pre-commit
hook.
Thanks!
--
Eric Wong
^ permalink raw reply
* Re: [PATCH 9/9] rerere forget path: forget recorded resolution
From: Junio C Hamano @ 2010-01-06 21:59 UTC (permalink / raw)
To: Johannes Sixt; +Cc: git
In-Reply-To: <7vr5q31871.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> However, I think you need this fix for "checkout -m" to work as intended,
Here is a cleaner reroll with tests, meant to be applied on v1.6.1-rc1 or
later.
-- >8 --
Subject: [PATCH] checkout -m path: fix recreating conflicts
We should tell ll_merge() that the 3-way merge between stages #2 and #3 is
an outermost merge, not a virtual-ancestor creation.
Back when this code was originally written, users couldn't write custom
merge drivers easily, so the bug didn't matter, but these days it does.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
builtin-checkout.c | 2 +-
t/t7201-co.sh | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 58 insertions(+), 1 deletions(-)
diff --git a/builtin-checkout.c b/builtin-checkout.c
index 7f3bd7b..e41e73b 100644
--- a/builtin-checkout.c
+++ b/builtin-checkout.c
@@ -179,7 +179,7 @@ static int checkout_merged(int pos, struct checkout *state)
fill_mm(active_cache[pos+2]->sha1, &theirs);
status = ll_merge(&result_buf, path, &ancestor,
- &ours, "ours", &theirs, "theirs", 1);
+ &ours, "ours", &theirs, "theirs", 0);
free(ancestor.ptr);
free(ours.ptr);
free(theirs.ptr);
diff --git a/t/t7201-co.sh b/t/t7201-co.sh
index 0e21632..3214ad2 100755
--- a/t/t7201-co.sh
+++ b/t/t7201-co.sh
@@ -534,4 +534,61 @@ test_expect_success 'failing checkout -b should not break working tree' '
'
+(
+ echo "#!$SHELL_PATH"
+ cat <<\EOF
+O=$1 A=$2 B=$3
+cat "$A" >.tmp
+exec >"$A"
+echo '<<<<<<< filfre-theirs'
+cat "$B"
+echo '||||||| filfre-common'
+cat "$O"
+echo '======='
+cat ".tmp"
+echo '>>>>>>> filfre-ours'
+rm -f .tmp
+exit 1
+EOF
+) >filfre.sh
+chmod +x filfre.sh
+
+test_expect_success 'custom merge driver with checkout -m' '
+ git reset --hard &&
+
+ git config merge.filfre.driver "./filfre.sh %O %A %B" &&
+ git config merge.filfre.name "Feel-free merge driver" &&
+ git config merge.filfre.recursive binary &&
+ echo "arm merge=filfre" >.gitattributes &&
+
+ git checkout -b left &&
+ echo neutral >arm &&
+ git add arm .gitattributes &&
+ test_tick &&
+ git commit -m neutral &&
+ git branch right &&
+
+ echo left >arm &&
+ test_tick &&
+ git commit -a -m left &&
+ git checkout right &&
+
+ echo right >arm &&
+ test_tick &&
+ git commit -a -m right &&
+
+ test_must_fail git merge left &&
+ (
+ for t in filfre-common left right
+ do
+ grep $t arm || exit 1
+ done
+ exit 0
+ ) &&
+
+ mv arm expect &&
+ git checkout -m arm &&
+ test_cmp expect arm
+'
+
test_done
--
1.6.6.184.ge163d
^ permalink raw reply related
* What's cooking in git.git (Jan 2010, #02 draft; Wed, 06)
From: Junio C Hamano @ 2010-01-06 22:22 UTC (permalink / raw)
To: git
I am experimenting with ideas to better manage the periodic "What's
cooking" messages, and here is one of such attempt based on the current
draft of the upcoming "2010 Jan, issue #02".
This is an incremental update (the full version will follow shortly) that
shows the changes since the previous issue, and was generated with a
custom diff driver. One of the things to notice is that the ones that
only moved across sections (e.g. bg/maint-remote-update-default) without
any other changes are shown without the list of commits.
----------------------------------------------------------------
-What's cooking in git.git (Jan 2010, #01; Mon, 04)
+What's cooking in git.git (Jan 2010, #02 draft; Wed, 06)
--------------------------------------------------
Born topics
[New Topics]
* jc/maint-1.6.1-checkout-m-custom-merge (2010-01-06) 1 commit
- checkout -m path: fix recreating conflicts
* jn/makefile (2010-01-06) 4 commits
- Makefile: consolidate .FORCE-* targets
- Makefile: learn to generate listings for targets requiring special flags
- Makefile: use target-specific variable to pass flags to cc
- Makefile: regenerate assembler listings when asked
--------------------------------------------------
Moved from [New Topics] to [Cooking]
* da/difftool (2009-12-22) 2 commits
- - git-difftool: Add '--gui' for selecting a GUI tool
- - t7800-difftool: Set a bogus tool for use by tests
+ (merged to 'next' on 2010-01-06 at e957395)
+ + git-difftool: Add '--gui' for selecting a GUI tool
+ + t7800-difftool: Set a bogus tool for use by tests
* jh/gitweb-cached (2010-01-03) 4 commits
- gitweb: Makefile improvements
- gitweb: Optionally add "git" links in project list page
- gitweb: Add option to force version match
- gitweb: Load checking
+
+Will merge to 'next', unless I hear objections within a few days.
* tc/test-locate-httpd (2010-01-02) 1 commit
- - t/lib-http.sh: Restructure finding of default httpd location
+ (merged to 'next' on 2010-01-06 at 9d913e5)
+ + t/lib-http.sh: Restructure finding of default httpd location
* jc/fix-tree-walk (2009-09-14) 7 commits
-Resurrected from "Ejected" category.
+Resurrected from "Ejected" category. This is fix for a tricky codepath
+and testing and improving before it hits 'next' by brave souls is greatly
+appreciated. I am not very happy about the solution myself.
--------------------------------------------------
Moved from [Cooking] to [Will graduate after a bit more cooking]
* bg/maint-remote-update-default (2009-12-31) 1 commit
* jk/maint-1.6.5-reset-hard (2009-12-30) 1 commit
* jk/push-to-delete (2009-12-30) 1 commit
* mm/config-path (2009-12-30) 1 commit
* pm/cvs-environ (2009-12-30) 1 commit
* so/cvsserver-update (2009-12-07) 1 commit
* tr/maint-1.6.5-bash-prompt-show-submodule-changes (2009-12-31) 1 commit
* js/filter-branch-prime (2009-12-15) 1 commit
* mg/tag-d-show (2009-12-10) 1 commit
* sb/maint-octopus (2009-12-11) 3 commits
* bg/maint-add-all-doc (2009-12-07) 4 commits
* mv/commit-date (2009-12-03) 2 commits
* mo/bin-wrappers (2009-12-02) 3 commits
* tr/http-updates (2009-12-28) 4 commits
* nd/sparse (2009-12-30) 23 commits
--------------------------------------------------
Other topics
[Cooking]
-* cc/reset-more (2010-01-04) 6 commits
+* cc/reset-more (2010-01-05) 7 commits
+ (merged to 'next' on 2010-01-06 at 96639cb)
+ + Documentation: reset: add some missing tables
(merged to 'next' on 2010-01-04 at 8802c2c)
+ Fix bit assignment for CE_CONFLICTED
(merged to 'next' on 2010-01-03 at f83d4c6)
+ "reset --merge": fix unmerged case
+ reset: use "unpack_trees()" directly instead of "git read-tree"
+ reset: add a few tests for "git reset --merge"
+ Documentation: reset: add some tables to describe the different options
+ reset: improve mixed reset error message when in a bare repo
* jc/branch-d (2009-12-29) 1 commit
- branch -d: base the "already-merged" safety on the branch it merges with
+
+http://thread.gmane.org/gmane.comp.version-control.git/135837/focus=135863
+I am tempted to merge this to 'next', but please stop me if people see issues
+in it.
* jk/run-command-use-shell (2010-01-01) 8 commits
- t4030, t4031: work around bogus MSYS bash path conversion
- - t0021: use $SHELL_PATH for the filter script
- diff: run external diff helper with shell
- textconv: use shell to run helper
- editor: use run_command's shell feature
- run-command: optimize out useless shell calls
- run-command: convert simple callsites to use_shell
+ - t0021: use $SHELL_PATH for the filter script
- run-command: add "use shell" option
- Xref: news.gmane.org gmane.comp.version-control.git:136128
- * check t0021: drop one to t4030;
- * reorder and move t0021 up, immediately after run-command: optimize
+Shuffled the commits in the topic, following J6t's suggestion in
+http://thread.gmane.org/gmane.comp.version-control.git/136128
* tc/clone-v-progress (2009-12-26) 4 commits
- clone: use --progress to force progress reporting
- clone: set transport->verbose when -v/--verbose is used
- git-clone.txt: reword description of progress behaviour
- check stderr with isatty() instead of stdout when deciding to show progress
+
+Perhaps needs an entry in the Release Notes, but otherwise looked Ok.
* tc/smart-http-restrict (2010-01-02) 4 commits
- - Smart-http tests: Test http-backend without curl or a webserver
- - Smart-http tests: Break test t5560-http-backend into pieces
- - Smart-http tests: Improve coverage in test t5560
- - Smart-http: check if repository is OK to export before serving it
+ (merged to 'next' on 2010-01-06 at 82736cb)
+ + Smart-http tests: Test http-backend without curl or a webserver
+ + Smart-http tests: Break test t5560-http-backend into pieces
+ + Smart-http tests: Improve coverage in test t5560
+ + Smart-http: check if repository is OK to export before serving it
* jc/cache-unmerge (2009-12-25) 9 commits
- rerere forget path: forget recorded resolution
- rerere: refactor rerere logic to make it independent from I/O
- rerere: remove silly 1024-byte line limit
- resolve-undo: teach "update-index --unresolve" to use resolve-undo info
- resolve-undo: "checkout -m path" uses resolve-undo information
- resolve-undo: allow plumbing to clear the information
- resolve-undo: basic tests
- resolve-undo: record resolved conflicts in a new index extension section
- builtin-merge.c: use standard active_cache macros
+
+Will wait a bit more before moving it to 'next'.
* jh/commit-status (2009-12-07) 1 commit
- [test?] Add commit.status, --status, and --no-status
+
+Needs tests.
* jc/checkout-merge-base (2009-11-20) 2 commits
(merged to 'next' on 2010-01-02 at 6a8f6fc)
+ "rebase --onto A...B" replays history on the merge base between A and B
+ "checkout A...B" switches to the merge base between A and B
+
+Users of "rebase -i" might want to teach this to the command. Volunteers?
* tr/http-push-ref-status (2009-12-24) 6 commits
- transport-helper.c::push_refs(): emit "no refs" error message
- transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed
- transport.c::transport_push(): make ref status affect return value
- refactor ref status logic for pushing
- t5541-http-push.sh: add test for unmatched, non-fast-forwarded refs
- t5541-http-push.sh: add tests for non-fast-forward pushes
+
+Peff: $gmane/136169, 136167, 136168
+RC: $gmane/136172
* il/vcs-helper (2009-12-09) 8 commits
- - Remove special casing of http, https and ftp
- - Support remote archive from all smart transports
- - Support remote helpers implementing smart transports
- - Support taking over transports
- - Refactor git transport options parsing
- - Pass unknown protocols to external protocol handlers
- - Support mandatory capabilities
- - Add remote helper debug mode
+ (merged to 'next' on 2010-01-06 at 7c79f42)
+ + Remove special casing of http, https and ftp
+ + Support remote archive from all smart transports
+ + Support remote helpers implementing smart transports
+ + Support taking over transports
+ + Refactor git transport options parsing
+ + Pass unknown protocols to external protocol handlers
+ + Support mandatory capabilities
+ + Add remote helper debug mode
* mm/diag-path-in-treeish (2009-12-07) 1 commit
- - Detailed diagnosis when parsing an object name fails.
+ (merged to 'next' on 2010-01-06 at 6b4201e)
+ + Detailed diagnosis when parsing an object name fails.
* mh/rebase-fixup (2009-12-07) 2 commits
- - Add a command "fixup" to rebase --interactive
- - t3404: Use test_commit to set up test repository
+ (merged to 'next' on 2010-01-06 at c4779a7)
+ + Add a command "fixup" to rebase --interactive
+ + t3404: Use test_commit to set up test repository
(this branch is used by ns/rebase-auto-squash.)
* ns/rebase-auto-squash (2009-12-08) 2 commits
- - fixup! rebase -i --autosquash
- - rebase -i --autosquash: auto-squash commits
+ (merged to 'next' on 2010-01-06 at 91913ca)
+ + fixup! rebase -i --autosquash
+ + rebase -i --autosquash: auto-squash commits
(this branch uses mh/rebase-fixup.)
* jh/notes (2009-12-07) 11 commits
- Refactor notes concatenation into a flexible interface for combining notes
- Notes API: Allow multiple concurrent notes trees with new struct notes_tree
- Notes API: for_each_note(): Traverse the entire notes tree with a callback
- Notes API: get_note(): Return the note annotating the given object
- Notes API: add_note(): Add note objects to the internal notes tree structure
- Notes API: init_notes(): Initialize the notes tree from the given notes ref
- Notes API: get_commit_notes() -> format_note() + remove the commit restriction
- Minor style fixes to notes.c
(merged to 'next' on 2010-01-02 at ae42130)
+ Add more testcases to test fast-import of notes
+ Rename t9301 to t9350, to make room for more fast-import tests
+ fast-import: Proper notes tree manipulation
+
+http://thread.gmane.org/gmane.comp.version-control.git/134738
+
+What's the status of the fourth and later patches on this topic? Overall
+it looked reasonable, if I recall correctly what I thought when I reviewed
+it last time, and I am tempted to merge it to 'next' soonish. Please
+file complaints before I do so if people have objections.
+
+http://mid.gmane.org/201001051231.43048.johan@herland.net Hold!
* fc/opt-quiet-gc-reset (2009-12-02) 1 commit
- - General --quiet improvements
+ (merged to 'next' on 2010-01-06 at 03e00cd)
+ + General --quiet improvements
* sr/gfi-options (2009-12-04) 7 commits
- fast-import: add (non-)relative-marks feature
- fast-import: allow for multiple --import-marks= arguments
- fast-import: test the new option command
- fast-import: add option command
- fast-import: add feature command
- fast-import: put marks reading in its own function
- fast-import: put option parsing code in separate functions
+
+http://thread.gmane.org/gmane.comp.version-control.git/134540
+
+I haven't seen comments on this round, and I am tempted to merge it to
+'next' soonish. Please file complaints before I do so if people have
+objections.
^ permalink raw reply
* What's cooking in git.git (Jan 2010, #02 draft; Wed, 06)
From: Junio C Hamano @ 2010-01-06 22:25 UTC (permalink / raw)
To: git
In-Reply-To: <7vvdfenaar.fsf@alter.siamese.dyndns.org>
This is the current draft of "2010 Jan, issue #2" that the experimental
"incremental update" I sent earlier was made out of, for comparison
purposes.
--------------------------------------------------
Here are the topics that have been cooking. Commits prefixed with '-' are
only in 'pu' while commits prefixed with '+' are in 'next'. The ones
marked with '.' do not appear in any of the integration branches, but I am
still holding onto them.
The tip of 'next' has been rebuilt on top of the current 'master'.
--------------------------------------------------
[New Topics]
* jc/maint-1.6.1-checkout-m-custom-merge (2010-01-06) 1 commit
- checkout -m path: fix recreating conflicts
* jn/makefile (2010-01-06) 4 commits
- Makefile: consolidate .FORCE-* targets
- Makefile: learn to generate listings for targets requiring special flags
- Makefile: use target-specific variable to pass flags to cc
- Makefile: regenerate assembler listings when asked
--------------------------------------------------
[Will graduate after a bit more cooking]
* mo/bin-wrappers (2009-12-02) 3 commits
(merged to 'next' on 2010-01-03 at 8c5fa27)
+ INSTALL: document a simpler way to run uninstalled builds
+ run test suite without dashed git-commands in PATH
+ build dashless "bin-wrappers" directory similar to installed bindir
* mv/commit-date (2009-12-03) 2 commits
(merged to 'next' on 2010-01-03 at 1c45fdf)
+ Document date formats accepted by parse_date()
+ builtin-commit: add --date option
* bg/maint-add-all-doc (2009-12-07) 4 commits
(merged to 'next' on 2010-01-03 at b19a323)
+ squash! rm documentation--also mention add-u where we mention commit-a
+ git-rm doc: Describe how to sync index & work tree
+ git-add/rm doc: Consistently back-quote
+ Documentation: 'git add -A' can remove files
* so/cvsserver-update (2009-12-07) 1 commit
(merged to 'next' on 2010-01-03 at 99959b6)
+ cvsserver: make the output of 'update' more compatible with cvs.
* mg/tag-d-show (2009-12-10) 1 commit
(merged to 'next' on 2010-01-03 at 87657d2)
+ tag -d: print sha1 of deleted tag
* sb/maint-octopus (2009-12-11) 3 commits
(merged to 'next' on 2010-01-03 at ffe77d6)
+ octopus: remove dead code
+ octopus: reenable fast-forward merges
+ octopus: make merge process simpler to follow
* js/filter-branch-prime (2009-12-15) 1 commit
(merged to 'next' on 2010-01-03 at 7c90319)
+ filter-branch: remove an unnecessary use of 'git read-tree'
* tr/http-updates (2009-12-28) 4 commits
(merged to 'next' on 2010-01-02 at cf25698)
+ Remove http.authAny
+ Allow curl to rewind the RPC read buffer
+ Add an option for using any HTTP authentication scheme, not only basic
+ http: maintain curl sessions
* nd/sparse (2009-12-30) 23 commits
(merged to 'next' on 2010-01-02 at 5499bbe)
+ grep: do not do external grep on skip-worktree entries
+ commit: correctly respect skip-worktree bit
+ ie_match_stat(): do not ignore skip-worktree bit with CE_MATCH_IGNORE_VALID
+ tests: rename duplicate t1009
+ sparse checkout: inhibit empty worktree
+ Add tests for sparse checkout
+ read-tree: add --no-sparse-checkout to disable sparse checkout support
+ unpack-trees(): ignore worktree check outside checkout area
+ unpack_trees(): apply $GIT_DIR/info/sparse-checkout to the final index
+ unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-checkout
+ unpack-trees.c: generalize verify_* functions
+ unpack-trees(): add CE_WT_REMOVE to remove on worktree alone
+ Introduce "sparse checkout"
+ dir.c: export excluded_1() and add_excludes_from_file_1()
+ excluded_1(): support exclude files in index
+ unpack-trees(): carry skip-worktree bit over in merged_entry()
+ Read .gitignore from index if it is skip-worktree
+ Avoid writing to buffer in add_excludes_from_file_1()
+ Teach Git to respect skip-worktree bit (writing part)
+ Teach Git to respect skip-worktree bit (reading part)
+ Introduce "skip-worktree" bit in index, teach Git to get/set this bit
+ Add test-index-version
+ update-index: refactor mark_valid() in preparation for new options
* jk/maint-1.6.5-reset-hard (2009-12-30) 1 commit
(merged to 'next' on 2010-01-02 at 190d63b)
+ reset: unbreak hard resets with GIT_WORK_TREE
* jk/push-to-delete (2009-12-30) 1 commit
(merged to 'next' on 2010-01-03 at 9ee293b)
+ builtin-push: add --delete as syntactic sugar for :foo
* mm/config-path (2009-12-30) 1 commit
(merged to 'next' on 2010-01-03 at 9c0e81a)
+ builtin-config: add --path option doing ~ and ~user expansion.
* pm/cvs-environ (2009-12-30) 1 commit
(merged to 'next' on 2010-01-03 at 4c22932)
+ CVS Server: Support reading base and roots from environment
* tr/maint-1.6.5-bash-prompt-show-submodule-changes (2009-12-31) 1 commit
(merged to 'next' on 2010-01-03 at b785974)
+ bash completion: factor submodules into dirty state
* bg/maint-remote-update-default (2009-12-31) 1 commit
(merged to 'next' on 2010-01-03 at 113009e)
+ Fix "git remote update" with remotes.defalt set
--------------------------------------------------
[Cooking]
* da/difftool (2009-12-22) 2 commits
(merged to 'next' on 2010-01-06 at e957395)
+ git-difftool: Add '--gui' for selecting a GUI tool
+ t7800-difftool: Set a bogus tool for use by tests
* jh/gitweb-cached (2010-01-03) 4 commits
- gitweb: Makefile improvements
- gitweb: Optionally add "git" links in project list page
- gitweb: Add option to force version match
- gitweb: Load checking
Will merge to 'next', unless I hear objections within a few days.
* tc/test-locate-httpd (2010-01-02) 1 commit
(merged to 'next' on 2010-01-06 at 9d913e5)
+ t/lib-http.sh: Restructure finding of default httpd location
* jc/fix-tree-walk (2009-09-14) 7 commits
- read-tree --debug-unpack
- unpack-trees.c: look ahead in the index
- unpack-trees.c: prepare for looking ahead in the index
- Aggressive three-way merge: fix D/F case
- traverse_trees(): handle D/F conflict case sanely
- more D/F conflict tests
- tests: move convenience regexp to match object names to test-lib.sh
Resurrected from "Ejected" category. This is fix for a tricky codepath
and testing and improving before it hits 'next' by brave souls is greatly
appreciated. I am not very happy about the solution myself.
* cc/reset-more (2010-01-05) 7 commits
(merged to 'next' on 2010-01-06 at 96639cb)
+ Documentation: reset: add some missing tables
(merged to 'next' on 2010-01-04 at 8802c2c)
+ Fix bit assignment for CE_CONFLICTED
(merged to 'next' on 2010-01-03 at f83d4c6)
+ "reset --merge": fix unmerged case
+ reset: use "unpack_trees()" directly instead of "git read-tree"
+ reset: add a few tests for "git reset --merge"
+ Documentation: reset: add some tables to describe the different options
+ reset: improve mixed reset error message when in a bare repo
* jc/branch-d (2009-12-29) 1 commit
- branch -d: base the "already-merged" safety on the branch it merges with
http://thread.gmane.org/gmane.comp.version-control.git/135837/focus=135863
I am tempted to merge this to 'next', but please stop me if people see issues
in it.
* jc/rerere (2009-12-04) 1 commit
- Teach --[no-]rerere-autoupdate option to merge, revert and friends
* jk/run-command-use-shell (2010-01-01) 8 commits
- t4030, t4031: work around bogus MSYS bash path conversion
- diff: run external diff helper with shell
- textconv: use shell to run helper
- editor: use run_command's shell feature
- run-command: optimize out useless shell calls
- run-command: convert simple callsites to use_shell
- t0021: use $SHELL_PATH for the filter script
- run-command: add "use shell" option
Shuffled the commits in the topic, following J6t's suggestion in
http://thread.gmane.org/gmane.comp.version-control.git/136128
* rs/maint-archive-match-pathspec (2009-12-12) 1 commit
(merged to 'next' on 2010-01-03 at 92d7d15)
+ archive: complain about path specs that don't match anything
* tc/clone-v-progress (2009-12-26) 4 commits
- clone: use --progress to force progress reporting
- clone: set transport->verbose when -v/--verbose is used
- git-clone.txt: reword description of progress behaviour
- check stderr with isatty() instead of stdout when deciding to show progress
Perhaps needs an entry in the Release Notes, but otherwise looked Ok.
* tc/smart-http-restrict (2010-01-02) 4 commits
(merged to 'next' on 2010-01-06 at 82736cb)
+ Smart-http tests: Test http-backend without curl or a webserver
+ Smart-http tests: Break test t5560-http-backend into pieces
+ Smart-http tests: Improve coverage in test t5560
+ Smart-http: check if repository is OK to export before serving it
* jc/cache-unmerge (2009-12-25) 9 commits
- rerere forget path: forget recorded resolution
- rerere: refactor rerere logic to make it independent from I/O
- rerere: remove silly 1024-byte line limit
- resolve-undo: teach "update-index --unresolve" to use resolve-undo info
- resolve-undo: "checkout -m path" uses resolve-undo information
- resolve-undo: allow plumbing to clear the information
- resolve-undo: basic tests
- resolve-undo: record resolved conflicts in a new index extension section
- builtin-merge.c: use standard active_cache macros
Will wait a bit more before moving it to 'next'.
* jh/commit-status (2009-12-07) 1 commit
- [test?] Add commit.status, --status, and --no-status
Needs tests.
* jc/checkout-merge-base (2009-11-20) 2 commits
(merged to 'next' on 2010-01-02 at 6a8f6fc)
+ "rebase --onto A...B" replays history on the merge base between A and B
+ "checkout A...B" switches to the merge base between A and B
Users of "rebase -i" might want to teach this to the command. Volunteers?
* tr/http-push-ref-status (2009-12-24) 6 commits
- transport-helper.c::push_refs(): emit "no refs" error message
- transport-helper.c::push_refs(): ignore helper-reported status if ref is not to be pushed
- transport.c::transport_push(): make ref status affect return value
- refactor ref status logic for pushing
- t5541-http-push.sh: add test for unmatched, non-fast-forwarded refs
- t5541-http-push.sh: add tests for non-fast-forward pushes
Peff: $gmane/136169, 136167, 136168
RC: $gmane/136172
* il/vcs-helper (2009-12-09) 8 commits
(merged to 'next' on 2010-01-06 at 7c79f42)
+ Remove special casing of http, https and ftp
+ Support remote archive from all smart transports
+ Support remote helpers implementing smart transports
+ Support taking over transports
+ Refactor git transport options parsing
+ Pass unknown protocols to external protocol handlers
+ Support mandatory capabilities
+ Add remote helper debug mode
* mm/diag-path-in-treeish (2009-12-07) 1 commit
(merged to 'next' on 2010-01-06 at 6b4201e)
+ Detailed diagnosis when parsing an object name fails.
* mh/rebase-fixup (2009-12-07) 2 commits
(merged to 'next' on 2010-01-06 at c4779a7)
+ Add a command "fixup" to rebase --interactive
+ t3404: Use test_commit to set up test repository
(this branch is used by ns/rebase-auto-squash.)
Initial round of "fixup" action that is similar to "squash" action in
"rebase -i" that excludes the commit log message from follow-up commits
when composing the log message for the updated one. Expected is a further
improvement to skip opening the editor if a pick is followed only by
"fixup" and no "squash".
* ns/rebase-auto-squash (2009-12-08) 2 commits
(merged to 'next' on 2010-01-06 at 91913ca)
+ fixup! rebase -i --autosquash
+ rebase -i --autosquash: auto-squash commits
(this branch uses mh/rebase-fixup.)
* jh/notes (2009-12-07) 11 commits
- Refactor notes concatenation into a flexible interface for combining notes
- Notes API: Allow multiple concurrent notes trees with new struct notes_tree
- Notes API: for_each_note(): Traverse the entire notes tree with a callback
- Notes API: get_note(): Return the note annotating the given object
- Notes API: add_note(): Add note objects to the internal notes tree structure
- Notes API: init_notes(): Initialize the notes tree from the given notes ref
- Notes API: get_commit_notes() -> format_note() + remove the commit restriction
- Minor style fixes to notes.c
(merged to 'next' on 2010-01-02 at ae42130)
+ Add more testcases to test fast-import of notes
+ Rename t9301 to t9350, to make room for more fast-import tests
+ fast-import: Proper notes tree manipulation
http://thread.gmane.org/gmane.comp.version-control.git/134738
What's the status of the fourth and later patches on this topic? Overall
it looked reasonable, if I recall correctly what I thought when I reviewed
it last time, and I am tempted to merge it to 'next' soonish. Please
file complaints before I do so if people have objections.
http://mid.gmane.org/201001051231.43048.johan@herland.net Hold!
* fc/opt-quiet-gc-reset (2009-12-02) 1 commit
(merged to 'next' on 2010-01-06 at 03e00cd)
+ General --quiet improvements
* sr/gfi-options (2009-12-04) 7 commits
- fast-import: add (non-)relative-marks feature
- fast-import: allow for multiple --import-marks= arguments
- fast-import: test the new option command
- fast-import: add option command
- fast-import: add feature command
- fast-import: put marks reading in its own function
- fast-import: put option parsing code in separate functions
http://thread.gmane.org/gmane.comp.version-control.git/134540
I haven't seen comments on this round, and I am tempted to merge it to
'next' soonish. Please file complaints before I do so if people have
objections.
* ap/merge-backend-opts (2008-07-18) 6 commits
- Document that merge strategies can now take their own options
- Extend merge-subtree tests to test -Xsubtree=dir.
- Make "subtree" part more orthogonal to the rest of merge-recursive.
- Teach git-pull to pass -X<option> to git-merge
- git merge -X<option>
- git-merge-file --ours, --theirs
"git pull" patch needs sq-then-eval fix to protect it from $IFS
but otherwise seemed good.
^ permalink raw reply
* Re: gc.auto bug in 1.6.5.7
From: Jon Nelson @ 2010-01-06 22:27 UTC (permalink / raw)
Cc: git
In-Reply-To: <u1EMnFha7hfr0SI0p8dEvAJML7vykSCAA6YzQd7klvze6oKChlMCLg@cipher.nrlssc.navy.mil>
On Wed, Jan 6, 2010 at 12:31 PM, Brandon Casey
<brandon.casey.ctr@nrlssc.navy.mil> wrote:
> Jon Nelson wrote:
>> It would appear that there is a bug in git, at least as of 1.6.5.7, in
>> the gc command.
>> When gc.auto is non-zero, it appears to consider packfiles as "loose"
>> - this conflicts with pack.packSizeLimit, insofar as I have
>> pack.packSizeLimit set to 2M (which appears to work). If gc.auto is,
>> say, 50 - once I exceed 50 2MB packs then gc --auto repacks *every
>> single time* it is run. This is unexpected, at least.
>
> There is also a gc.autopacklimit which controls auto-gc'ing based on
> the number of packs. The default is 50 and it does not consider the
> pack.packSizeLimit setting when deciding whether or not to auto-gc.
> It can be raised, or it can be disabled by setting it to zero.
I disabled it entirely and that seemed to resolve the issue. Thanks!
--
Jon
^ permalink raw reply
* Re: [PATCHv3 0/4 (resent)] Miscelanous gitweb improvements from J.H.
From: J.H. @ 2010-01-06 22:28 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <1262534850-24572-1-git-send-email-jnareb@gmail.com>
Just a heads up I've been on vacation for two weeks and hadn't gotten
around to dealing with these e-mails. I'm going to get them imported
into my tree here and take a look over them.
- John 'Warthog9' Hawley
On 01/03/2010 08:07 AM, Jakub Narebski wrote:
> This is resend of early part of "[PATCH 0/6] Gitweb caching changes v2"
> thread by John 'Warthog9' Hawley (J.H.),
> Message-ID: <1260488743-25855-1-git-send-email-warthog9@kernel.org>
> http://thread.gmane.org/gmane.comp.version-control.git/135052
>
> or alternatively
> git://git.kernel.org/pub/scm/git/warthog9/gitweb.git gitweb-ml-v2
>
> with a few modifications of my own. Those patches were send originally as
> responses in the mentioned thread, for further comments from original
> author. As the discussion didn't pick up (because of kernel.org upgrade, and
> perhaps due to end-of-year stuff), I am resending those patches in a
> separate thread for a better visibility; only comments are changed.
>
> This series of patches is rebased on top of commit 37bae10
> (Merge branch 'maint', 2009-12-31) in 'master' branch.
>
>
> Change that apply to all patches in series:
> * moving from "GITWEB - " to "gitweb: " as subsystem prefix
> * changing author to John 'Warthog9' Hawley <warthog9@kernel.org>
> (it was John 'Warthog9' Hawley <warthog9@eaglescrag.net>)
> * add signoff or change it to John 'Warthog9' Hawley <warthog9@kernel.org>,
> and of course add my own signoff.
>
>
> I have included reply to neither "GITWEB - File based caching layer"
> nor "GITWEB - Separate defaults from main file" in this thread/series.
>
> I haven't included the main point of the whole series, namely adding
> response caching layer in the form that is used in git.kernel.org, because
> I think this patch should be split into smaller parts, and unit-tested.
> As it is now it is a bit of mess. I have done patch which makes gitweb
> always use explicit filehandle when printing (simplifying a bit it
> replaces 'print <something>' by 'print {$out} <something>', with $out set
> to \*STDOUT), as a patch that prepares for (optional) gitweb caching, while
> not affecting throughput, latency and memory consumption when caching is
> disabled, as opposed to original solution by J.H. of always storing whole
> response in scalar and writing it at the end.
>
> I haven't included splitting of gitweb_defaults.perl off gitweb.perl, as it
> was after large and invasive gitweb caching patch, it would require
> substantial changes to gitweb tests upfront (by testing built gitweb.cgi and
> not source gitweb.perl), and needs fixing of Makefile to actually work
> reliably (we could have to process both gitweb.perl and
> gitweb_defaults.perl, while provided Makefile process only the file which
> triggered the rule... I think).
>
>
> I am not sure if 'gitweb: Add option to force version match' is a good
> solution to the problem it tires to address, i.e. if it is worth having,
> and I am not sure if I did 'gitweb: Makefile improvements' correctly.
>
> John 'Warthog9' Hawley (4):
> gitweb: Load checking
> gitweb: Add option to force version match
> gitweb: Optionally add "git" links in project list page
> gitweb: Makefile improvements
>
> Makefile | 65 +++++---------------------
> gitweb/Makefile | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> gitweb/README | 14 +++++-
> gitweb/gitweb.perl | 80 ++++++++++++++++++++++++++++++--
> 4 files changed, 230 insertions(+), 58 deletions(-)
> create mode 100644 gitweb/Makefile
>
> John, any comments?
>
^ permalink raw reply
* Re: [spf:guess] Re: [PATCH 1/2] git-svn: ignore changeless commits when checking for a cherry-pick
From: Sam Vilain @ 2010-01-06 22:38 UTC (permalink / raw)
To: Eric Wong; +Cc: Andrew Myrick, git
In-Reply-To: <20100106214338.GA5115@dcvr.yhbt.net>
Eric Wong wrote:
> Andrew Myrick <amyrick@apple.com> wrote:
>
>> diff --git a/git-svn.perl b/git-svn.perl
>> index 650c9e5..8c7c034 100755
>> --- a/git-svn.perl
>> +++ b/git-svn.perl
>> @@ -3052,12 +3052,36 @@ sub check_cherry_pick {
>> for my $range ( @ranges ) {
>> delete @commits{_rev_list($range)};
>> }
>> + for my $commit (keys %commits) {
>>
>
> Hi Andrew,
>
> I'll again defer to Sam for Acks on these. Test cases would be nice to
> have, too.
>
They look fine to me, agreed a test case would be nice and make sure the
features aren't lost later inadvertently.
Thanks Andrew,
Sam
^ permalink raw reply
* Re: [PATCH 1/2] git-svn: ignore changeless commits when checking for a cherry-pick
From: Andrew Myrick @ 2010-01-06 22:52 UTC (permalink / raw)
To: Eric Wong; +Cc: git, sam
In-Reply-To: <20100106214338.GA5115@dcvr.yhbt.net>
On Jan 6, 2010, at 1:43 PM, Eric Wong wrote:
> Andrew Myrick <amyrick@apple.com> wrote:
>> diff --git a/git-svn.perl b/git-svn.perl
>> index 650c9e5..8c7c034 100755
>> --- a/git-svn.perl
>> +++ b/git-svn.perl
>> @@ -3052,12 +3052,36 @@ sub check_cherry_pick {
>> for my $range ( @ranges ) {
>> delete @commits{_rev_list($range)};
>> }
>> + for my $commit (keys %commits) {
>
> Hi Andrew,
>
> I'll again defer to Sam for Acks on these. Test cases would be nice to
> have, too.
I'll see what I can do. The test cases are conceptually simple (the svn dump I sent out the other day will exercise one of these patches), but it will take me some time to learn git's testing infrastructure, and I have impending deadlines on other work, so I can't promise anything immediate.
>
> A few notes:
>
> The prevailing standard for indentation in git is with hard tabs and
> that's certainly the case with the rest of git-svn.perl.
>
>> +sub has_no_changes {
>> + my $commit = shift;
>> +
>> + my @revs = split / /, command_oneline(
>> + qw(rev-list --parents -1 -m), $commit);
>> +
>> + # Commits with no parents, e.g. the start of a partial branch,
>> + # have changes by definition.
>> + return 1 if (@revs < 2);
>> +
>
> I've become very picky about trailing whitespace (from Junio :), too.
> "git diff --check" is helpful for this, especially in the pre-commit
> hook.
My apologies for not noticing this. I'll regenerate patches that conform to the style guidelines. Thanks for pointing out `git diff --check`; it's quite helpful.
-Andrew
^ permalink raw reply
* Re: [PATCHv3 0/4 (resent)] Miscelanous gitweb improvements from J.H.
From: Jakub Narebski @ 2010-01-06 23:22 UTC (permalink / raw)
To: J.H.; +Cc: git
In-Reply-To: <4B450EA2.5020104@kernel.org>
On Wed, 6 Jan 2010, J.H. wrote:
> Just a heads up I've been on vacation for two weeks and hadn't gotten
> around to dealing with these e-mails. I'm going to get them imported
> into my tree here and take a look over them.
They are also available from 'gitweb/cache-kernel' branch of my
git/jnareb-git.git repository at repo.or.cz... and are available from
'pu' branch in main git repository, as fbd43a8^2 (Merge branch
'jh/gitweb-cached' into pu, 2010-01-04).
It might be easier to import (fetch) them from that repository, and just
drop top two commits / merge jnareb-git/gitweb/cache-kernel~2
git://repo.or.cz/git/jnareb-git.git gitweb/cache-kernel
John 'Warthog9' Hawley (4):
gitweb: Load checking
gitweb: Add option to force version match
gitweb: Optionally add "git" links in project list page
gitweb: Makefile improvements
Jakub Narebski (2):
gitweb: Print to explicit filehandle (preparing for caching)
gitweb: href(..., -path_info => 0|1)
The two top commits on that branch are work in progress in preparation
for response caching for gitweb from J.H. (the one used on
git.kernel.org), and are not ready yet, I think; at least there would
be one more commit in "preparing for gitweb caching" (sub)series.
--
Jakub Narebski
Poland
^ permalink raw reply
* [PATCH 1/2] git-svn: ignore changeless commits when checking for a cherry-pick
From: Andrew Myrick @ 2010-01-07 0:25 UTC (permalink / raw)
To: git; +Cc: sam, normalperson, Andrew Myrick
In-Reply-To: <E10FB265-0C47-44C7-9347-687A9F447603@apple.com>
Update git-svn to ignore commits that do not change the tree when it is
deciding if an svn merge ticket represents a real branch merge or just a
cherry-pick.
Consider the following integration model in the svn repository:
F---G branch1
/ \
D tag1 \ E tag2
/ \ /
A---B C trunk
branch1 is merged to trunk in commit C.
With this patch, git-svn will correctly identify branch1 as a proper merge
parent, instead of incorrectly ignoring it as a cherry-pick.
Signed-off-by: Andrew Myrick <amyrick@apple.com>
---
git-svn.perl | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 650c9e5..947184a 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3052,12 +3052,36 @@ sub check_cherry_pick {
for my $range ( @ranges ) {
delete @commits{_rev_list($range)};
}
+ for my $commit (keys %commits) {
+ if (has_no_changes($commit)) {
+ delete $commits{$commit};
+ }
+ }
return (keys %commits);
}
+sub has_no_changes {
+ my $commit = shift;
+
+ my @revs = split / /, command_oneline(
+ qw(rev-list --parents -1 -m), $commit);
+
+ # Commits with no parents, e.g. the start of a partial branch,
+ # have changes by definition.
+ return 1 if (@revs < 2);
+
+ # Commits with multiple parents, e.g a merge, have no changes
+ # by definition.
+ return 0 if (@revs > 2);
+
+ return (command_oneline("rev-parse", "$commit^{tree}") eq
+ command_oneline("rev-parse", "$commit~1^{tree}"));
+}
+
BEGIN {
memoize 'lookup_svn_merge';
memoize 'check_cherry_pick';
+ memoize 'has_no_changes';
}
sub parents_exclude {
--
1.6.6.2.g18c9a
^ permalink raw reply related
* [PATCH 2/2] git-svn: handle merge-base failures
From: Andrew Myrick @ 2010-01-07 0:25 UTC (permalink / raw)
To: git; +Cc: sam, normalperson, Andrew Myrick
In-Reply-To: <1262823922-3415-1-git-send-email-amyrick@apple.com>
Change git-svn to warn and continue when merge-base fails while processing svn
merge tickets.
merge-base can fail when a partial branch is created and merged back to trunk
in svn, because it cannot find a common ancestor between the partial branch and
trunk.
Signed-off-by: Andrew Myrick <amyrick@apple.com>
---
git-svn.perl | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 947184a..1f201e4 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3158,10 +3158,21 @@ sub find_extra_svn_parents {
my $ranges = $ranges{$merge_tip};
# check out 'new' tips
- my $merge_base = command_oneline(
- "merge-base",
- @$parents, $merge_tip,
- );
+ my $merge_base;
+ eval {
+ $merge_base = command_oneline(
+ "merge-base",
+ @$parents, $merge_tip,
+ );
+ };
+ if ($@) {
+ die "An error occurred during merge-base"
+ unless $@->isa("Git::Error::Command");
+
+ warn "W: Cannot find common ancestor between ".
+ "@$parents and $merge_tip. Ignoring merge info.\n";
+ next;
+ }
# double check that there are no missing non-merge commits
my (@incomplete) = check_cherry_pick(
--
1.6.6.2.g18c9a
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox