* Re: [PATCH] Per branch properties for pull and fetch
From: Santi @ 2006-07-27 13:10 UTC (permalink / raw)
To: Martin Waitz; +Cc: Git Mailing List
In-Reply-To: <20060727120220.GD27593@admingilde.org>
> The current default is to always use the remote's master branch, right?
No.
For .git/remotes/ remotes it defaults to the first Pull line.
For .git/branches/ remotes if defaults to master, but you can specify
another branch.
Santi
^ permalink raw reply
* Re: Licensing and the library version of git
From: Petr Baudis @ 2006-07-27 13:11 UTC (permalink / raw)
To: Jon Smirl; +Cc: Johannes Schindelin, git
In-Reply-To: <9e4733910607270554p5622ee20ida8c264cf3122500@mail.gmail.com>
Dear diary, on Thu, Jul 27, 2006 at 02:54:54PM CEST, I got a letter
where Jon Smirl <jonsmirl@gmail.com> said that...
> In general libraries should be licensed LGPL to avoid the license
> incompatibility problem. A GPL library forces the main app to be GPL
> too.
But really another main app here (Git) is ending up in the library.
You can still always use the "Git ABI" - the commands. Or you could try
having a GPL'd "Git/Eclipse toolkit" which would reduce the barrier to
only single exec per Git invocation or something, but it would be
probably somewhat tricky on the derived works playground.
> You may like trying to force GPL onto the app but many apps are
> stuck with the license they have and can't be changed since there is
> no way to contact the original developers.
At this point, git-shortlog lists exactly 200 people (at least entries
like Unknown or No name are all linux@horizon.com ;-).
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam
^ permalink raw reply
* testing for cloned repository
From: Robert White @ 2006-07-27 13:46 UTC (permalink / raw)
To: git
I am using:
if [ -f ".git/remotes/origin" ]; then
# this repository is a clone
fi
in a bash script to test if a repository was cloned and then do
appropriate pulls and pushes which fit my situation.
Is this the proper way to test this or should I be using something
different?
Thanks in advance for your help and for providing git. I have been
using it on my Linux and MacOSX machines without any problems.
Bob White
^ permalink raw reply
* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
From: Johannes Schindelin @ 2006-07-27 14:00 UTC (permalink / raw)
To: Randal L. Schwartz; +Cc: Jakub Narebski, git
In-Reply-To: <86ejw7b4em.fsf@blue.stonehenge.com>
Hi,
On Thu, 27 Jul 2006, Randal L. Schwartz wrote:
> >>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> Johannes> Think ActiveState.
>
> Think ActiveState for the last time and see Strawberry Perl instead.
> <http://vanillaperl.com/>.
Wishful thinking. If it wasn't for political reasons, certain people would
use cygwin's perl already, instead of ActiveState.
Ciao,
Dscho
^ permalink raw reply
* [PATCH] mailinfo: accept >From in message header
From: Michael S. Tsirkin @ 2006-07-27 14:03 UTC (permalink / raw)
To: git
Hi!
Mail I get sometimes has multiple From lines, like this:
>From Majordomo@vger.kernel.org Thu Jul 27 16:39:36 2006
>From mtsirkin Thu Jul 27 16:39:36 2006
Received: from yok.mtl.com [10.0.8.11]
....
which confuses git-mailinfo since that does not recognize >From
as a valid header line. The following patch makes git-applymbox
work for me:
---
Recognize >From XXX as a valid header line.
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
diff --git a/builtin-mailinfo.c b/builtin-mailinfo.c
index ac53f76..2b6e9fa 100644
--- a/builtin-mailinfo.c
+++ b/builtin-mailinfo.c
@@ -446,7 +446,7 @@ static int read_one_header_line(char *li
break;
}
/* Count mbox From headers as headers */
- if (!ofs && !memcmp(line, "From ", 5))
+ if (!ofs && (!memcmp(line, "From ", 5) || !memcmp(line, ">From ", 6)))
ofs = 1;
return ofs;
}
--
MST
^ permalink raw reply related
* Re: Licensing and the library version of git
From: Johannes Schindelin @ 2006-07-27 14:04 UTC (permalink / raw)
To: Jon Smirl; +Cc: Petr Baudis, git
In-Reply-To: <9e4733910607270554p5622ee20ida8c264cf3122500@mail.gmail.com>
Hi,
On Thu, 27 Jul 2006, Jon Smirl wrote:
> On 7/27/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > Hi,
> >
> > On Thu, 27 Jul 2006, Petr Baudis wrote:
> >
> > > And I didn't even get to discussing whether LGPL is actually desirable
> > > for Git.
> >
> > ... or whether it is neccessary for an Eclipse-plugin to something else
> > than GPL.
>
> Eclipse is not licensed GPL.
We are talking about Eclipse _plugins_ here. Often (especially when the
deciding people have $$ in their eyes), plugins have less restrictions
(for example, WSAD would not be possible if _all_ extensions to Eclipse
would have to be CPL).
Ciao,
Dscho
^ permalink raw reply
* Re: testing for cloned repository
From: Johannes Schindelin @ 2006-07-27 14:10 UTC (permalink / raw)
To: Robert White; +Cc: git
In-Reply-To: <0AC9E5E7-52CC-4715-BB26-622A2177308B@mac.com>
Hi,
On Thu, 27 Jul 2006, Robert White wrote:
> if [ -f ".git/remotes/origin" ]; then
> # this repository is a clone
> fi
> in a bash script to test if a repository was cloned and then do appropriate
> pulls and pushes which fit my situation.
I think it would be better to do this:
-- snip --
. git-parse-remote
test "$(get_remote_url origin)" != origin && echo "is cloned"
-- snap --
There are 3 different ways to store remote information ATM, and this
method gets them all (even if, at a certain distant time in the future,
the default should be changed).
Hth,
Dscho
^ permalink raw reply
* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
From: Randal L. Schwartz @ 2006-07-27 14:22 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Jakub Narebski, git
In-Reply-To: <Pine.LNX.4.63.0607271559161.29667@wbgn013.biozentrum.uni-wuerzburg.de>
>>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Johannes> Wishful thinking. If it wasn't for political reasons, certain people would
Johannes> use cygwin's perl already, instead of ActiveState.
I don't think this is a "cygwin" perl though. This is released under
Perl's terms, so it's not just gnu. It's a complete build system with
a bundled C compiler, running on Windows natively.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
^ permalink raw reply
* Re: [PATCH] Eliminate Scalar::Util usage from private-Error.pm
From: Johannes Schindelin @ 2006-07-27 14:32 UTC (permalink / raw)
To: Randal L. Schwartz; +Cc: Jakub Narebski, git
In-Reply-To: <867j1zb00h.fsf@blue.stonehenge.com>
Hi,
On Thu, 27 Jul 2006, Randal L. Schwartz wrote:
> >>>>> "Johannes" == Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> Johannes> Wishful thinking. If it wasn't for political reasons, certain people would
> Johannes> use cygwin's perl already, instead of ActiveState.
>
> I don't think this is a "cygwin" perl though. This is released under
> Perl's terms, so it's not just gnu. It's a complete build system with
> a bundled C compiler, running on Windows natively.
What free people rarely think about: Windows has a severe path problem. It
is not the only problem of Windows, but a very real, and very annoying
one. Nobody in her right mind would try to make ":" part of a path, let
alone ";" part of the $PATH!
So I think it is still better to use cygwin's perl, not ActiveState, or
even Strawberry (which ice cream addict came up with _that_ one?).
At least, it is better, _if_ you have a choice.
Ciao,
Dscho
^ permalink raw reply
* Re: Licensing and the library version of git
From: Jon Smirl @ 2006-07-27 16:11 UTC (permalink / raw)
To: Petr Baudis; +Cc: Johannes Schindelin, git
In-Reply-To: <20060727131127.GA13776@pasky.or.cz>
On 7/27/06, Petr Baudis <pasky@suse.cz> wrote:
> > You may like trying to force GPL onto the app but many apps are
> > stuck with the license they have and can't be changed since there is
> > no way to contact the original developers.
>
> At this point, git-shortlog lists exactly 200 people (at least entries
> like Unknown or No name are all linux@horizon.com ;-).
Inability to integrate with Microsoft Visual Studio is going to have a
lot of impact on the cross platform use of git. Is a conscious
decision being made to stop this integration or is this just unplanned
side effect of the original license? If this is an unplanned side
effect, the quicker we move, the easier it is to fix.
Note that only the code going into the library needs to be LGPL. That
should significantly reduce the number of authors that need to be
contacted.
A first step to fixing this would be to add an immediate requirement
that all new code that is targeted to library functions be licensed
LGPL. That will at least stop the problem from getting any worse.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply
* Re: Licensing and the library version of git
From: Johannes Schindelin @ 2006-07-27 16:38 UTC (permalink / raw)
To: Jon Smirl; +Cc: Petr Baudis, git
In-Reply-To: <9e4733910607270911p50d25d97w1a898fc7a9119e7d@mail.gmail.com>
Hi,
On Thu, 27 Jul 2006, Jon Smirl wrote:
> On 7/27/06, Petr Baudis <pasky@suse.cz> wrote:
> > > You may like trying to force GPL onto the app but many apps are
> > > stuck with the license they have and can't be changed since there is
> > > no way to contact the original developers.
> >
> > At this point, git-shortlog lists exactly 200 people (at least entries
> > like Unknown or No name are all linux@horizon.com ;-).
>
> Inability to integrate with Microsoft Visual Studio is going to have a
> lot of impact on the cross platform use of git. Is a conscious
> decision being made to stop this integration or is this just unplanned
> side effect of the original license? If this is an unplanned side
> effect, the quicker we move, the easier it is to fix.
If you want to do it, go ahead. I think the reason it has not been done so
far is that nobody had the need, or alternatively was not ready to do
it or hire someone to do it.
> Note that only the code going into the library needs to be LGPL. That
> should significantly reduce the number of authors that need to be
> contacted.
No and no.
Let me tackle the second point first: Almost all functionality is in the
library, and more is to be transferred to it.
The first point: If you want to integrate git into MSVC, you have to
provide it via the SCCI. Note that the letter "I" stands for "Interface",
which makes a runtime linking with the component a non-derivative work.
Which basically means that you need not GPL MSVC.
> A first step to fixing this would be to add an immediate requirement
> that all new code that is targeted to library functions be licensed
> LGPL. That will at least stop the problem from getting any worse.
If you still feel the need for LGPL, go ahead, find all contributors and
contact them.
Ciao,
Dscho
^ permalink raw reply
* Re: Git clone stalls at a read(3, ...) saw using strace
From: Pavel Roskin @ 2006-07-27 16:38 UTC (permalink / raw)
To: André Goddard Rosa; +Cc: git
In-Reply-To: <b8bf37780607270516i7fbd8844he03e107b15fd2ed7@mail.gmail.com>
On Thu, 2006-07-27 at 08:16 -0400, André Goddard Rosa wrote:
> Hi, all!
>
> Please CC me as I'm not subscribed.
>
> Using GIT 1.4.1, I tried to get this repository:
Please try git 1.4.1.1, it fixes git-clone.
--
Regards,
Pavel Roskin
^ permalink raw reply
* Re: Licensing and the library version of git
From: Linus Torvalds @ 2006-07-27 16:41 UTC (permalink / raw)
To: Jon Smirl; +Cc: Petr Baudis, Johannes Schindelin, git
In-Reply-To: <9e4733910607270911p50d25d97w1a898fc7a9119e7d@mail.gmail.com>
On Thu, 27 Jul 2006, Jon Smirl wrote:
>
> Inability to integrate with Microsoft Visual Studio is going to have a
> lot of impact on the cross platform use of git. Is a conscious
> decision being made to stop this integration or is this just unplanned
> side effect of the original license? If this is an unplanned side
> effect, the quicker we move, the easier it is to fix.
I don't think the choice of GPLv2 is an "unplanned side effect". It's a
fact.
I personally don't much like the LGPL.
I'd also like to point out that unlike every single horror I've ever
witnessed when looking closer at SCM products, git actually has a simple
design, with stable and reasonably well-documented data structures. In
fact, I'm a huge proponent of designing your code around the data, rather
than the other way around, and I think it's one of the reasons git has
been fairly successful (*).
So it's easy enough to just write whatever Java code or something to just
access the databases yourself. The object model of git may be smart, but
it's neither proprietary nor patented. I suspect it's often a lot easier
to integrate git into other projects _that_ way, rather than try to
actually port the code itself.
Linus
(*) I will, in fact, claim that the difference between a bad programmer
and a good one is whether he considers his code or his data structures
more important. Bad programmers worry about the code. Good programmers
worry about data structures and their relationships.
^ permalink raw reply
* Re: Git clone stalls at a read(3, ...) saw using strace
From: André Goddard Rosa @ 2006-07-27 16:43 UTC (permalink / raw)
To: Pavel Roskin; +Cc: git
In-Reply-To: <1154018302.13273.0.camel@dv>
On 7/27/06, Pavel Roskin <proski@gnu.org> wrote:
> On Thu, 2006-07-27 at 08:16 -0400, André Goddard Rosa wrote:
> > Hi, all!
> >
> > Please CC me as I'm not subscribed.
> >
> > Using GIT 1.4.1, I tried to get this repository:
>
> Please try git 1.4.1.1, it fixes git-clone.
Thank you so much, Pavel!
Downloading it right now!
Thanks a lot,
--
[]s,
André Goddard
^ permalink raw reply
* Re: Licensing and the library version of git
From: Linus Torvalds @ 2006-07-27 16:46 UTC (permalink / raw)
To: Jon Smirl; +Cc: Petr Baudis, Johannes Schindelin, git
In-Reply-To: <Pine.LNX.4.64.0607270936200.4168@g5.osdl.org>
On Thu, 27 Jul 2006, Linus Torvalds wrote:
>
> I'd also like to point out that unlike every single horror I've ever
> witnessed when looking closer at SCM products, git actually has a simple
> design, with stable and reasonably well-documented data structures.
Side note: they got even cleaner with the recent 'objformat' merge, where
the unpacked objects now have the same format as the packed ones. I'd
suggest that if somebody is interested in duplicating git functionality,
they should start with the new format, and thus be able to share more
code.
Also note that a lot of the really _core_ and complex git functionality
(notably, the revision list parsing, which is really all of the truly
fundamental stuff) is probably not something that a project like Visual
Studio or an Eclipse plugin would ever even want.
I seriously doubt that Eclipse or Visual Stupido could ever actually
_understand_ what git does, so the only parts you actually would want to
use for those is literally the trivial stuff - the "look up objects" and
"generate commits" part.
Linus
^ permalink raw reply
* Projects using git now
From: André Goddard Rosa @ 2006-07-27 16:51 UTC (permalink / raw)
To: git
Hi, all!
Please CC me as I'm not subscribed to the list.
Do you have a link to a homepage where I can see what projects
are using git right now or planning migrating?
I'm trying to convince people here at Siemens to use git. I use
git and I like it a lot. I know that the linux kernel is so successfull
using it because I listen to lkml.
Do you have more examples, besides wine?
--
[]s,
André Goddard
^ permalink raw reply
* Re: Licensing and the library version of git
From: Grzegorz Kulewski @ 2006-07-27 16:51 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Jon Smirl, Petr Baudis, Johannes Schindelin, git
In-Reply-To: <Pine.LNX.4.64.0607270936200.4168@g5.osdl.org>
On Thu, 27 Jul 2006, Linus Torvalds wrote:
> So it's easy enough to just write whatever Java code or something to just
> access the databases yourself. The object model of git may be smart, but
> it's neither proprietary nor patented. I suspect it's often a lot easier
> to integrate git into other projects _that_ way, rather than try to
> actually port the code itself.
But won't it create hell of several buggy, incompatible, not well
maintained versions of GIT (or at least GIT "client")?
I think that part of the anwser for question "Why do people use GIT?" is
that they trust you and other maintainers that you do a good and stable
job. Won't creating several ports/forks/whatever destroy at least part of
this?
Besides it is a whole lot easier to just create some JNI code around
libgit and use it from Java than to rewrite GIT (or part of it) in Java or
in any other language. Also resulting code is likely to be (maybe not very
much but still) faster.
Thanks,
Grzegorz Kulewski
^ permalink raw reply
* Re: Git clone stalls at a read(3, ...) saw using strace
From: Linus Torvalds @ 2006-07-27 16:54 UTC (permalink / raw)
To: André Goddard Rosa; +Cc: Pavel Roskin, Git Mailing List
In-Reply-To: <b8bf37780607270943w562ec21fuab0eb882b3ccffeb@mail.gmail.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 890 bytes --]
On Thu, 27 Jul 2006, André Goddard Rosa wrote:
> >
> > Please try git 1.4.1.1, it fixes git-clone.
>
> Thank you so much, Pavel!
>
> Downloading it right now!
The problem is that at least the timeout-fix is a server-side thing, it
won't fix the client. So if a server is running the broken 1.4.1 release,
it will time out the clients after 10 minutes. It wasn't obvious breakage,
because most people do smaller fetches, and never even got close to that
timeout (most of my connections tend to be in the seconds ;).
I asked Kees to upgrade kernel.org, but he's apparently busy at OSCON this
week, so I'm bcc'ing the other admins here to ask them to upgrade to
1.4.1.1. That won't fix the montavista site, though.
That said, I don't think the timeout problem should have caused a _stall_
of the connection, it should have caused an early EOF and thus a unpack
error.
Linus
^ permalink raw reply
* Re: Licensing and the library version of git
From: Jakub Narebski @ 2006-07-27 16:58 UTC (permalink / raw)
To: git
In-Reply-To: <Pine.LNX.4.64.0607270941400.4168@g5.osdl.org>
Linus Torvalds wrote:
> I seriously doubt that Eclipse or Visual Stupido could ever actually
^^^^^^^^^^^^^^
Visual Stupido... nice typo :-D
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* Re: Projects using git now
From: André Goddard Rosa @ 2006-07-27 17:04 UTC (permalink / raw)
To: git
In-Reply-To: <b8bf37780607270951h24d899b8yfa22a1fcb2bde5db@mail.gmail.com>
On 7/27/06, André Goddard Rosa <andre.goddard@gmail.com> wrote:
> Hi, all!
>
> Please CC me as I'm not subscribed to the list.
>
> Do you have a link to a homepage where I can see what projects
> are using git right now or planning migrating?
>
> I'm trying to convince people here at Siemens to use git. I use
> git and I like it a lot. I know that the linux kernel is so successfull
> using it because I listen to lkml.
>
> Do you have more examples, besides wine?
>
Sorry to bother, I already found these two pages:
http://git.or.cz/gitwiki/GitProjects
http://en.wikipedia.org/wiki/Git_(software)
Do you think they are updated?
--
[]s,
André Goddard
^ permalink raw reply
* Re: Licensing and the library version of git
From: Linus Torvalds @ 2006-07-27 17:07 UTC (permalink / raw)
To: Grzegorz Kulewski; +Cc: Jon Smirl, Petr Baudis, Johannes Schindelin, git
In-Reply-To: <Pine.LNX.4.63.0607271846390.8976@alpha.polcom.net>
On Thu, 27 Jul 2006, Grzegorz Kulewski wrote:
>
> I think that part of the anwser for question "Why do people use GIT?" is that
> they trust you and other maintainers that you do a good and stable job. Won't
> creating several ports/forks/whatever destroy at least part of this?
Sure. But the point is, the GPLv2 isn't exactly up for discussion. People
can complain all they want, but if they want to trust me, they'll take the
GPLv2. It's that easy.
And if people don't want the GPLv2, they have alternatives as outlined.
Yes, their code will be less reliable and good, but hey, that's kind of my
_point_. A lot of the quality of open source projects comes from the fact
that you see how it gets used, and the LGPL is strictly inferior, because
it ends up hiding all the _important_ parts behind a veil of impenetrable
secrecy.
Quite frankly, I don't want to see bug-reports and interfaces that I can't
actually duplicate and follow myself. I'm so _totally_ uninterested in
those kinds of things that it's not even funny.
Linus
^ permalink raw reply
* Re: Projects using git now
From: Jakub Narebski @ 2006-07-27 17:10 UTC (permalink / raw)
To: git
In-Reply-To: <b8bf37780607270951h24d899b8yfa22a1fcb2bde5db@mail.gmail.com>
André Goddard Rosa wrote:
> Do you have a link to a homepage where I can see what projects
> are using git right now or planning migrating?
>
> I'm trying to convince people here at Siemens to use git. I use
> git and I like it a lot. I know that the linux kernel is so successfull
> using it because I listen to lkml.
>
> Do you have more examples, besides wine?
Look up Git Wiki page, http://git.or.cz/gitwiki/GitProjects
I guess that the worst obstacles in wider adoption of git is lack of
intrinsic subproject support (for modular projects, and perhas for
distributions), and lack of native MS Windows port.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
^ permalink raw reply
* [PATCH 0/6] merge-recur: Assorted cleanups
From: Johannes Schindelin @ 2006-07-27 17:12 UTC (permalink / raw)
To: git, junkio
Hi,
these 6 patches are further cleanups in the spirit of Junio's patch. There
are 2 TODOs left: one minor, and the big read_tree thing.
Ciao,
Dscho
^ permalink raw reply
* [PATCH 1/6] merge-recur: Convert variable names to lower_case
From: Johannes Schindelin @ 2006-07-27 17:12 UTC (permalink / raw)
To: git, junkio
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
merge-recursive.c | 380 ++++++++++++++++++++++++++---------------------------
1 files changed, 189 insertions(+), 191 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 85bb47a..b0035cc 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -122,8 +122,8 @@ struct stage_data
unsigned processed:1;
};
-static struct path_list currentFileSet = {NULL, 0, 0, 1};
-static struct path_list currentDirectorySet = {NULL, 0, 0, 1};
+static struct path_list current_file_set = {NULL, 0, 0, 1};
+static struct path_list current_directory_set = {NULL, 0, 0, 1};
static int output_indent = 0;
@@ -335,9 +335,9 @@ static int save_files_dirs(const unsigne
newpath[baselen + len] = '\0';
if (S_ISDIR(mode))
- path_list_insert(newpath, ¤tDirectorySet);
+ path_list_insert(newpath, ¤t_directory_set);
else
- path_list_insert(newpath, ¤tFileSet);
+ path_list_insert(newpath, ¤t_file_set);
free(newpath);
return READ_TREE_RECURSIVE;
@@ -351,7 +351,7 @@ static int get_files_dirs(struct tree *t
debug(" get_files_dirs done (0)\n");
return 0;
}
- n = currentFileSet.nr + currentDirectorySet.nr;
+ n = current_file_set.nr + current_directory_set.nr;
debug(" get_files_dirs done (%d)\n", n);
return n;
}
@@ -378,7 +378,7 @@ static struct stage_data *insert_stage_d
}
/*
- * Create a dictionary mapping file names to CacheEntry objects. The
+ * Create a dictionary mapping file names to stage_data objects. The
* dictionary contains one entry for every path with a non-zero stage entry.
*/
static struct path_list *get_unmerged(void)
@@ -420,15 +420,15 @@ struct rename
};
/*
- * Get information of all renames which occured between 'oTree' and
- * 'tree'. We need the three trees in the merge ('oTree', 'aTree' and
- * 'bTree') to be able to associate the correct cache entries with
- * the rename information. 'tree' is always equal to either aTree or bTree.
+ * Get information of all renames which occured between 'o_tree' and
+ * 'tree'. We need the three trees in the merge ('o_tree', 'a_tree' and
+ * 'b_tree') to be able to associate the correct cache entries with
+ * the rename information. 'tree' is always equal to either a_tree or b_tree.
*/
static struct path_list *get_renames(struct tree *tree,
- struct tree *oTree,
- struct tree *aTree,
- struct tree *bTree,
+ struct tree *o_tree,
+ struct tree *a_tree,
+ struct tree *b_tree,
struct path_list *entries)
{
int i;
@@ -437,7 +437,7 @@ static struct path_list *get_renames(str
#ifdef DEBUG
time_t t = time(0);
- debug("getRenames ...\n");
+ debug("get_renames ...\n");
#endif
renames = xcalloc(1, sizeof(struct path_list));
@@ -447,7 +447,7 @@ #endif
opts.output_format = DIFF_FORMAT_NO_OUTPUT;
if (diff_setup_done(&opts) < 0)
die("diff setup failed");
- diff_tree_sha1(oTree->object.sha1, tree->object.sha1, "", &opts);
+ diff_tree_sha1(o_tree->object.sha1, tree->object.sha1, "", &opts);
diffcore_std(&opts);
for (i = 0; i < diff_queued_diff.nr; ++i) {
struct path_list_item *item;
@@ -463,14 +463,14 @@ #endif
item = path_list_lookup(re->pair->one->path, entries);
if (!item)
re->src_entry = insert_stage_data(re->pair->one->path,
- oTree, aTree, bTree, entries);
+ o_tree, a_tree, b_tree, entries);
else
re->src_entry = item->util;
item = path_list_lookup(re->pair->two->path, entries);
if (!item)
re->dst_entry = insert_stage_data(re->pair->two->path,
- oTree, aTree, bTree, entries);
+ o_tree, a_tree, b_tree, entries);
else
re->dst_entry = item->util;
item = path_list_insert(pair->one->path, renames);
@@ -480,7 +480,7 @@ #endif
diff_queued_diff.nr = 0;
diff_flush(&opts);
#ifdef DEBUG
- debug(" getRenames done in %ld\n", time(0)-t);
+ debug(" get_renames done in %ld\n", time(0)-t);
#endif
return renames;
}
@@ -526,25 +526,23 @@ static int remove_path(const char *name)
return ret;
}
-/* General TODO: unC99ify the code: no declaration after code */
-/* General TODO: no javaIfiCation: rename updateCache to update_cache */
/*
* TODO: once we no longer call external programs, we'd probably be better off
* not setting / getting the environment variable GIT_INDEX_FILE all the time.
*/
int remove_file(int clean, const char *path)
{
- int updateCache = index_only || clean;
- int updateWd = !index_only;
+ int update_cache = index_only || clean;
+ int update_working_directory = !index_only;
- if (updateCache) {
+ if (update_cache) {
if (!cache_dirty)
read_cache_from(getenv("GIT_INDEX_FILE"));
cache_dirty++;
if (remove_file_from_cache(path))
return -1;
}
- if (updateWd)
+ if (update_working_directory)
{
unlink(path);
if (errno != ENOENT || errno != EISDIR)
@@ -566,12 +564,12 @@ static char *unique_path(const char *pat
for (; *p; ++p)
if ('/' == *p)
*p = '_';
- while (path_list_has_path(¤tFileSet, newpath) ||
- path_list_has_path(¤tDirectorySet, newpath) ||
+ while (path_list_has_path(¤t_file_set, newpath) ||
+ path_list_has_path(¤t_directory_set, newpath) ||
lstat(newpath, &st) == 0)
sprintf(p, "_%d", suffix++);
- path_list_insert(newpath, ¤tFileSet);
+ path_list_insert(newpath, ¤t_file_set);
return newpath;
}
@@ -784,22 +782,22 @@ static void conflict_rename_rename(struc
int delp = 0;
const char *ren1_dst = ren1->pair->two->path;
const char *ren2_dst = ren2->pair->two->path;
- const char *dstName1 = ren1_dst;
- const char *dstName2 = ren2_dst;
- if (path_list_has_path(¤tDirectorySet, ren1_dst)) {
- dstName1 = del[delp++] = unique_path(ren1_dst, branch1);
+ const char *dst_name1 = ren1_dst;
+ const char *dst_name2 = ren2_dst;
+ if (path_list_has_path(¤t_directory_set, ren1_dst)) {
+ dst_name1 = del[delp++] = unique_path(ren1_dst, branch1);
output("%s is a directory in %s adding as %s instead",
- ren1_dst, branch2, dstName1);
+ ren1_dst, branch2, dst_name1);
remove_file(0, ren1_dst);
}
- if (path_list_has_path(¤tDirectorySet, ren2_dst)) {
- dstName2 = del[delp++] = unique_path(ren2_dst, branch2);
+ if (path_list_has_path(¤t_directory_set, ren2_dst)) {
+ dst_name2 = del[delp++] = unique_path(ren2_dst, branch2);
output("%s is a directory in %s adding as %s instead",
- ren2_dst, branch1, dstName2);
+ ren2_dst, branch1, dst_name2);
remove_file(0, ren2_dst);
}
- update_stages(dstName1, NULL, ren1->pair->two, NULL, 1);
- update_stages(dstName2, NULL, NULL, ren2->pair->two, 1);
+ update_stages(dst_name1, NULL, ren1->pair->two, NULL, 1);
+ update_stages(dst_name2, NULL, NULL, ren2->pair->two, 1);
while (delp--)
free(del[delp]);
}
@@ -807,11 +805,11 @@ static void conflict_rename_rename(struc
static void conflict_rename_dir(struct rename *ren1,
const char *branch1)
{
- char *newPath = unique_path(ren1->pair->two->path, branch1);
- output("Renaming %s to %s instead", ren1->pair->one->path, newPath);
+ char *new_path = unique_path(ren1->pair->two->path, branch1);
+ output("Renaming %s to %s instead", ren1->pair->one->path, new_path);
remove_file(0, ren1->pair->two->path);
- update_file(0, ren1->pair->two->sha1, ren1->pair->two->mode, newPath);
- free(newPath);
+ update_file(0, ren1->pair->two->sha1, ren1->pair->two->mode, new_path);
+ free(new_path);
}
static void conflict_rename_rename_2(struct rename *ren1,
@@ -819,74 +817,74 @@ static void conflict_rename_rename_2(str
struct rename *ren2,
const char *branch2)
{
- char *newPath1 = unique_path(ren1->pair->two->path, branch1);
- char *newPath2 = unique_path(ren2->pair->two->path, branch2);
+ char *new_path1 = unique_path(ren1->pair->two->path, branch1);
+ char *new_path2 = unique_path(ren2->pair->two->path, branch2);
output("Renaming %s to %s and %s to %s instead",
- ren1->pair->one->path, newPath1,
- ren2->pair->one->path, newPath2);
+ ren1->pair->one->path, new_path1,
+ ren2->pair->one->path, new_path2);
remove_file(0, ren1->pair->two->path);
- update_file(0, ren1->pair->two->sha1, ren1->pair->two->mode, newPath1);
- update_file(0, ren2->pair->two->sha1, ren2->pair->two->mode, newPath2);
- free(newPath2);
- free(newPath1);
+ update_file(0, ren1->pair->two->sha1, ren1->pair->two->mode, new_path1);
+ update_file(0, ren2->pair->two->sha1, ren2->pair->two->mode, new_path2);
+ free(new_path2);
+ free(new_path1);
}
/* General TODO: get rid of all the debug messages */
-static int process_renames(struct path_list *renamesA,
- struct path_list *renamesB,
- const char *branchNameA,
- const char *branchNameB)
+static int process_renames(struct path_list *a_renames,
+ struct path_list *b_renames,
+ const char *a_branch,
+ const char *b_branch)
{
- int cleanMerge = 1, i, j;
- struct path_list byDstA = {NULL, 0, 0, 0}, byDstB = {NULL, 0, 0, 0};
+ int clean_merge = 1, i, j;
+ struct path_list a_by_dst = {NULL, 0, 0, 0}, b_by_dst = {NULL, 0, 0, 0};
const struct rename *sre;
- for (i = 0; i < renamesA->nr; i++) {
- sre = renamesA->items[i].util;
- path_list_insert(sre->pair->two->path, &byDstA)->util
+ for (i = 0; i < a_renames->nr; i++) {
+ sre = a_renames->items[i].util;
+ path_list_insert(sre->pair->two->path, &a_by_dst)->util
= sre->dst_entry;
}
- for (i = 0; i < renamesB->nr; i++) {
- sre = renamesB->items[i].util;
- path_list_insert(sre->pair->two->path, &byDstB)->util
+ for (i = 0; i < b_renames->nr; i++) {
+ sre = b_renames->items[i].util;
+ path_list_insert(sre->pair->two->path, &b_by_dst)->util
= sre->dst_entry;
}
- for (i = 0, j = 0; i < renamesA->nr || j < renamesB->nr;) {
+ for (i = 0, j = 0; i < a_renames->nr || j < b_renames->nr;) {
int compare;
char *src;
struct path_list *renames1, *renames2, *renames2Dst;
struct rename *ren1 = NULL, *ren2 = NULL;
- const char *branchName1, *branchName2;
+ const char *branch1, *branch2;
const char *ren1_src, *ren1_dst;
- if (i >= renamesA->nr) {
+ if (i >= a_renames->nr) {
compare = 1;
- ren2 = renamesB->items[j++].util;
- } else if (j >= renamesB->nr) {
+ ren2 = b_renames->items[j++].util;
+ } else if (j >= b_renames->nr) {
compare = -1;
- ren1 = renamesA->items[i++].util;
+ ren1 = a_renames->items[i++].util;
} else {
- compare = strcmp(renamesA->items[i].path,
- renamesB->items[j].path);
- ren1 = renamesA->items[i++].util;
- ren2 = renamesB->items[j++].util;
+ compare = strcmp(a_renames->items[i].path,
+ b_renames->items[j].path);
+ ren1 = a_renames->items[i++].util;
+ ren2 = b_renames->items[j++].util;
}
/* TODO: refactor, so that 1/2 are not needed */
if (ren1) {
- renames1 = renamesA;
- renames2 = renamesB;
- renames2Dst = &byDstB;
- branchName1 = branchNameA;
- branchName2 = branchNameB;
+ renames1 = a_renames;
+ renames2 = b_renames;
+ renames2Dst = &b_by_dst;
+ branch1 = a_branch;
+ branch2 = b_branch;
} else {
struct rename *tmp;
- renames1 = renamesB;
- renames2 = renamesA;
- renames2Dst = &byDstA;
- branchName1 = branchNameB;
- branchName2 = branchNameA;
+ renames1 = b_renames;
+ renames2 = a_renames;
+ renames2Dst = &a_by_dst;
+ branch1 = b_branch;
+ branch2 = a_branch;
tmp = ren2;
ren2 = ren1;
ren1 = tmp;
@@ -912,21 +910,21 @@ static int process_renames(struct path_l
ren2->dst_entry->processed = 1;
ren2->processed = 1;
if (strcmp(ren1_dst, ren2_dst) != 0) {
- cleanMerge = 0;
+ clean_merge = 0;
output("CONFLICT (rename/rename): "
"Rename %s->%s in branch %s "
"rename %s->%s in %s",
- src, ren1_dst, branchName1,
- src, ren2_dst, branchName2);
- conflict_rename_rename(ren1, branchName1, ren2, branchName2);
+ src, ren1_dst, branch1,
+ src, ren2_dst, branch2);
+ conflict_rename_rename(ren1, branch1, ren2, branch2);
} else {
- remove_file(1, ren1_src);
struct merge_file_info mfi;
+ remove_file(1, ren1_src);
mfi = merge_file(ren1->pair->one,
ren1->pair->two,
ren2->pair->two,
- branchName1,
- branchName2);
+ branch1,
+ branch2);
if (mfi.merge || !mfi.clean)
output("Renaming %s->%s", src, ren1_dst);
@@ -936,7 +934,7 @@ static int process_renames(struct path_l
if (!mfi.clean) {
output("CONFLICT (content): merge conflict in %s",
ren1_dst);
- cleanMerge = 0;
+ clean_merge = 0;
if (!index_only)
update_stages(ren1_dst,
@@ -952,7 +950,7 @@ static int process_renames(struct path_l
struct path_list_item *item;
/* we only use sha1 and mode of these */
struct diff_filespec src_other, dst_other;
- int tryMerge, stage = renamesA == renames1 ? 3: 2;
+ int try_merge, stage = a_renames == renames1 ? 3: 2;
remove_file(1, ren1_src);
@@ -963,52 +961,52 @@ static int process_renames(struct path_l
ren1->dst_entry->stages[stage].sha, 20);
dst_other.mode = ren1->dst_entry->stages[stage].mode;
- tryMerge = 0;
+ try_merge = 0;
- if (path_list_has_path(¤tDirectorySet, ren1_dst)) {
- cleanMerge = 0;
+ if (path_list_has_path(¤t_directory_set, ren1_dst)) {
+ clean_merge = 0;
output("CONFLICT (rename/directory): Rename %s->%s in %s "
" directory %s added in %s",
- ren1_src, ren1_dst, branchName1,
- ren1_dst, branchName2);
- conflict_rename_dir(ren1, branchName1);
+ ren1_src, ren1_dst, branch1,
+ ren1_dst, branch2);
+ conflict_rename_dir(ren1, branch1);
} else if (sha_eq(src_other.sha1, null_sha1)) {
- cleanMerge = 0;
+ clean_merge = 0;
output("CONFLICT (rename/delete): Rename %s->%s in %s "
"and deleted in %s",
- ren1_src, ren1_dst, branchName1,
- branchName2);
+ ren1_src, ren1_dst, branch1,
+ branch2);
update_file(0, ren1->pair->two->sha1, ren1->pair->two->mode, ren1_dst);
} else if (!sha_eq(dst_other.sha1, null_sha1)) {
- const char *newPath;
- cleanMerge = 0;
- tryMerge = 1;
+ const char *new_path;
+ clean_merge = 0;
+ try_merge = 1;
output("CONFLICT (rename/add): Rename %s->%s in %s. "
"%s added in %s",
- ren1_src, ren1_dst, branchName1,
- ren1_dst, branchName2);
- newPath = unique_path(ren1_dst, branchName2);
- output("Adding as %s instead", newPath);
- update_file(0, dst_other.sha1, dst_other.mode, newPath);
+ ren1_src, ren1_dst, branch1,
+ ren1_dst, branch2);
+ new_path = unique_path(ren1_dst, branch2);
+ output("Adding as %s instead", new_path);
+ update_file(0, dst_other.sha1, dst_other.mode, new_path);
} else if ((item = path_list_lookup(ren1_dst, renames2Dst))) {
ren2 = item->util;
- cleanMerge = 0;
+ clean_merge = 0;
ren2->processed = 1;
output("CONFLICT (rename/rename): Rename %s->%s in %s. "
"Rename %s->%s in %s",
- ren1_src, ren1_dst, branchName1,
- ren2->pair->one->path, ren2->pair->two->path, branchName2);
- conflict_rename_rename_2(ren1, branchName1, ren2, branchName2);
+ ren1_src, ren1_dst, branch1,
+ ren2->pair->one->path, ren2->pair->two->path, branch2);
+ conflict_rename_rename_2(ren1, branch1, ren2, branch2);
} else
- tryMerge = 1;
+ try_merge = 1;
- if (tryMerge) {
+ if (try_merge) {
struct diff_filespec *o, *a, *b;
struct merge_file_info mfi;
src_other.path = (char *)ren1_src;
o = ren1->pair->one;
- if (renamesA == renames1) {
+ if (a_renames == renames1) {
a = ren1->pair->two;
b = &src_other;
} else {
@@ -1016,7 +1014,7 @@ static int process_renames(struct path_l
a = &src_other;
}
mfi = merge_file(o, a, b,
- branchNameA, branchNameB);
+ a_branch, b_branch);
if (mfi.merge || !mfi.clean)
output("Renaming %s => %s", ren1_src, ren1_dst);
@@ -1025,7 +1023,7 @@ static int process_renames(struct path_l
if (!mfi.clean) {
output("CONFLICT (rename/modify): Merge conflict in %s",
ren1_dst);
- cleanMerge = 0;
+ clean_merge = 0;
if (!index_only)
update_stages(ren1_dst,
@@ -1035,12 +1033,12 @@ static int process_renames(struct path_l
}
}
}
- path_list_clear(&byDstA, 0);
- path_list_clear(&byDstB, 0);
+ path_list_clear(&a_by_dst, 0);
+ path_list_clear(&b_by_dst, 0);
if (cache_dirty)
flush_cache();
- return cleanMerge;
+ return clean_merge;
}
static unsigned char *has_sha(const unsigned char *sha)
@@ -1057,116 +1055,116 @@ static int process_entry(const char *pat
printf("processing entry, clean cache: %s\n", index_only ? "yes": "no");
print_index_entry("\tpath: ", entry);
*/
- int cleanMerge = 1;
- unsigned char *oSha = has_sha(entry->stages[1].sha);
- unsigned char *aSha = has_sha(entry->stages[2].sha);
- unsigned char *bSha = has_sha(entry->stages[3].sha);
- unsigned oMode = entry->stages[1].mode;
- unsigned aMode = entry->stages[2].mode;
- unsigned bMode = entry->stages[3].mode;
-
- if (oSha && (!aSha || !bSha)) {
+ int clean_merge = 1;
+ unsigned char *o_sha = has_sha(entry->stages[1].sha);
+ unsigned char *a_sha = has_sha(entry->stages[2].sha);
+ unsigned char *b_sha = has_sha(entry->stages[3].sha);
+ unsigned o_mode = entry->stages[1].mode;
+ unsigned a_mode = entry->stages[2].mode;
+ unsigned b_mode = entry->stages[3].mode;
+
+ if (o_sha && (!a_sha || !b_sha)) {
/* Case A: Deleted in one */
- if ((!aSha && !bSha) ||
- (sha_eq(aSha, oSha) && !bSha) ||
- (!aSha && sha_eq(bSha, oSha))) {
+ if ((!a_sha && !b_sha) ||
+ (sha_eq(a_sha, o_sha) && !b_sha) ||
+ (!a_sha && sha_eq(b_sha, o_sha))) {
/* Deleted in both or deleted in one and
* unchanged in the other */
- if (aSha)
+ if (a_sha)
output("Removing %s", path);
remove_file(1, path);
} else {
/* Deleted in one and changed in the other */
- cleanMerge = 0;
- if (!aSha) {
+ clean_merge = 0;
+ if (!a_sha) {
output("CONFLICT (delete/modify): %s deleted in %s "
"and modified in %s. Version %s of %s left in tree.",
path, branch1Name,
branch2Name, branch2Name, path);
- update_file(0, bSha, bMode, path);
+ update_file(0, b_sha, b_mode, path);
} else {
output("CONFLICT (delete/modify): %s deleted in %s "
"and modified in %s. Version %s of %s left in tree.",
path, branch2Name,
branch1Name, branch1Name, path);
- update_file(0, aSha, aMode, path);
+ update_file(0, a_sha, a_mode, path);
}
}
- } else if ((!oSha && aSha && !bSha) ||
- (!oSha && !aSha && bSha)) {
+ } else if ((!o_sha && a_sha && !b_sha) ||
+ (!o_sha && !a_sha && b_sha)) {
/* Case B: Added in one. */
- const char *addBranch;
- const char *otherBranch;
+ const char *add_branch;
+ const char *other_branch;
unsigned mode;
const unsigned char *sha;
const char *conf;
- if (aSha) {
- addBranch = branch1Name;
- otherBranch = branch2Name;
- mode = aMode;
- sha = aSha;
+ if (a_sha) {
+ add_branch = branch1Name;
+ other_branch = branch2Name;
+ mode = a_mode;
+ sha = a_sha;
conf = "file/directory";
} else {
- addBranch = branch2Name;
- otherBranch = branch1Name;
- mode = bMode;
- sha = bSha;
+ add_branch = branch2Name;
+ other_branch = branch1Name;
+ mode = b_mode;
+ sha = b_sha;
conf = "directory/file";
}
- if (path_list_has_path(¤tDirectorySet, path)) {
- const char *newPath = unique_path(path, addBranch);
- cleanMerge = 0;
+ if (path_list_has_path(¤t_directory_set, path)) {
+ const char *new_path = unique_path(path, add_branch);
+ clean_merge = 0;
output("CONFLICT (%s): There is a directory with name %s in %s. "
"Adding %s as %s",
- conf, path, otherBranch, path, newPath);
+ conf, path, other_branch, path, new_path);
remove_file(0, path);
- update_file(0, sha, mode, newPath);
+ update_file(0, sha, mode, new_path);
} else {
output("Adding %s", path);
update_file(1, sha, mode, path);
}
- } else if (!oSha && aSha && bSha) {
+ } else if (!o_sha && a_sha && b_sha) {
/* Case C: Added in both (check for same permissions). */
- if (sha_eq(aSha, bSha)) {
- if (aMode != bMode) {
- cleanMerge = 0;
+ if (sha_eq(a_sha, b_sha)) {
+ if (a_mode != b_mode) {
+ clean_merge = 0;
output("CONFLICT: File %s added identically in both branches, "
"but permissions conflict %06o->%06o",
- path, aMode, bMode);
- output("CONFLICT: adding with permission: %06o", aMode);
- update_file(0, aSha, aMode, path);
+ path, a_mode, b_mode);
+ output("CONFLICT: adding with permission: %06o", a_mode);
+ update_file(0, a_sha, a_mode, path);
} else {
/* This case is handled by git-read-tree */
assert(0 && "This case must be handled by git-read-tree");
}
} else {
- const char *newPath1, *newPath2;
- cleanMerge = 0;
- newPath1 = unique_path(path, branch1Name);
- newPath2 = unique_path(path, branch2Name);
+ const char *new_path1, *new_path2;
+ clean_merge = 0;
+ new_path1 = unique_path(path, branch1Name);
+ new_path2 = unique_path(path, branch2Name);
output("CONFLICT (add/add): File %s added non-identically "
"in both branches. Adding as %s and %s instead.",
- path, newPath1, newPath2);
+ path, new_path1, new_path2);
remove_file(0, path);
- update_file(0, aSha, aMode, newPath1);
- update_file(0, bSha, bMode, newPath2);
+ update_file(0, a_sha, a_mode, new_path1);
+ update_file(0, b_sha, b_mode, new_path2);
}
- } else if (oSha && aSha && bSha) {
+ } else if (o_sha && a_sha && b_sha) {
/* case D: Modified in both, but differently. */
struct merge_file_info mfi;
struct diff_filespec o, a, b;
output("Auto-merging %s", path);
o.path = a.path = b.path = (char *)path;
- memcpy(o.sha1, oSha, 20);
- o.mode = oMode;
- memcpy(a.sha1, aSha, 20);
- a.mode = aMode;
- memcpy(b.sha1, bSha, 20);
- b.mode = bMode;
+ memcpy(o.sha1, o_sha, 20);
+ o.mode = o_mode;
+ memcpy(a.sha1, a_sha, 20);
+ a.mode = a_mode;
+ memcpy(b.sha1, b_sha, 20);
+ b.mode = b_mode;
mfi = merge_file(&o, &a, &b,
branch1Name, branch2Name);
@@ -1174,14 +1172,14 @@ static int process_entry(const char *pat
if (mfi.clean)
update_file(1, mfi.sha, mfi.mode, path);
else {
- cleanMerge = 0;
+ clean_merge = 0;
output("CONFLICT (content): Merge conflict in %s", path);
if (index_only)
update_file(0, mfi.sha, mfi.mode, path);
else
update_file_flags(mfi.sha, mfi.mode, path,
- 0 /* updateCache */, 1 /* updateWd */);
+ 0 /* update_cache */, 1 /* update_working_directory */);
}
} else
die("Fatal merge failure, shouldn't happen.");
@@ -1189,7 +1187,7 @@ static int process_entry(const char *pat
if (cache_dirty)
flush_cache();
- return cleanMerge;
+ return clean_merge;
}
static int merge_trees(struct tree *head,
@@ -1218,8 +1216,8 @@ static int merge_trees(struct tree *head
if (!*result) {
struct path_list *entries, *re_head, *re_merge;
int i;
- path_list_clear(¤tFileSet, 1);
- path_list_clear(¤tDirectorySet, 1);
+ path_list_clear(¤t_file_set, 1);
+ path_list_clear(¤t_directory_set, 1);
get_files_dirs(head);
get_files_dirs(merge);
@@ -1265,12 +1263,12 @@ int merge(struct commit *h1,
struct commit *h2,
const char *branch1Name,
const char *branch2Name,
- int callDepth /* =0 */,
+ int call_depth /* =0 */,
struct commit *ancestor /* =None */,
struct commit **result)
{
struct commit_list *ca = NULL, *iter;
- struct commit *mergedCA;
+ struct commit *merged_common_ancestors;
struct tree *mrtree;
int clean;
@@ -1287,10 +1285,10 @@ int merge(struct commit *h1,
for (iter = ca; iter; iter = iter->next)
output_commit_title(iter->item);
- mergedCA = pop_commit(&ca);
+ merged_common_ancestors = pop_commit(&ca);
for (iter = ca; iter; iter = iter->next) {
- output_indent = callDepth + 1;
+ output_indent = call_depth + 1;
/*
* When the merge fails, the result contains files
* with conflict markers. The cleanness flag is
@@ -1298,19 +1296,19 @@ int merge(struct commit *h1,
* merge_trees has always overwritten it: the commited
* "conflicts" were already resolved.
*/
- merge(mergedCA, iter->item,
+ merge(merged_common_ancestors, iter->item,
"Temporary merge branch 1",
"Temporary merge branch 2",
- callDepth + 1,
+ call_depth + 1,
NULL,
- &mergedCA);
- output_indent = callDepth;
+ &merged_common_ancestors);
+ output_indent = call_depth;
- if (!mergedCA)
+ if (!merged_common_ancestors)
die("merge returned no commit");
}
- if (callDepth == 0) {
+ if (call_depth == 0) {
setup_index(0 /* $GIT_DIR/index */);
index_only = 0;
} else {
@@ -1319,7 +1317,7 @@ int merge(struct commit *h1,
index_only = 1;
}
- clean = merge_trees(h1->tree, h2->tree, mergedCA->tree,
+ clean = merge_trees(h1->tree, h2->tree, merged_common_ancestors->tree,
branch1Name, branch2Name, &mrtree);
if (!ancestor && (clean || index_only)) {
--
1.4.2.rc2.g6a4e
^ permalink raw reply related
* [PATCH 2/6] merge-recur: Get rid of debug code
From: Johannes Schindelin @ 2006-07-27 17:12 UTC (permalink / raw)
To: git, junkio
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
merge-recursive.c | 65 +----------------------------------------------------
1 files changed, 1 insertions(+), 64 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index b0035cc..8d9451f 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -22,56 +22,6 @@ #include "tag.h"
#include "path-list.h"
-/*#define DEBUG*/
-
-#ifdef DEBUG
-#define debug(...) fprintf(stderr, __VA_ARGS__)
-#else
-#define debug(...) do { ; /* nothing */ } while (0)
-#endif
-
-#ifdef DEBUG
-#include "quote.h"
-static void show_ce_entry(const char *tag, struct cache_entry *ce)
-{
- if (tag && *tag &&
- (ce->ce_flags & htons(CE_VALID))) {
- static char alttag[4];
- memcpy(alttag, tag, 3);
- if (isalpha(tag[0]))
- alttag[0] = tolower(tag[0]);
- else if (tag[0] == '?')
- alttag[0] = '!';
- else {
- alttag[0] = 'v';
- alttag[1] = tag[0];
- alttag[2] = ' ';
- alttag[3] = 0;
- }
- tag = alttag;
- }
-
- fprintf(stderr,"%s%06o %s %d\t",
- tag,
- ntohl(ce->ce_mode),
- sha1_to_hex(ce->sha1),
- ce_stage(ce));
- write_name_quoted("", 0, ce->name,
- '\n', stderr);
- fputc('\n', stderr);
-}
-
-static void ls_files(void) {
- int i;
- for (i = 0; i < active_nr; i++) {
- struct cache_entry *ce = active_cache[i];
- show_ce_entry("", ce);
- }
- fprintf(stderr, "---\n");
- if (0) ls_files(); /* avoid "unused" warning */
-}
-#endif
-
/*
* A virtual commit has
* - (const char *)commit->util set to the name, and
@@ -346,13 +296,9 @@ static int save_files_dirs(const unsigne
static int get_files_dirs(struct tree *tree)
{
int n;
- debug("get_files_dirs ...\n");
- if (read_tree_recursive(tree, "", 0, 0, NULL, save_files_dirs) != 0) {
- debug(" get_files_dirs done (0)\n");
+ if (read_tree_recursive(tree, "", 0, 0, NULL, save_files_dirs) != 0)
return 0;
- }
n = current_file_set.nr + current_directory_set.nr;
- debug(" get_files_dirs done (%d)\n", n);
return n;
}
@@ -434,11 +380,6 @@ static struct path_list *get_renames(str
int i;
struct path_list *renames;
struct diff_options opts;
-#ifdef DEBUG
- time_t t = time(0);
-
- debug("get_renames ...\n");
-#endif
renames = xcalloc(1, sizeof(struct path_list));
diff_setup(&opts);
@@ -479,9 +420,6 @@ #endif
opts.output_format = DIFF_FORMAT_NO_OUTPUT;
diff_queued_diff.nr = 0;
diff_flush(&opts);
-#ifdef DEBUG
- debug(" get_renames done in %ld\n", time(0)-t);
-#endif
return renames;
}
@@ -829,7 +767,6 @@ static void conflict_rename_rename_2(str
free(new_path1);
}
-/* General TODO: get rid of all the debug messages */
static int process_renames(struct path_list *a_renames,
struct path_list *b_renames,
const char *a_branch,
--
1.4.2.rc2.g6a4e
^ 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