Git development
 help / color / mirror / Atom feed
* [PATCH] git: fix gcc4 warnings
From: Mika Kukkonen @ 2005-07-03 20:32 UTC (permalink / raw)
  To: torvalds; +Cc: git

Here is a few trivial fixes to git about things that gcc4 complains about.

Signed-off-by: Mika Kukkonen <mikukkon@iki.fi>

diffstat:
 git/send-pack.c |    2 +-
 git/sha1_file.c |    4 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

Index: git/send-pack.c
===================================================================
--- git.orig/send-pack.c
+++ git/send-pack.c
@@ -93,7 +93,7 @@ static void rev_list(int fd, struct ref 
 	exec_rev_list(refs);
 }
 
-static int pack_objects(int fd, struct ref *refs)
+static void pack_objects(int fd, struct ref *refs)
 {
 	pid_t rev_list_pid;
 
Index: git/sha1_file.c
===================================================================
--- git.orig/sha1_file.c
+++ git/sha1_file.c
@@ -384,8 +384,8 @@ struct packed_git *add_packed_git(char *
 {
 	struct stat st;
 	struct packed_git *p;
-	unsigned long idx_size;
-	void *idx_map;
+	unsigned long idx_size = 0;
+	void *idx_map = NULL;

 	if (check_packed_git_idx(path, &idx_size, &idx_map))
 		return NULL;
@@ -857,7 +857,7 @@ static void *unpack_non_delta_entry(unsi
 {
 	int st;
 	z_stream stream;
-	char *buffer;
+	unsigned char *buffer;
 
 	buffer = xmalloc(size + 1);
 	buffer[size] = 0;
@@ -949,7 +949,7 @@ int nth_packed_object_sha1(const struct 
 int find_pack_entry_one(const unsigned char *sha1,
 			struct pack_entry *e, struct packed_git *p)
 {
-	int *level1_ofs = p->index_base;
+	unsigned int *level1_ofs = p->index_base;
 	int hi = ntohl(level1_ofs[*sha1]);
 	int lo = ((*sha1 == 0x0) ? 0 : ntohl(level1_ofs[*sha1 - 1]));
 	void *index = p->index_base + 256;

^ permalink raw reply

* Re: Stacked GIT 0.3 (now more Quilt-like)
From: Catalin Marinas @ 2005-07-03 21:14 UTC (permalink / raw)
  To: Peter Osterlund; +Cc: GIT
In-Reply-To: <m3oe9k6p40.fsf@telia.com>

On Sun, 2005-07-03 at 14:38 +0200, Peter Osterlund wrote:
> Catalin Marinas <catalin.marinas@gmail.com> writes:
> > I know that using -A gives a more detailed output in case of a conflict.
> > The problem is that you will get a conflict even if the changes are
> > identical, making it impossible to detect when a patch was merged
> > upstream.
> 
> OK, I see. How about using wiggle instead?
> 
>         http://cgi.cse.unsw.edu.au/~neilb/source/wiggle/
> 
> That's what patch-utils uses if you run "pushpatch -m". wiggle is also
> a lot smarter than diff3, so there will be fewer cases that result in
> a conflict. Maybe a parameter to "stg push" could enable wiggle mode.

I haven't used wiggle before but I will give it a try (though I prefer
such a tool not to be too smart since it might make mistakes). Anyway, I
will make this configurable, i.e. you could put something like below in
the .stgitrc file:

merger = 'diff3 -m -E %(branch1)s %(ancestor)s %(branch2)s'

or

merger = 'wiggle -m %(branch1)s %(ancestor)s %(branch2)s'

> Is there a way in StGIT to undo a push that results in a large mess of
> conflicts?

Good point. No, there isn't yet. I will think about an undo command. At
the moment, the old top and bottom ids of a patch are saved so that the
patch before the merge can be retrieved but there isn't any command to
make use of them.

--
Catalin

^ permalink raw reply

* Re: [PATCH] Cogito: Use git-rev-parse instead of cg-Xnormid.
From: Petr Baudis @ 2005-07-03 22:31 UTC (permalink / raw)
  To: Brian Gerst, git
In-Reply-To: <20050703154049.GD18608MdfPADPa@garage.linux.student.kuleuven.ac.be>

Dear diary, on Sun, Jul 03, 2005 at 05:40:49PM CEST, I got a letter
where Sven Verdoolaege <skimo@kotnet.org> told me that...
> On Sun, Jul 03, 2005 at 05:41:27PM +0200, Petr Baudis wrote:
> > That's right. Well, for everything but the short id matching we could
> > just check the ID validity by git-rev-parse instead of peeking into
> > the object store - I just did that. 
> 
> Why not use it to actually resolve ids ?
> I really miss the '^' parent notation in cogito.

I've decided to go the less troublesome way and just teach cg-Xnormid
about the ^ prefix. ;-)

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
<Espy> be careful, some twit might quote you out of context..

^ permalink raw reply

* Re: Tags
From: Kevin Smith @ 2005-07-03 22:34 UTC (permalink / raw)
  To: Dan Holmsand; +Cc: Git Mailing List
In-Reply-To: <42C72B83.6030904@gmail.com>

Dan Holmsand wrote:
> So why not add tags to the branch itself?
> 
> It should be pretty straightforward: just make git look for tag refs in, 
> say, a .gittags tree in the current HEAD. The whole thing would pretty 
> much as if you've symlinked .git/refs/tags to .gittags in the current 
> working tree, except that tag refs would have to be read directly from 
> the repository.
> 
> That way, tag refs could be handled pretty much just like any other 
> git-managed file: they can be added, deleted, changed, merged, 
> committed, etc. We could track their history, and see who tagged what 
> and when.

Sounds like the way mercurial handles tags. It really seemed weird to me 
at first, but the more I think about it, the more it makes sense. Even 
more so after reading this thread :-)

   http://www.serpentine.com/mercurial/index.cgi?Tag

Kevin

^ permalink raw reply

* Re: [PATCH] Cogito: Use git-rev-parse instead of cg-Xnormid.
From: Linus Torvalds @ 2005-07-03 22:40 UTC (permalink / raw)
  To: Petr Baudis; +Cc: Brian Gerst, git
In-Reply-To: <20050703154127.GA31848@pasky.ji.cz>



On Sun, 3 Jul 2005, Petr Baudis wrote:
> 
> That's right. Well, for everything but the short id matching we could
> just check the ID validity by git-rev-parse instead of peeking into
> the object store - I just did that.

What's the format of the short ID? Minimum 6 characters of the SHA1 or
something?

Pack-files in many ways should be even easier to look up the ID in, since
the pack-file index has all the SHA1's for that pack file listed in sorted
order, so it should be fairly easy to just look it up based on the first
few bytes.. If somebody sends me a patch, that should be fine.

> > The only thing missing is the short id matching.
> 
> Yes, but as I said, I think it's very important to have. BTW, another
> cool thing cg-Xnormid does and git-rev-parse does not: time specifiers.
> E.g. you could specify revisions as "2 days ago" or so, very useful for
> cg-log, cg-diff and such.

That is indeed something that seems to make more sense in cg-Xnormid.

		Linus

^ permalink raw reply

* "Incremental packs"
From: Linus Torvalds @ 2005-07-03 23:00 UTC (permalink / raw)
  To: Git Mailing List; +Cc: Peter Anvin


Ok,
 I've changed things around a bit to make it much easier to create various 
incremental packs. It's still not the "just append everything" thing that 
Peter envisions, but it should hopefully be fairly usable in practice, and 
might even be worth trying on kernel.org now.

One big user-visible change: in order to allow multiple packs, where the 
pack-name itself does not cause clashes when you rsync them between 
repositories, I changed git-pack-objects to add the SHA1 of all the 
objects added to the pack to the name.

So when you do

	git-pack-objects pack

it will create two files: "pack-xyz.idx" and "pack-xyz.pack", where the 
"xyz" is the SHA1 of all the object names that were added to the pack. The 
command also writes that SHA1 to its standard output, so you can do

	packname=$(git-rev-list ... | git-pack-objects pack)

and "packname" will contain the part you're missing (ie then you can look
at "pack-$packname.idx" to see the index).

I've also added flags to make it possible to easily do "incremental 
packs", which just pack the stuff that wasn't already packed. So 
"git-rev-list --unpacked" will consider any packed commit to be 
un-interesting, and "git-pack-objects --incremental" will similarly just 
ignore any objects that already exist in a pack.

This, together with "git-rev-parse --all", which shows all the current 
refs, makes it possible to do "git repack", which basically boils down to

	packname=$(git-rev-list --unpacked --objects $(git-rev-parse --all) |
		git-pack-objects --non-empty --incremental .tmp-pack)

where "non-empty" means that if the list of objects is empty, we won't
create a pack at all (and git-pack-objects will not write any SHA1 to its 
stdout, so "packname" will be empty).

Look at "git repack" for all the small details if you care, but basically 
it's designed so that you can run "git repack" on a git archive every 
week, and it will create pack-files of any new data.

Now, once you actually trust the pack-files, you can then do

	git-prune-packed

which will remove all unpacked objects that are available in a pack. 
CAREFUL! Only do this once you trust the pack! "git repack" will not do 
this on its own.

The theory behind all this is that since the pack-files are now named 
according to their contents, they are also distributable exactly the same 
way the normal object files are, so you can still use "rsync" if you 
really want to distribute the resulting mess. A git-aware distribution is 
obviously preferable, but at least rsync won't corrupt any archive, and 
this allows you to get rid of the "millions of small files" effect.

It might be worth trying out on kernel.org. Peter, what do you think? 
Doing the initial "git repack" is pretty expensive, but then the weekly 
incremental packs should be pretty cheap. And it really should not be done 
very often, because then the pack-files end up just being many and small, 
which is what we're trying to avoid in the first place.

Oh, one (obvious) detail: in order for webgit to continue working,
www.kernel.org needs to have a recent enough git, of course.

		Linus

^ permalink raw reply

* Re: [PATCH] Cogito: Use git-rev-parse instead of cg-Xnormid.
From: Petr Baudis @ 2005-07-03 23:03 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Brian Gerst, git
In-Reply-To: <Pine.LNX.4.58.0507031535420.3570@g5.osdl.org>

Dear diary, on Mon, Jul 04, 2005 at 12:40:52AM CEST, I got a letter
where Linus Torvalds <torvalds@osdl.org> told me that...
> 
> 
> On Sun, 3 Jul 2005, Petr Baudis wrote:
> > 
> > That's right. Well, for everything but the short id matching we could
> > just check the ID validity by git-rev-parse instead of peeking into
> > the object store - I just did that.
> 
> What's the format of the short ID? Minimum 6 characters of the SHA1 or
> something?
> 
> Pack-files in many ways should be even easier to look up the ID in, since
> the pack-file index has all the SHA1's for that pack file listed in sorted
> order, so it should be fairly easy to just look it up based on the first
> few bytes.. If somebody sends me a patch, that should be fine.

Actually, the minimum is 4 characters, but that shouldn't be much of an
issue. Cogito's behaviour is to raise an error in case of multiple
matches; but that could be controlled by a switch too...

	bash$ complete -C git-rev-parse git* cg*


I will cook up a patch in a day or two if noone outruns me.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
<Espy> be careful, some twit might quote you out of context..

^ permalink raw reply

* Re: [PATCH] cvsimport: rewritten in Perl
From: Sven Verdoolaege @ 2005-07-03 23:03 UTC (permalink / raw)
  To: Matthias Urlichs; +Cc: git
In-Reply-To: <20050630152125.GO10850@kiste.smurf.noris.de>

On Thu, Jun 30, 2005 at 05:21:25PM +0200, Matthias Urlichs wrote:
> Sven Verdoolaege:
> > Could you try to make the resulting repository compatible
> > with a repository generated with the old cvs2git ?
> > 
> I believe I did... at least it worked that way two days ago. ;-)
> 

I've found another difference.

On -p -z,60 -d :ext:anoncvs@savannah.gnu.org:/cvsroot/libtool libtool
on the gord branch,
the old cvs2git would create

[..]
commit 9d829ba90211956c53ebd40d2ba5daa454bedf03
tree e5aab59ed74c6e9fa1686dd914e2c7f7526f3bb6
parent 22acdc03db3de37ce19fac68babc1f2ec0011a42
author gord <gord> Tue, 01 Apr 1997 18:29:23 +0000
committer gord <gord> Tue, 01 Apr 1997 18:29:23 +0000

    *** empty log message ***

commit 22acdc03db3de37ce19fac68babc1f2ec0011a42
tree 4f8d0cc71683897d1332b485e59d164ff6a233c2
parent 27236f713eec57889949b0498cfaf446735b670d
author gord <gord> Tue, 01 Apr 1997 18:29:23 +0000
committer gord <gord> Tue, 01 Apr 1997 18:29:23 +0000


[..]
whereas your script creates:

[..]
commit f9450d4e45bdd760183383a4f698a70136e17f03
tree e5aab59ed74c6e9fa1686dd914e2c7f7526f3bb6
parent a8b919fa4784e5845f7cf61f53251804945c1b35
author gord <gord> Tue, 01 Apr 1997 18:29:23 +0000
committer gord <gord> Tue, 01 Apr 1997 18:29:23 +0000


commit a8b919fa4784e5845f7cf61f53251804945c1b35
tree b82881ae63c0cef645cd2d50050d2961d2c8871d
parent 27236f713eec57889949b0498cfaf446735b670d
author gord <gord> Tue, 01 Apr 1997 18:29:23 +0000
committer gord <gord> Tue, 01 Apr 1997 18:29:23 +0000

    *** empty log message ***

[..]

Note how the patchsets with the same date have somehow
been reversed.  Any ideas ?

I've also found another typo in your script; see my repo.

skimo

^ permalink raw reply

* [ANNOUNCE] Cogito-0.12
From: Petr Baudis @ 2005-07-03 23:46 UTC (permalink / raw)
  To: git

  Hello,

  I'm happy to announce the release of the 0.12 version of the Cogito
SCM-like layer over Linus' GIT tree history storage tool. Get it at

	http://www.kernel.org/pub/software/scm/cogito/

or cg-update if you have an older version cloned.

  I wanted to release it later with more cool features, but after all
releasing often is good and people will get to test things more, and
I wanted to make it possible for kernel.org to upgrade to newer RPM.
But it may not be as stable as I'd wish and may have some rough edges,
so be warned.

  This release contains the latest stuff from Linus, with all the
packing stuff and everything. Other things include heaps of bugfixes,
enhanced options parsing, ~/.cgrc support, cg-push, real cg-tag, and
plenty of smaller but nice stuff. And more to come in next days!

  About cg-push, it:

  (i) works only locally or over git+ssh branches

  (ii) the head updated on the other side must be 'master' too
	(high priority to fix)

  (iii) the head updated on the other side is re-created, thus losing
	all attributes (ownership, permissions)
	(high priority to fix)

  (iv) won't update the remote working tree if there is any associated
	with the repository - do cg-cancel to catch up, but that will
	lose any local changes you did (note that I plan to rename
	cg-cancel to cg-reset)

  Also, I've deprecated rsync, as I explained in another mail. Use
cg-branch-chg to change the branch URLs to some more sensible scheme -
most likely HTTP, or SSH if you want to push as well.

  Have fun,

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
<Espy> be careful, some twit might quote you out of context..

^ permalink raw reply

* [PATCH] enum for diff status
From: Pavel Roskin @ 2005-07-04  1:18 UTC (permalink / raw)
  To: git

Hello!

Readability of the sources could be improved by replacing one-char diff
status with more verbose keywords.  This patch converts diff status to
enum.

Signed-off-by: Pavel Roskin <proski@gnu.org>

diff --git a/diff-helper.c b/diff-helper.c
--- a/diff-helper.c
+++ b/diff-helper.c
@@ -54,7 +54,8 @@ int main(int ac, const char **av) {
 		unsigned old_mode, new_mode;
 		unsigned char old_sha1[20], new_sha1[20];
 		char old_path[PATH_MAX];
-		int status, score, two_paths;
+		enum diff_status status;
+		int score, two_paths;
 		char new_path[PATH_MAX];
 
 		int ch;
@@ -94,7 +95,8 @@ int main(int ac, const char **av) {
 			if (!strchr("MCRNDU", status))
 				break;
 			two_paths = score = 0;
-			if (status == 'R' || status == 'C')
+			if (status == DIFF_STATUS_RENAMED ||
+			    status == DIFF_STATUS_COPIED)
 				two_paths = 1;
 
 			/* pick up score if exists */
diff --git a/diff.c b/diff.c
--- a/diff.c
+++ b/diff.c
@@ -652,7 +652,7 @@ static void run_diff(struct diff_filepai
 	other = (strcmp(name, p->two->path) ? p->two->path : NULL);
 	one = p->one; two = p->two;
 	switch (p->status) {
-	case 'C':
+	case DIFF_STATUS_COPIED:
 		sprintf(msg_,
 			"similarity index %d%%\n"
 			"copy from %s\n"
@@ -661,7 +661,7 @@ static void run_diff(struct diff_filepai
 			name, other);
 		xfrm_msg = msg_;
 		break;
-	case 'R':
+	case DIFF_STATUS_RENAMED:
 		sprintf(msg_,
 			"similarity index %d%%\n"
 			"rename from %s\n"
@@ -670,7 +670,7 @@ static void run_diff(struct diff_filepai
 			name, other);
 		xfrm_msg = msg_;
 		break;
-	case 'M':
+	case DIFF_STATUS_MODIFIED:
 		if (p->score) {
 			sprintf(msg_,
 				"dissimilarity index %d%%",
@@ -792,7 +792,7 @@ struct diff_filepair *diff_queue(struct 
 	dp->one = one;
 	dp->two = two;
 	dp->score = 0;
-	dp->status = 0;
+	dp->status = DIFF_STATUS_UNKNOWN;
 	dp->source_stays = 0;
 	dp->broken_pair = 0;
 	diff_q(queue, dp);
@@ -831,10 +831,12 @@ static void diff_flush_raw(struct diff_f
 		status[1] = 0;
 	}
 	switch (p->status) {
-	case 'C': case 'R':
+	case DIFF_STATUS_COPIED:
+	case DIFF_STATUS_RENAMED:
 		two_paths = 1;
 		break;
-	case 'N': case 'D':
+	case DIFF_STATUS_NEW:
+	case DIFF_STATUS_DELETED:
 		two_paths = 0;
 		break;
 	default:
@@ -955,15 +957,15 @@ static void diff_resolve_rename_copy(voi
 
 	for (i = 0; i < q->nr; i++) {
 		p = q->queue[i];
-		p->status = 0; /* undecided */
+		p->status = DIFF_STATUS_UNKNOWN;
 		if (DIFF_PAIR_UNMERGED(p))
-			p->status = 'U';
+			p->status = DIFF_STATUS_UNMERGED;
 		else if (!DIFF_FILE_VALID(p->one))
-			p->status = 'N';
+			p->status = DIFF_STATUS_NEW;
 		else if (!DIFF_FILE_VALID(p->two))
-			p->status = 'D';
+			p->status = DIFF_STATUS_DELETED;
 		else if (DIFF_PAIR_TYPE_CHANGED(p))
-			p->status = 'T';
+			p->status = DIFF_STATUS_TYPE_CHANGED;
 
 		/* from this point on, we are dealing with a pair
 		 * whose both sides are valid and of the same type, i.e.
@@ -971,7 +973,7 @@ static void diff_resolve_rename_copy(voi
 		 */
 		else if (DIFF_PAIR_RENAME(p)) {
 			if (p->source_stays) {
-				p->status = 'C';
+				p->status = DIFF_STATUS_COPIED;
 				continue;
 			}
 			/* See if there is some other filepair that
@@ -985,22 +987,22 @@ static void diff_resolve_rename_copy(voi
 				if (!DIFF_PAIR_RENAME(pp))
 					continue; /* not a rename/copy */
 				/* pp is a rename/copy from the same source */
-				p->status = 'C';
+				p->status = DIFF_STATUS_COPIED;
 				break;
 			}
 			if (!p->status)
-				p->status = 'R';
+				p->status = DIFF_STATUS_RENAMED;
 		}
 		else if (memcmp(p->one->sha1, p->two->sha1, 20) ||
 			 p->one->mode != p->two->mode)
-			p->status = 'M';
+			p->status = DIFF_STATUS_MODIFIED;
 		else {
 			/* This is a "no-change" entry and should not
 			 * happen anymore, but prepare for broken callers.
 			 */
 			error("feeding unmodified %s to diffcore",
 			      p->one->path);
-			p->status = 'X';
+			p->status = DIFF_STATUS_UNCHANGED;
 		}
 	}
 	diff_debug_queue("resolve-rename-copy done", q);
@@ -1019,9 +1021,9 @@ void diff_flush(int diff_output_style)
 	for (i = 0; i < q->nr; i++) {
 		struct diff_filepair *p = q->queue[i];
 		if ((diff_output_style == DIFF_FORMAT_NO_OUTPUT) ||
-		    (p->status == 'X'))
+		    (p->status == DIFF_STATUS_UNCHANGED))
 			continue;
-		if (p->status == 0)
+		if (p->status == DIFF_STATUS_UNKNOWN)
 			die("internal error in diff-resolve-rename-copy");
 		switch (diff_output_style) {
 		case DIFF_FORMAT_PATCH:
@@ -1057,10 +1059,11 @@ static void diffcore_apply_filter(const 
 		int found;
 		for (i = found = 0; !found && i < q->nr; i++) {
 			struct diff_filepair *p = q->queue[i];
-			if (((p->status == 'M') &&
+			if (((p->status == DIFF_STATUS_MODIFIED) &&
 			     ((p->score && strchr(filter, 'B')) ||
 			      (!p->score && strchr(filter, 'M')))) ||
-			    ((p->status != 'M') && strchr(filter, p->status)))
+			    ((p->status != DIFF_STATUS_MODIFIED) &&
+			     strchr(filter, p->status)))
 				found++;
 		}
 		if (found)
@@ -1078,10 +1081,11 @@ static void diffcore_apply_filter(const 
 		/* Only the matching ones */
 		for (i = 0; i < q->nr; i++) {
 			struct diff_filepair *p = q->queue[i];
-			if (((p->status == 'M') &&
+			if (((p->status == DIFF_STATUS_MODIFIED) &&
 			     ((p->score && strchr(filter, 'B')) ||
 			      (!p->score && strchr(filter, 'M')))) ||
-			    ((p->status != 'M') && strchr(filter, p->status)))
+			    ((p->status != DIFF_STATUS_MODIFIED) &&
+			     strchr(filter, p->status)))
 				diff_q(&outq, p);
 			else
 				diff_free_filepair(p);
@@ -1170,7 +1174,7 @@ void diff_helper_input(unsigned old_mode
 		       const unsigned char *old_sha1,
 		       const unsigned char *new_sha1,
 		       const char *old_path,
-		       int status,
+		       enum diff_status status,
 		       int score,
 		       const char *new_path)
 {
diff --git a/diff.h b/diff.h
--- a/diff.h
+++ b/diff.h
@@ -8,6 +8,18 @@
 	(S_ISREG(mode) ? (S_IFREG | ce_permissions(mode)) : \
 	S_ISLNK(mode) ? S_IFLNK : S_IFDIR)
 
+enum diff_status {
+	DIFF_STATUS_UNKNOWN = 0,
+	DIFF_STATUS_COPIED = 'C',
+	DIFF_STATUS_DELETED = 'D',
+	DIFF_STATUS_MODIFIED = 'M',
+	DIFF_STATUS_NEW = 'N',
+	DIFF_STATUS_RENAMED = 'R',
+	DIFF_STATUS_TYPE_CHANGED = 'T',
+	DIFF_STATUS_UNMERGED = 'U',
+	DIFF_STATUS_UNCHANGED = 'X',
+};
+
 extern void diff_addremove(int addremove,
 			   unsigned mode,
 			   const unsigned char *sha1,
@@ -24,7 +36,7 @@ extern void diff_helper_input(unsigned m
 			      const unsigned char *sha1,
 			      const unsigned char *sha2,
 			      const char *path1,
-			      int status,
+			      enum diff_status status,
 			      int score,
 			      const char *path2);
 
diff --git a/diffcore.h b/diffcore.h
--- a/diffcore.h
+++ b/diffcore.h
@@ -49,7 +49,7 @@ struct diff_filepair {
 	struct diff_filespec *one;
 	struct diff_filespec *two;
 	unsigned short int score;
-	char status; /* M C R N D U (see Documentation/diff-format.txt) */
+	enum diff_status status; /* (see Documentation/diff-format.txt) */
 	unsigned source_stays : 1; /* all of R/C are copies */
 	unsigned broken_pair : 1;
 };


-- 
Regards,
Pavel Roskin

^ permalink raw reply

* Re: [PATCH] cvsimport: rewritten in Perl
From: Matthias Urlichs @ 2005-07-04  1:49 UTC (permalink / raw)
  To: git
In-Reply-To: <20050703230326.GF18608MdfPADPa@garage.linux.student.kuleuven.ac.be>

[-- Attachment #1: Type: text/plain, Size: 520 bytes --]

Hi,

Sven Verdoolaege:
> Note how the patchsets with the same date have somehow
> been reversed.  Any ideas ?
> 
No. I process the lines from cvsps in the order I get them...

> I've also found another typo in your script; see my repo.
> 
Thanks. I guess. ;-)

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
People who run down others are taking a roundabout way of praising themselves.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* [PATCH] Using CFLAGS on the make command line
From: Pavel Roskin @ 2005-07-04  2:06 UTC (permalink / raw)
  To: git

Hello!

This patch changes the top-level Makefile to be more compatible with
expectations of users accustomed to automake-generated makefiles.

I'm used to specifying CFLAGS after make, i.e. as an argument rather
than as an environment variable.  It doesn't work with git because
CFLAGS is modified in Makefile.

Automake and Autoconf allow CFLAGS to be fully user-serviceable.  It
defaults to something reasonable (usually "-O2 -g") that can be replaced
without breaking compilation.  Other variables such as CPPFLAGS are
recognized, but they are rarely used.

COPTS is not recognized, and I don't think it's needed in git once
CFLAGS works in the expected way.  Besides, why is -O2 in COPTS whereas
-Wall is not?

Automake-generated makefiles use the COMPILE variable to hold all
compile flags.  COMPILE is not user-serviceable.

Also, projects generated by Automake can be compiled with "make -r",
i.e. without implicit rules.  It's useful to have all rules we need
(there are just 2 of them) written explicitly so that users can
understand and modify them.  It's also needed to use COMPILE instead of
the implicit CFLAGS in the .o.c rule.

Signed-off-by: Pavel Roskin <proski@gnu.org>

diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -9,8 +9,8 @@
 # BREAK YOUR LOCAL DIFFS! show-diff and anything using it will likely randomly
 # break unless your underlying filesystem supports those sub-second times
 # (my ext3 doesn't).
-COPTS=-O2
-CFLAGS=-g $(COPTS) -Wall
+CFLAGS=-g -O2 -Wall
+COMPILE=$(CFLAGS)
 
 prefix=$(HOME)
 bin=$(prefix)/bin
@@ -82,22 +82,28 @@ else
 endif
 endif
 
-CFLAGS += '-DSHA1_HEADER=$(SHA1_HEADER)'
+COMPILE += '-DSHA1_HEADER=$(SHA1_HEADER)'
 
 $(LIB_FILE): $(LIB_OBJS)
 	$(AR) rcs $@ $(LIB_OBJS)
 
 check:
-	for i in *.c; do sparse $(CFLAGS) $(SPARSE_FLAGS) $$i; done
+	for i in *.c; do sparse $(COMPILE) $(SPARSE_FLAGS) $$i; done
 
 test-date: test-date.c date.o
-	$(CC) $(CFLAGS) -o $@ test-date.c date.o
+	$(CC) $(COMPILE) -o $@ test-date.c date.o
 
 test-delta: test-delta.c diff-delta.o patch-delta.o
-	$(CC) $(CFLAGS) -o $@ $^
+	$(CC) $(COMPILE) -o $@ $^
 
 git-%: %.c $(LIB_FILE)
-	$(CC) $(CFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
+	$(CC) $(COMPILE) -o $@ $(filter %.c,$^) $(LIBS)
+
+.c.o:
+	$(CC) -c $(COMPILE) $<
+
+.S.o:
+	$(CC) -c $(ASFLAGS) $<
 
 git-update-cache: update-cache.c
 git-diff-files: diff-files.c
@@ -172,3 +178,5 @@ clean:
 
 backup: clean
 	cd .. ; tar czvf dircache.tar.gz dir-cache
+
+.SUFFIXES: .c .o .S


-- 
Regards,
Pavel Roskin

^ permalink raw reply

* Re: Stacked GIT 0.3 (now more Quilt-like)
From: Horst von Brand @ 2005-07-04  1:10 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Peter Osterlund, GIT
In-Reply-To: <1120425269.6845.28.camel@localhost.localdomain>

Catalin Marinas <catalin.marinas@gmail.com> wrote:
> On Sun, 2005-07-03 at 14:38 +0200, Peter Osterlund wrote:
> > Catalin Marinas <catalin.marinas@gmail.com> writes:
> > > I know that using -A gives a more detailed output in case of a conflict.
> > > The problem is that you will get a conflict even if the changes are
> > > identical, making it impossible to detect when a patch was merged
> > > upstream.

> > OK, I see. How about using wiggle instead?
> > 
> >         http://cgi.cse.unsw.edu.au/~neilb/source/wiggle/

[...]

> I haven't used wiggle before but I will give it a try (though I prefer
> such a tool not to be too smart since it might make mistakes).

Last version is 0.6, released 2 years back... I'm not sure it is wise to
rely on abandonware.
-- 
Dr. Horst H. von Brand                   User #22616 counter.li.org
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

^ permalink raw reply

* [PATCH] Warning in apply.c
From: Pavel Roskin @ 2005-07-04  2:50 UTC (permalink / raw)
  To: git

Hello!

gcc 4.0.0 reports one warning while compiling git on x86_64:

gcc -g -O2 -Wall '-DSHA1_HEADER=<openssl/sha.h>' -o git-apply apply.c libgit.a -lz -lcrypto
apply.c: In function 'show_rename_copy':
apply.c:1147: warning: field precision should have type 'int', but argument 3 has type 'long int'

The fix is to cast pointer difference to int.

Signed-off-by: Pavel Roskin <proski@gnu.org>

diff --git a/apply.c b/apply.c
--- a/apply.c
+++ b/apply.c
@@ -1143,7 +1143,7 @@ static void show_rename_copy(struct patc
 	 */
 	if (old != p->old_name)
 		printf(" %s %.*s{%s => %s} (%d%%)\n", renamecopy,
-		       old - p->old_name, p->old_name,
+		       (int)(old - p->old_name), p->old_name,
 		       old, new, p->score);
 	else
 		printf(" %s %s => %s (%d%%)\n", renamecopy,


-- 
Regards,
Pavel Roskin

^ permalink raw reply

* [PATCH] Use MAP_FAILED instead of double cast
From: Pavel Roskin @ 2005-07-04  3:05 UTC (permalink / raw)
  To: git

Hello!

I have found some really ugly code to used to check the result of
mmap():

if (-1 == (int)(long)map)
	return;

Double cast almost always indicates that something fishy is going on.
Indeed, mmap() could (in theory) return 0xffffffff on a 64-bit platform,
and that would be misinterpreted as a failure.

There is a preprocessor symbol MAP_FAILED that should be used instead.
It's used already in some places, so let's use it consistently.

Signed-off-by: Pavel Roskin <proski@gnu.org>

diff --git a/diffcore-order.c b/diffcore-order.c
--- a/diffcore-order.c
+++ b/diffcore-order.c
@@ -28,7 +28,7 @@ static void prepare_order(const char *or
 	}
 	map = mmap(NULL, st.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
 	close(fd);
-	if (-1 == (int)(long)map)
+	if (map == MAP_FAILED)
 		return;
 	endp = map + st.st_size;
 	for (pass = 0; pass < 2; pass++) {
diff --git a/local-pull.c b/local-pull.c
--- a/local-pull.c
+++ b/local-pull.c
@@ -54,7 +54,7 @@ int fetch(unsigned char *sha1)
 		}
 		map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, ifd, 0);
 		close(ifd);
-		if (-1 == (int)(long)map) {
+		if (map == MAP_FAILED) {
 			fprintf(stderr, "cannot mmap %s\n", filename);
 			return -1;
 		}
diff --git a/read-cache.c b/read-cache.c
--- a/read-cache.c
+++ b/read-cache.c
@@ -376,7 +376,7 @@ int read_cache(void)
 			map = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
 	}
 	close(fd);
-	if (-1 == (int)(long)map)
+	if (map == MAP_FAILED)
 		return error("mmap failed");
 
 	hdr = map;
diff --git a/sha1_file.c b/sha1_file.c
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -507,7 +507,7 @@ static void *map_sha1_file_internal(cons
 	}
 	map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
 	close(fd);
-	if (-1 == (int)(long)map)
+	if (map == MAP_FAILED)
 		return NULL;
 	*size = st.st_size;
 	return map;
@@ -1293,7 +1293,7 @@ int index_fd(unsigned char *sha1, int fd
 	if (size)
 		buf = mmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
 	close(fd);
-	if ((int)(long)buf == -1)
+	if (buf == MAP_FAILED)
 		return -1;
 
 	ret = write_sha1_file(buf, size, "blob", sha1);


-- 
Regards,
Pavel Roskin

^ permalink raw reply

* Re: Stacked GIT 0.3 (now more Quilt-like)
From: Martin Langhoff @ 2005-07-04  6:27 UTC (permalink / raw)
  To: GIT
In-Reply-To: <1120425269.6845.28.camel@localhost.localdomain>

> > OK, I see. How about using wiggle instead?
> >
> >         http://cgi.cse.unsw.edu.au/~neilb/source/wiggle/
> >
> > That's what patch-utils uses if you run "pushpatch -m". wiggle is also
> > a lot smarter than diff3, so there will be fewer cases that result in
> > a conflict. Maybe a parameter to "stg push" could enable wiggle mode.
> 
> I haven't used wiggle before but I will give it a try (though I prefer
> such a tool not to be too smart since it might make mistakes). Anyway, I
> will make this configurable, i.e. you could put something like below in
> the .stgitrc file:

wiggle is good but it's not safe. You should definitely review the
results of a wiggle merge with extra care. It sometimes does magic and
merges the unmergeable, and sometimes it does bad, bad things.

cheers,


martin

^ permalink raw reply

* Re: [PATCH] cvsimport: rewritten in Perl
From: Sven Verdoolaege @ 2005-07-04 10:47 UTC (permalink / raw)
  To: Matthias Urlichs; +Cc: git
In-Reply-To: <20050704014948.GK29809@kiste.smurf.noris.de>

Hi,

On Mon, Jul 04, 2005 at 03:49:48AM +0200, Matthias Urlichs wrote:
> Sven Verdoolaege:
> > Note how the patchsets with the same date have somehow
> > been reversed.  Any ideas ?
> > 
> No. I process the lines from cvsps in the order I get them...
> 

Ok, I reran cvs2git and now I get the same order as with
your script.  Something must have changed in the output
of cvsps.

skimo

^ permalink raw reply

* [PATCH] git-cvsimport-script: leave working directory alone.
From: Sven Verdoolaege @ 2005-07-04 12:13 UTC (permalink / raw)
  To: Matthias Urlichs, git
In-Reply-To: <20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be>

git-cvsimport-script: leave working directory alone.

---
commit 2eb6d82eaa869a1faf4ba3326fd628f76f9f93a8
tree 3e59c8c298e51a8ae20102b4b139c84c79fa54a0
parent 866d13108e969773347828daa9b7f3476ec70cb8
author Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 00:43:26 +0200
committer Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 00:43:26 +0200

 git-cvsimport-script |   81 ++++++++++++++++++++++++++++++--------------------
 1 files changed, 48 insertions(+), 33 deletions(-)

diff --git a/git-cvsimport-script b/git-cvsimport-script
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -80,6 +80,8 @@ package CVSconn;
 # Basic CVS dialog.
 # We're only interested in connecting and downloading, so ...
 
+use File::Spec;
+use File::Temp qw(tempfile);
 use POSIX qw(strftime dup2);
 
 sub new {
@@ -231,11 +233,11 @@ sub _file {
 sub _line {
 	# Read a line from the server.
 	# ... except that 'line' may be an entire file. ;-)
-	my($self) = @_;
+	my($self, $fh) = @_;
 	die "Not in lines" unless defined $self->{'lines'};
 
 	my $line;
-	my $res="";
+	my $res=0;
 	while(defined($line = $self->readline())) {
 		# M U gnupg-cvs-rep/AUTHORS
 		# Updated gnupg-cvs-rep/
@@ -255,16 +257,18 @@ sub _line {
 			chomp $cnt;
 			die "Duh: Filesize $cnt" if $cnt !~ /^\d+$/;
 			$line="";
-			$res="";
+			$res=0;
 			while($cnt) {
 				my $buf;
 				my $num = $self->{'socketi'}->read($buf,$cnt);
 				die "Server: Filesize $cnt: $num: $!\n" if not defined $num or $num<=0;
-				$res .= $buf;
+				print $fh $buf;
+				$res += $num;
 				$cnt -= $num;
 			}
 		} elsif($line =~ s/^ //) {
-			$res .= $line;
+			print $fh $line;
+			$res += length($line);
 		} elsif($line =~ /^M\b/) {
 			# output, do nothing
 		} elsif($line =~ /^Mbinary\b/) {
@@ -277,7 +281,8 @@ sub _line {
 				my $buf;
 				my $num = $self->{'socketi'}->read($buf,$cnt);
 				die "S: Mbinary $cnt: $num: $!\n" if not defined $num or $num<=0;
-				$res .= $buf;
+				print $fh $buf;
+				$res += $num;
 				$cnt -= $num;
 			}
 		} else {
@@ -297,18 +302,21 @@ sub file {
 	my($self,$fn,$rev) = @_;
 	my $res;
 
-	if ($self->_file($fn,$rev)) {
-		$res = $self->_line();
-		return $res if defined $res;
+	my ($fh, $name) = tempfile('gitcvs.XXXXXX', 
+		    DIR => File::Spec->tmpdir(), UNLINK => 1);
+
+	$self->_file($fn,$rev) and $res = $self->_line($fh);
+
+	if (!defined $res) {
+	    # retry
+	    $self->conn();
+	    $self->_file($fn,$rev)
+		    or die "No file command send\n";
+	    $res = $self->_line($fh);
+	    die "No input: $fn $rev\n" unless defined $res;
 	}
 
-	# retry
-	$self->conn();
-	$self->_file($fn,$rev)
-		or die "No file command send\n";
-	$res = $self->_line();
-	die "No input: $fn $rev\n" unless defined $res;
-	return $res;
+	return ($name, $res);
 }
 
 
@@ -457,13 +465,14 @@ my $commit = sub {
 	}
 	while(@new) {
 		my @n2;
-		if(@new > 55) {
-			@n2 = splice(@new,0,50);
+		if(@new > 12) {
+			@n2 = splice(@new,0,10);
 		} else {
 			@n2 = @new;
 			@new = ();
 		}
-		system("git-update-cache","--add","--",@n2);
+		system("git-update-cache","--add",
+			(map { ('--cacheinfo', @$_) } @n2));
 		die "Cannot add files: $?\n" if $?;
 	}
 
@@ -631,7 +640,7 @@ while(<CVS>) {
 		}
 		if(($ancestor || $branch) ne $last_branch) {
 			print "Switching from $last_branch to $branch\n" if $opt_v;
-			system("git-read-tree","-m","-u","$last_branch","$branch");
+			system("git-read-tree","-m","$last_branch","$branch");
 			die "read-tree failed: $?\n" if $?;
 		}
 		if($branch ne $last_branch) {
@@ -648,17 +657,16 @@ while(<CVS>) {
 		my $fn = $1;
 		my $rev = $3;
 		$fn =~ s#^/+##;
-		my $data = $cvs->file($fn,$rev);
-		print "".($init ? "New" : "Update")." $fn: ".length($data)." bytes.\n" if $opt_v;
-		mkpath(dirname($fn),$opt_v);
-		open(F,"> ./$fn")
-			or die "Cannot create '$fn': $!\n";
-		print F $data
-			or die "Cannot write to '$fn': $!\n";
-		close(F)
-			or die "Cannot write to '$fn': $!\n";
-		chmod(pmode($cvs->{'mode'}), $fn);
-		push(@new,$fn); # may be resurrected!
+		my ($tmpname, $size) = $cvs->file($fn,$rev);
+		print "".($init ? "New" : "Update")." $fn: $size bytes.\n" if $opt_v;
+		open my $F, '-|', "git-write-blob $tmpname"
+			or die "Cannot create object: $!\n";
+		my $sha = <$F>;
+		chomp $sha;
+		close $F;
+		unlink($tmpname);
+		my $mode = pmode($cvs->{'mode'});
+		push(@new,[$mode, $sha, $fn]); # may be resurrected!
 	} elsif($state == 9 and /^\s+(\S+):\d(?:\.\d+)+->(\d(?:\.\d+)+)\(DEAD\)\s*$/) {
 		my $fn = $1;
 		$fn =~ s#^/+##;
@@ -688,8 +696,15 @@ if($orig_branch) {
 		unless -f "$git_dir/refs/heads/master";
 }
 
-system("git-read-tree","-m","-u","$last_branch","$orig_branch");
-die "read-tree failed: $?\n" if $?;
+if ($orig_branch) {
+	system("git-read-tree",$last_branch);
+	die "read-tree failed: $?\n" if $?;
+} else {
+	system('git-read-tree', $orig_branch);
+	die "read-tree failed: $?\n" if $?;
+	system('git-checkout-cache', '-a');
+	die "checkout-cache failed: $?\n" if $?;
+}
 
 unlink("$git_dir/HEAD");
 symlink("refs/heads/$orig_branch","$git_dir/HEAD");

^ permalink raw reply

* [PATCH] git-cvsimport-script: use private index.
From: Sven Verdoolaege @ 2005-07-04 12:13 UTC (permalink / raw)
  To: Matthias Urlichs, git
In-Reply-To: <20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be>

git-cvsimport-script: use private index.

---
commit 79ee456cf222982f7ee3f003440c57b5f7cffa8b
tree c27c7f8bafa48d81a4d9f7562b851681984a9c7e
parent 2eb6d82eaa869a1faf4ba3326fd628f76f9f93a8
author Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 13:36:59 +0200
committer Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 13:36:59 +0200

 git-cvsimport-script |   43 +++++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/git-cvsimport-script b/git-cvsimport-script
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -16,6 +16,8 @@
 use strict;
 use warnings;
 use Getopt::Std;
+use File::Spec;
+use File::Temp qw(tempfile);
 use File::Path qw(mkpath);
 use File::Basename qw(basename dirname);
 use Time::Local;
@@ -377,6 +379,12 @@ my %branch_date;
 my $git_dir = $ENV{"GIT_DIR"} || ".git";
 $git_dir = getwd()."/".$git_dir unless $git_dir =~ m#^/#;
 $ENV{"GIT_DIR"} = $git_dir;
+my $orig_git_index;
+$orig_git_index = $ENV{GIT_INDEX_FILE} if exists $ENV{GIT_INDEX_FILE};
+my ($git_ih, $git_index) = tempfile('gitXXXXXX', SUFFIX => '.idx',
+				    DIR => File::Spec->tmpdir());
+close ($git_ih);
+$ENV{GIT_INDEX_FILE} = $git_index;
 unless(-d $git_dir) {
 	system("git-init-db");
 	die "Cannot init the GIT db at $git_tree: $?\n" if $?;
@@ -398,6 +406,9 @@ unless(-d $git_dir) {
 	}
 	$orig_branch = $last_branch;
 
+	# populate index
+	system('git-read-tree', $last_branch);
+
 	# Get the last import timestamps
 	opendir(D,"$git_dir/refs/heads");
 	while(defined(my $head = readdir(D))) {
@@ -643,11 +654,6 @@ while(<CVS>) {
 			system("git-read-tree","-m","$last_branch","$branch");
 			die "read-tree failed: $?\n" if $?;
 		}
-		if($branch ne $last_branch) {
-			unlink("$git_dir/HEAD");
-			symlink("refs/heads/$branch","$git_dir/HEAD");
-			$last_branch = $branch;
-		}
 		$state = 9;
 	} elsif($state == 8) {
 		$logmsg .= "$_\n";
@@ -686,26 +692,23 @@ while(<CVS>) {
 }
 &$commit() if $branch and $state != 11;
 
+unlink($git_index);
+
 # Now switch back to the branch we were in before all of this happened
 if($orig_branch) {
-	print "DONE; switching back to $orig_branch\n" if $opt_v;
+	print "DONE\n" if $opt_v;
 } else {
 	$orig_branch = "master";
 	print "DONE; creating $orig_branch branch\n" if $opt_v;
 	system("cp","$git_dir/refs/heads/$opt_o","$git_dir/refs/heads/master")
 		unless -f "$git_dir/refs/heads/master";
+	unlink("$git_dir/HEAD");
+	symlink("refs/heads/$orig_branch","$git_dir/HEAD");
+	if (defined $orig_git_index) {
+	    $ENV{GIT_INDEX_FILE} = $orig_git_index;
+	} else {
+	    delete $ENV{GIT_INDEX_FILE};
+	}
+	system('git checkout');
+	die "checkout failed: $?\n" if $?;
 }
-
-if ($orig_branch) {
-	system("git-read-tree",$last_branch);
-	die "read-tree failed: $?\n" if $?;
-} else {
-	system('git-read-tree', $orig_branch);
-	die "read-tree failed: $?\n" if $?;
-	system('git-checkout-cache', '-a');
-	die "checkout-cache failed: $?\n" if $?;
-}
-
-unlink("$git_dir/HEAD");
-symlink("refs/heads/$orig_branch","$git_dir/HEAD");
-

^ permalink raw reply

* Re: Stacked GIT 0.3 (now more Quilt-like)
From: Peter Osterlund @ 2005-07-04 12:32 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: GIT
In-Reply-To: <1120425269.6845.28.camel@localhost.localdomain>

Catalin Marinas <catalin.marinas@gmail.com> writes:

> On Sun, 2005-07-03 at 14:38 +0200, Peter Osterlund wrote:
> > Catalin Marinas <catalin.marinas@gmail.com> writes:
> > > I know that using -A gives a more detailed output in case of a conflict.
> > > The problem is that you will get a conflict even if the changes are
> > > identical, making it impossible to detect when a patch was merged
> > > upstream.
> > 
> > OK, I see. How about using wiggle instead?
> > 
> >         http://cgi.cse.unsw.edu.au/~neilb/source/wiggle/
> > 
> > That's what patch-utils uses if you run "pushpatch -m". wiggle is also
> > a lot smarter than diff3, so there will be fewer cases that result in
> > a conflict. Maybe a parameter to "stg push" could enable wiggle mode.
> 
> I haven't used wiggle before but I will give it a try (though I prefer
> such a tool not to be too smart since it might make mistakes). Anyway, I
> will make this configurable, i.e. you could put something like below in
> the .stgitrc file:
> 
> merger = 'diff3 -m -E %(branch1)s %(ancestor)s %(branch2)s'
> 
> or
> 
> merger = 'wiggle -m %(branch1)s %(ancestor)s %(branch2)s'
> 
> > Is there a way in StGIT to undo a push that results in a large mess of
> > conflicts?
> 
> Good point. No, there isn't yet. I will think about an undo command. At
> the moment, the old top and bottom ids of a patch are saved so that the
> patch before the merge can be retrieved but there isn't any command to
> make use of them.

I agree with the other comments, it's probably not wise to rely on
wiggle, and wiggle sometimes makes a mess. However, it often does the
right thing, and with a configurable merge program and an undo
function, this should not be a problem. Just undo and try again if you
don't like the result.

-- 
Peter Osterlund - petero2@telia.com
http://web.telia.com/~u89404340

^ permalink raw reply

* [PATCH] Fixup t/t5300 unit tests broken by 5f3de58ff85c49620ae2a1722d8d4d37c881a054
From: Jon Seymour @ 2005-07-04 13:15 UTC (permalink / raw)
  To: git; +Cc: torvalds, jon.seymour


This patch fixes up the t/t5300 unit tests which were broken by the changes in:

	Make the name of a pack-file depend on the objects packed there-in.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
---

 t/t5300-pack-object.sh |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

1bd90884e1a91e2f2e84898703c79cb9c8db0572
diff --git a/t/t5300-pack-object.sh b/t/t5300-pack-object.sh
--- a/t/t5300-pack-object.sh
+++ b/t/t5300-pack-object.sh
@@ -35,18 +35,18 @@ test_expect_success \
 
 test_expect_success \
     'pack without delta' \
-    'git-pack-objects --window=0 test-1 <obj-list'
+    'packname_1=$(git-pack-objects --window=0 test-1 <obj-list)'
 
 rm -fr .git2
 mkdir .git2
 
 test_expect_success \
     'unpack without delta' \
-    'GIT_OBJECT_DIRECTORY=.git2/objects &&
+    "GIT_OBJECT_DIRECTORY=.git2/objects &&
      export GIT_OBJECT_DIRECTORY &&
      git-init-db &&
-     git-unpack-objects -n <test-1.pack &&
-     git-unpack-objects <test-1.pack'
+     git-unpack-objects -n <test-1-${packname_1}.pack &&
+     git-unpack-objects <test-1-${packname_1}.pack"
 
 unset GIT_OBJECT_DIRECTORY
 cd $TRASH/.git2
@@ -66,7 +66,7 @@ cd $TRASH
 test_expect_success \
     'pack with delta' \
     'pwd &&
-     git-pack-objects test-2 <obj-list'
+     packname_2=$(git-pack-objects test-2 <obj-list)'
 
 rm -fr .git2
 mkdir .git2
@@ -76,8 +76,8 @@ test_expect_success \
     'GIT_OBJECT_DIRECTORY=.git2/objects &&
      export GIT_OBJECT_DIRECTORY &&
      git-init-db &&
-     git-unpack-objects -n <test-2.pack &&
-     git-unpack-objects <test-2.pack'
+     git-unpack-objects -n <test-2-${packname_2}.pack &&
+     git-unpack-objects <test-2-${packname_2}.pack'
 
 unset GIT_OBJECT_DIRECTORY
 cd $TRASH/.git2
@@ -101,7 +101,7 @@ test_expect_success \
     'GIT_OBJECT_DIRECTORY=.git2/objects &&
      export GIT_OBJECT_DIRECTORY &&
      git-init-db &&
-     cp test-1.pack test-1.idx .git2/objects/pack && {
+     cp test-1-${packname_1}.pack test-1-${packname_1}.idx .git2/objects/pack && {
 	 git-diff-tree --root -p $commit &&
 	 while read object
 	 do
@@ -117,7 +117,7 @@ test_expect_success \
     'GIT_OBJECT_DIRECTORY=.git2/objects &&
      export GIT_OBJECT_DIRECTORY &&
      rm -f .git2/objects/pack/test-?.idx &&
-     cp test-2.pack test-2.idx .git2/objects/pack && {
+     cp test-2-${packname_2}.pack test-2-${packname_2}.idx .git2/objects/pack && {
 	 git-diff-tree --root -p $commit &&
 	 while read object
 	 do
@@ -131,32 +131,32 @@ unset GIT_OBJECT_DIRECTORY
 
 test_expect_success \
     'verify pack' \
-    'git-verify-pack test-1.idx test-2.idx'
+    'git-verify-pack test-1-${packname_1}.idx test-2-${packname_2}.idx'
 
 test_expect_success \
     'corrupt a pack and see if verify catches' \
-    'cp test-1.idx test-3.idx &&
-     cp test-2.pack test-3.pack &&
+    'cp test-1-${packname_1}.idx test-3.idx &&
+     cp test-2-${packname_2}.pack test-3.pack &&
      if git-verify-pack test-3.idx
      then false
      else :;
      fi &&
 
-     cp test-1.pack test-3.pack &&
+     cp test-1-${packname_1}.pack test-3.pack &&
      dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=2 &&
      if git-verify-pack test-3.idx
      then false
      else :;
      fi &&
 
-     cp test-1.pack test-3.pack &&
+     cp test-1-${packname_1}.pack test-3.pack &&
      dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=7 &&
      if git-verify-pack test-3.idx
      then false
      else :;
      fi &&
 
-     cp test-1.pack test-3.pack &&
+     cp test-1-${packname_1}.pack test-3.pack &&
      dd if=/dev/zero of=test-3.pack count=1 bs=1 conv=notrunc seek=12 &&
      if git-verify-pack test-3.idx
      then false
------------

^ permalink raw reply

* Re: [PATCH] cvsimport: rewritten in Perl
From: Sven Verdoolaege @ 2005-07-04 13:03 UTC (permalink / raw)
  To: Matthias Urlichs; +Cc: git
In-Reply-To: <20050630210023.GY10850@kiste.smurf.noris.de>

On Thu, Jun 30, 2005 at 11:00:23PM +0200, Matthias Urlichs wrote:
> Sven Verdoolaege:
> > It would also be nice if the user could pass extra options
> > to cvsps (notably '-z').
> > 
> Ditto.  ;-)

Why not an explicit '-z' option as in the current git-cvsimport-script ?

skimo

^ permalink raw reply

* Re: [PATCH] cvsimport: rewritten in Perl
From: Matthias Urlichs @ 2005-07-04 13:53 UTC (permalink / raw)
  To: git
In-Reply-To: <20050704130324.GK18608MdfPADPa@garage.linux.student.kuleuven.ac.be>

[-- Attachment #1: Type: text/plain, Size: 529 bytes --]

Hi,

Sven Verdoolaege:
> Why not an explicit '-z' option as in the current git-cvsimport-script ?

Because my code doesn't support compressed cvs connections:
a -z that doesn't work except for the rlog part would be a lie.

Feel free to add that code. ;-)

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  smurf@smurf.noris.de
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Confidence is simply that quiet, assured feeling you have before you
fall flat on your face.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply

* Re: [PATCH] cvsimport: rewritten in Perl
From: Sven Verdoolaege @ 2005-07-04 13:46 UTC (permalink / raw)
  To: Matthias Urlichs; +Cc: git
In-Reply-To: <20050704135327.GA32098@kiste.smurf.noris.de>

On Mon, Jul 04, 2005 at 03:53:27PM +0200, Matthias Urlichs wrote:
> Hi,
> 
> Sven Verdoolaege:
> > Why not an explicit '-z' option as in the current git-cvsimport-script ?
> 
> Because my code doesn't support compressed cvs connections:
> a -z that doesn't work except for the rlog part would be a lie.

I was talking about the cvsps '-z' option (see current git-cvsimport-script).
Are you saying you want to reserve that option to signify compressed
cvs connections ?

skimo

^ permalink raw reply

* [PATCH] git-cvsimport-script: fix branch switching
From: Sven Verdoolaege @ 2005-07-04 14:06 UTC (permalink / raw)
  To: Matthias Urlichs, git
In-Reply-To: <20050703103517.GJ5992MdfPADPa@garage.linux.student.kuleuven.ac.be>

git-cvsimport-script: fix branch switching

Previous patch broke branch switching.

---
commit 46e63efc072bc440e4c6aad33d3157b70f5172b6
tree 2c4fd7286e29e6041808d07874ef2151e3876676
parent 79ee456cf222982f7ee3f003440c57b5f7cffa8b
author Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 15:28:36 +0200
committer Sven Verdoolaege <skimo@kotnet.org> Mon, 04 Jul 2005 15:28:36 +0200

 git-cvsimport-script |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/git-cvsimport-script b/git-cvsimport-script
--- a/git-cvsimport-script
+++ b/git-cvsimport-script
@@ -651,9 +651,10 @@ while(<CVS>) {
 		}
 		if(($ancestor || $branch) ne $last_branch) {
 			print "Switching from $last_branch to $branch\n" if $opt_v;
-			system("git-read-tree","-m","$last_branch","$branch");
+			system("git-read-tree", $branch);
 			die "read-tree failed: $?\n" if $?;
 		}
+		$last_branch = $branch if $branch ne $last_branch;
 		$state = 9;
 	} elsif($state == 8) {
 		$logmsg .= "$_\n";

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox