* 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
* [PATCH 3/6] merge-recur: Remove dead code
From: Johannes Schindelin @ 2006-07-27 17:13 UTC (permalink / raw)
To: git, junkio
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
merge-recursive.c | 22 ----------------------
1 files changed, 0 insertions(+), 22 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 8d9451f..9a86cdb 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -197,11 +197,6 @@ static int index_only = 0;
*/
static int git_read_tree(const struct tree *tree)
{
-#if 0
- fprintf(stderr, "GIT_INDEX_FILE='%s' git-read-tree %s\n",
- getenv("GIT_INDEX_FILE"),
- sha1_to_hex(tree->object.sha1));
-#endif
int rc;
const char *argv[] = { "git-read-tree", NULL, NULL, };
if (cache_dirty)
@@ -219,14 +214,6 @@ static int git_merge_trees(const char *u
struct tree *head,
struct tree *merge)
{
-#if 0
- fprintf(stderr, "GIT_INDEX_FILE='%s' git-read-tree %s -m %s %s %s\n",
- getenv("GIT_INDEX_FILE"),
- update_arg,
- sha1_to_hex(common->object.sha1),
- sha1_to_hex(head->object.sha1),
- sha1_to_hex(merge->object.sha1));
-#endif
int rc;
const char *argv[] = {
"git-read-tree", NULL, "-m", NULL, NULL, NULL,
@@ -247,10 +234,6 @@ #endif
*/
static struct tree *git_write_tree(void)
{
-#if 0
- fprintf(stderr, "GIT_INDEX_FILE='%s' git-write-tree\n",
- getenv("GIT_INDEX_FILE"));
-#endif
FILE *fp;
int rc;
char buf[41];
@@ -672,11 +655,6 @@ static struct merge_file_info merge_file
argv[6] = lb = strdup(mkpath("%s/%s", branch2Name, b->path));
argv[4] = lo = strdup(mkpath("orig/%s", o->path));
-#if 0
- printf("%s %s %s %s %s %s %s %s %s %s\n",
- argv[0], argv[1], argv[2], argv[3], argv[4],
- argv[5], argv[6], argv[7], argv[8], argv[9]);
-#endif
code = run_command_v(10, argv);
free(la);
--
1.4.2.rc2.g6a4e
^ permalink raw reply related
* [PATCH 4/6] merge-recur: Fix compiler warning with -pedantic
From: Johannes Schindelin @ 2006-07-27 17:13 UTC (permalink / raw)
To: git, junkio
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
merge-recursive.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 9a86cdb..645ef8c 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -642,7 +642,7 @@ static struct merge_file_info merge_file
char src2[PATH_MAX];
const char *argv[] = {
"merge", "-L", NULL, "-L", NULL, "-L", NULL,
- src1, orig, src2,
+ NULL, NULL, NULL,
NULL
};
char *la, *lb, *lo;
@@ -654,6 +654,9 @@ static struct merge_file_info merge_file
argv[2] = la = strdup(mkpath("%s/%s", branch1Name, a->path));
argv[6] = lb = strdup(mkpath("%s/%s", branch2Name, b->path));
argv[4] = lo = strdup(mkpath("orig/%s", o->path));
+ argv[7] = src1;
+ argv[8] = orig;
+ argv[9] = src2,
code = run_command_v(10, argv);
--
1.4.2.rc2.g6a4e
^ permalink raw reply related
* [PATCH 5/6] merge-recur: Cleanup last mixedCase variables...
From: Johannes Schindelin @ 2006-07-27 17:13 UTC (permalink / raw)
To: git, junkio
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
merge-recursive.c | 46 +++++++++++++++++++++++-----------------------
1 files changed, 23 insertions(+), 23 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 645ef8c..b0f2ecc 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -609,7 +609,7 @@ static char *git_unpack_file(const unsig
static struct merge_file_info merge_file(struct diff_filespec *o,
struct diff_filespec *a, struct diff_filespec *b,
- const char *branch1Name, const char *branch2Name)
+ const char *branch1, const char *branch2)
{
struct merge_file_info result;
result.merge = 0;
@@ -651,8 +651,8 @@ static struct merge_file_info merge_file
git_unpack_file(a->sha1, src1);
git_unpack_file(b->sha1, src2);
- argv[2] = la = strdup(mkpath("%s/%s", branch1Name, a->path));
- argv[6] = lb = strdup(mkpath("%s/%s", branch2Name, b->path));
+ argv[2] = la = strdup(mkpath("%s/%s", branch1, a->path));
+ argv[6] = lb = strdup(mkpath("%s/%s", branch2, b->path));
argv[4] = lo = strdup(mkpath("orig/%s", o->path));
argv[7] = src1;
argv[8] = orig;
@@ -966,8 +966,8 @@ static unsigned char *has_sha(const unsi
/* Per entry merge function */
static int process_entry(const char *path, struct stage_data *entry,
- const char *branch1Name,
- const char *branch2Name)
+ const char *branch1,
+ const char *branch2)
{
/*
printf("processing entry, clean cache: %s\n", index_only ? "yes": "no");
@@ -997,14 +997,14 @@ static int process_entry(const char *pat
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);
+ path, branch1,
+ branch2, branch2, 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);
+ path, branch2,
+ branch1, branch1, path);
update_file(0, a_sha, a_mode, path);
}
}
@@ -1019,14 +1019,14 @@ static int process_entry(const char *pat
const char *conf;
if (a_sha) {
- add_branch = branch1Name;
- other_branch = branch2Name;
+ add_branch = branch1;
+ other_branch = branch2;
mode = a_mode;
sha = a_sha;
conf = "file/directory";
} else {
- add_branch = branch2Name;
- other_branch = branch1Name;
+ add_branch = branch2;
+ other_branch = branch1;
mode = b_mode;
sha = b_sha;
conf = "directory/file";
@@ -1060,8 +1060,8 @@ static int process_entry(const char *pat
} else {
const char *new_path1, *new_path2;
clean_merge = 0;
- new_path1 = unique_path(path, branch1Name);
- new_path2 = unique_path(path, branch2Name);
+ new_path1 = unique_path(path, branch1);
+ new_path2 = unique_path(path, branch2);
output("CONFLICT (add/add): File %s added non-identically "
"in both branches. Adding as %s and %s instead.",
path, new_path1, new_path2);
@@ -1085,7 +1085,7 @@ static int process_entry(const char *pat
b.mode = b_mode;
mfi = merge_file(&o, &a, &b,
- branch1Name, branch2Name);
+ branch1, branch2);
if (mfi.clean)
update_file(1, mfi.sha, mfi.mode, path);
@@ -1111,8 +1111,8 @@ static int process_entry(const char *pat
static int merge_trees(struct tree *head,
struct tree *merge,
struct tree *common,
- const char *branch1Name,
- const char *branch2Name,
+ const char *branch1,
+ const char *branch2,
struct tree **result)
{
int code, clean;
@@ -1143,13 +1143,13 @@ static int merge_trees(struct tree *head
re_head = get_renames(head, common, head, merge, entries);
re_merge = get_renames(merge, common, head, merge, entries);
clean = process_renames(re_head, re_merge,
- branch1Name, branch2Name);
+ branch1, branch2);
for (i = 0; i < entries->nr; i++) {
const char *path = entries->items[i].path;
struct stage_data *e = entries->items[i].util;
if (e->processed)
continue;
- if (!process_entry(path, e, branch1Name, branch2Name))
+ if (!process_entry(path, e, branch1, branch2))
clean = 0;
}
@@ -1179,8 +1179,8 @@ static int merge_trees(struct tree *head
static
int merge(struct commit *h1,
struct commit *h2,
- const char *branch1Name,
- const char *branch2Name,
+ const char *branch1,
+ const char *branch2,
int call_depth /* =0 */,
struct commit *ancestor /* =None */,
struct commit **result)
@@ -1236,7 +1236,7 @@ int merge(struct commit *h1,
}
clean = merge_trees(h1->tree, h2->tree, merged_common_ancestors->tree,
- branch1Name, branch2Name, &mrtree);
+ branch1, branch2, &mrtree);
if (!ancestor && (clean || index_only)) {
*result = make_virtual_commit(mrtree, "merged tree");
--
1.4.2.rc2.g6a4e
^ permalink raw reply related
* [PATCH 6/6] merge-recur: Explain why sha_eq() and struct stage_data cannot go
From: Johannes Schindelin @ 2006-07-27 17:14 UTC (permalink / raw)
To: git, junkio
There were two TODOs to remove sha_eq() and to convert users of
struct stage_data to active_cache users, but this is not possible.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
---
merge-recursive.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index b0f2ecc..cb21bc5 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -47,8 +47,8 @@ static struct commit *make_virtual_commi
}
/*
- * TODO: we should not have to copy the SHA1s around, but rather reference
- * them. That way, sha_eq() is just sha1 == sha2.
+ * Since we use get_tree_entry(), which does not put the read object into
+ * the object pool, we cannot rely on a == b.
*/
static int sha_eq(const unsigned char *a, const unsigned char *b)
{
@@ -58,9 +58,8 @@ static int sha_eq(const unsigned char *a
}
/*
- * TODO: check if we can just reuse the active_cache structure: it is already
- * sorted (by name, stage).
- * Only problem: do not write it when flushing the cache.
+ * Since we want to write the index eventually, we cannot reuse the index
+ * for these (temporary) data.
*/
struct stage_data
{
--
1.4.2.rc2.g6a4e
^ permalink raw reply related
* Re: Git clone stalls at a read(3, ...) saw using strace
From: André Goddard Rosa @ 2006-07-27 17:17 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Pavel Roskin, Git Mailing List
In-Reply-To: <Pine.LNX.4.64.0607270947540.4168@g5.osdl.org>
On 7/27/06, Linus Torvalds <torvalds@osdl.org> wrote:
> 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.
Great! Thank you so much, I will try to contact Montavista.
Best regards,
--
[]s,
André Goddard
^ permalink raw reply
* Windows port, was Re: Projects using git now
From: Johannes Schindelin @ 2006-07-27 17:18 UTC (permalink / raw)
To: Jakub Narebski; +Cc: git
In-Reply-To: <eaas2o$bj8$1@sea.gmane.org>
Hi,
On Thu, 27 Jul 2006, Jakub Narebski wrote:
> 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.
I started playing around with a MinGW32 port, and it already was able to
show a git-log. All the network things, and all the exec things are
non-working.
If anybody wants to play with it, I'll send a patch against
tags/v1.4.1-rc1~37.
Ciao,
Dscho
^ permalink raw reply
* Re: Licensing and the library version of git
From: Petr Baudis @ 2006-07-27 17:20 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Jon Smirl, git
In-Reply-To: <Pine.LNX.4.63.0607271602060.29667@wbgn013.biozentrum.uni-wuerzburg.de>
Hi,
Dear diary, on Thu, Jul 27, 2006 at 04:04:11PM CEST, I got a letter
where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...
> On Thu, 27 Jul 2006, Jon Smirl wrote:
>
> > On 7/27/06, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote:
> > > ... 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).
I concur. IANAL but from my understanding is that GPL requires just
the work and its derivatives to be free. So it's a matter of the
derivatives chain; if you write the plugin, does Eclipse become its
derivative work? Well, the derivation went the other way around, so
the plugin is derivative work of Git and possibly Eclipse. So AFAICS the
only possible clash that _might_ happen is if Git requires CVS and
Eclipse requires some other licence.
Too bad for Eclipse's GPL-incompatible viral licence...
--
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
* Re: Licensing and the library version of git
From: Petr Baudis @ 2006-07-27 17:23 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: Jon Smirl, git
In-Reply-To: <20060727172047.GB13776@pasky.or.cz>
Dear diary, on Thu, Jul 27, 2006 at 07:20:47PM CEST, I got a letter
where Petr Baudis <pasky@suse.cz> said that...
> only possible clash that _might_ happen is if Git requires CVS and
^^^
Er, GPL! *blush*
That said, Git still requires RCS for the merge operation. Any plans
to finally switch to diff3 and toss out another useless dependency?
*blush for shameless plug*
--
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
* Re: Git clone stalls at a read(3, ...) saw using strace
From: André Goddard Rosa @ 2006-07-27 17:25 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Pavel Roskin, Git Mailing List
In-Reply-To: <b8bf37780607271017p22fa908bt82a564a4a1a15a79@mail.gmail.com>
On 7/27/06, André Goddard Rosa <andre.goddard@gmail.com> wrote:
> On 7/27/06, Linus Torvalds <torvalds@osdl.org> wrote:
> > 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.
>
> Great! Thank you so much, I will try to contact Montavista.
Hi, Linus!
The problem happened again, and it stalls AFAICS.
Can you reproduce there?
# git clone git://source.mvista.com/git/linux-davinci-2.6.git
Here I have a constant 55 kbps and it stalls with about 117Mb downloaded.
I will try to contact Montavista.
Thanks you so much for the support,
--
[]s,
André Goddard
^ permalink raw reply
* Brand new Enhanced male power and unlimited prowess with your girl The best products for the winning guys
From: Richie @ 2006-07-27 16:27 UTC (permalink / raw)
To: glenda
Dear client.
Boost your manhood to astonishing levels Everything a real man would ever need.Make your girlfriend or wife speechless with increased hardness, richer orgsms and more power in bed
Masculine performance has never been so easy to increase with these products
See our shop: http://www.isohyetab.com
Richie Rossi
Elementary sartorial techniques initially applied obviate the need for repetitive similar actions to the square of three.Youth is wasted on the young A faithful friend is a medicine for life.
Every path has its puddle. Love is the strangest thing
^ permalink raw reply
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