From: Stephan Beyer <s-beyer@gmx.net>
To: Miklos Vajna <vmiklos@frugalware.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] Split out merge_recursive() to merge-recursive.c
Date: Tue, 12 Aug 2008 19:56:29 +0200 [thread overview]
Message-ID: <20080812175629.GA28014@leksak.fem-net> (raw)
In-Reply-To: <1218559514-16890-1-git-send-email-vmiklos@frugalware.org>
Hi,
Miklos Vajna wrote:
> Move most of the of code from builtin-merge-recursive.c to a new file
> merge-recursive.c and introduce merge_recursive_setup() in there so that
> builtin-merge-recursive and other builtins call it.
So, according to that change my "revert" patch is the same plus this
interdiff:
--8<--
diff --git a/builtin-revert.c b/builtin-revert.c
index dcee181..941b875 100644
--- a/builtin-revert.c
+++ b/builtin-revert.c
@@ -281,7 +281,8 @@ static int revert_or_cherry_pick(int argc, const char **argv)
const char *message, *encoding;
const char *defmsg = xstrdup(git_path("MERGE_MSG"));
- git_config(git_default_config, NULL);
+ git_config(merge_recursive_config, NULL);
+ merge_recursive_setup(0);
me = action == REVERT ? "revert" : "cherry-pick";
setenv(GIT_REFLOG_ACTION, me, 0);
parse_args(argc, argv);
-->8--
I'm fine with that, but my hope(?) was that we could have some more
generic function that takes SHAs ("unsigned char *") instead of commits.
I don't know if this is bad for builtin-merge, but from the "revert" and
"sequencer" point of view this is all I need.
Hmm, I think it takes less time to implement it based on your patch than
explaining :-)
One further comment:
> -static int merge_config(const char *var, const char *value, void *cb)
> +int merge_recursive_config(const char *var, const char *value, void *cb)
> {
> if (!strcasecmp(var, "merge.verbosity")) {
> - verbosity = git_config_int(var, value);
> + merge_recursive_verbosity = git_config_int(var, value);
[...]
> diff --git a/merge-recursive.h b/merge-recursive.h
> index f37630a..73e4413 100644
> --- a/merge-recursive.h
> +++ b/merge-recursive.h
> @@ -14,7 +14,11 @@ int merge_trees(struct tree *head,
> const char *branch1,
> const char *branch2,
> struct tree **result);
> -
> +struct commit *make_virtual_commit(struct tree *tree, const char *comment);
> +int merge_recursive_config(const char *var, const char *value, void *cb);
> +void merge_recursive_setup(int is_subtree_merge);
> struct tree *write_tree_from_memory(void);
>
> +extern int merge_recursive_verbosity;
Why this?
So we have:
1. "merge.verbosity" config value
2. GIT_MERGE_VERBOSITY environment
3. merge_recursive_verbosity variable
I wonder if 3 is really necessary.
Kind regards,
Stephan
--
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
next prev parent reply other threads:[~2008-08-12 17:57 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-10 13:20 [PATCH 0/2] Avoid run_command() for recursive in builtin-merge Miklos Vajna
2008-08-10 13:20 ` [PATCH 1/2] merge-recursive: prepare merge_recursive() to be called from builtins Miklos Vajna
2008-08-10 13:20 ` [PATCH 2/2] builtin-merge: avoid run_command_v_opt() for recursive Miklos Vajna
2008-08-11 18:47 ` Junio C Hamano
2008-08-11 19:07 ` Miklos Vajna
2008-08-11 20:03 ` Junio C Hamano
2008-08-11 20:45 ` Miklos Vajna
2008-08-11 20:48 ` [PATCH] Add a new test to ensure merging a submodule is handled properly Miklos Vajna
2008-08-11 15:13 ` [PATCH 1/2] merge-recursive: prepare merge_recursive() to be called from builtins Stephan Beyer
2008-08-11 16:46 ` Miklos Vajna
2008-08-11 19:53 ` Junio C Hamano
2008-08-11 20:46 ` Stephan Beyer
2008-08-11 15:03 ` [PATCH] builtin-revert.c: Make use of merge_recursive() Stephan Beyer
2008-08-11 15:47 ` Johannes Schindelin
2008-08-11 19:01 ` Stephan Beyer
2008-08-11 19:09 ` Miklos Vajna
2008-08-11 21:44 ` [PATCH] builtin-revert: " Stephan Beyer
2008-08-11 21:46 ` Stephan Beyer
2008-08-11 22:33 ` Junio C Hamano
2008-08-11 23:27 ` Junio C Hamano
2008-08-11 23:47 ` Stephan Beyer
2008-08-11 23:52 ` Junio C Hamano
2008-08-12 16:45 ` [PATCH] Split out merge_recursive() to merge-recursive.c Miklos Vajna
2008-08-12 17:56 ` Stephan Beyer [this message]
2008-08-12 21:40 ` Miklos Vajna
2008-08-12 20:13 ` [PATCH (1b)] merge-recursive.c: Add more generic merge_recursive_generic() Stephan Beyer
2008-08-12 20:14 ` [PATCH (2)] Make builtin-revert.c use merge_recursive_generic() Stephan Beyer
2008-08-12 21:44 ` [PATCH (1b)] merge-recursive.c: Add more generic merge_recursive_generic() Miklos Vajna
2008-08-13 17:26 ` Stephan Beyer
2008-08-13 20:13 ` Miklos Vajna
2008-08-13 3:17 ` Daniel Barkalow
2008-08-13 17:29 ` Stephan Beyer
2008-08-13 17:54 ` Daniel Barkalow
2008-08-13 19:55 ` Junio C Hamano
2008-08-13 20:05 ` Stephan Beyer
2008-08-13 20:36 ` Daniel Barkalow
2008-08-13 21:45 ` Junio C Hamano
2008-08-14 3:17 ` [PATCH] Split out merge_recursive() to merge-recursive.c Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080812175629.GA28014@leksak.fem-net \
--to=s-beyer@gmx.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=vmiklos@frugalware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).