Re: [PATCH 1/2] Add git-archive

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Junio C Hamano <junkio@...>
Cc: Franck Bui-Huu <vagabon.xyz@...>, <git@...>, <rene.scharfe@...>
Date: Wednesday, September 6, 2006 - 9:46 am

Junio C Hamano wrote:

great !


(sigh), sorry for that.


OK. We'll wait for Rene.


Interesting, could you explain why static variables are not nice ?


You might have missed my second patch:

		"[PATCH 2/2] Add git-upload-archive"

Basically the server can also use 'reason' to report a failure
description during NACK. I find it more useful than the simple
"server sent EOF" error message.


no strong feeling here. I'll call it "struct archiver". BTW there
are a couple of "struct foo_struct" in git source...


'remote' case is not a generic argument that can be passed to
archiver backends. Remember, the archiver backends only do local
operation. They do not know about remote protocol which is part
of git-archive command. That's the reason why I think we shouldn't
make this field part of arguments structure. It completely change
the behaviour of git-archive when it is used.


One bad side is that we need to malloc this embedded structure.
Therefore we have to free this embedded structure somewhere. 

We could have the following structures in archive.h, but we need
to export all these archiver backend definitions.

	struct tar_archive_args {
		int z_compress;
	};

	struct tar_archive_args {
		[...]
	};

	struct archive_args {
		const char		*prefix;
		struct tree		*tree;
		const unsigned char	*commit_sha1;
		const char		*prefix;
		time_t			time;
		const char		**pathspec;
		union {
			struct tar_archive_args tar_args;
			struct zip_archive_args zip_args;
		} u;
	};

	struct archiver {
		const char *name;
		write_archive_fn_t write_archive;
		parse_extra_args_fn_t parse_extra;
		const char *remote;
	};

	typedef int (*write_archive_fn_t)(struct archive_args *archive_args);


I forgot to remove that.


I forgot to change that.


yes. Actually git-upload-{tar,zip,...} commands are going to be
removed, but git-daemon know them as a daemon service. It will
map these services to the generic "git-upload-archive" command.
One benefit is that we could still disable TAR format and enable
TGZ one. Please take a look to the second patch that adds
git-upload-archive command.


Absolutely.


OK, I'll take a look


As I said in a previous email, I'm new with git internals. I prefer
let that part to others who better have a better knowledge on the
subject. I'll dig into that later though...


OK


Yes.

sure.

Thanks for your comments,

		Franck
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 1/2] Add git-archive, Junio C Hamano, (Tue Sep 5, 3:23 pm)
Re: [PATCH 1/2] Add git-archive, Franck Bui-Huu, (Wed Sep 6, 9:46 am)
Re: [PATCH 1/2] Add git-archive, Junio C Hamano, (Wed Sep 6, 5:42 pm)
Re: [PATCH 1/2] Add git-archive, Franck Bui-Huu, (Thu Sep 7, 2:32 am)
Re: [PATCH 1/2] Add git-archive, Junio C Hamano, (Thu Sep 7, 3:19 am)
Re: [PATCH 1/2] Add git-archive, Franck Bui-Huu, (Thu Sep 7, 3:53 am)
Re: [PATCH 1/2] Add git-archive, Junio C Hamano, (Thu Sep 7, 4:16 am)
Add git-archive [take #2], Franck Bui-Huu, (Thu Sep 7, 9:08 am)
Re: Add git-archive [take #2], Junio C Hamano, (Thu Sep 7, 8:37 pm)
Re: Add git-archive [take #2], Rene Scharfe, (Fri Sep 8, 4:21 pm)
Re: Add git-archive [take #2], Franck Bui-Huu, (Fri Sep 8, 4:18 am)
Re: Add git-archive [take #2], Junio C Hamano, (Fri Sep 8, 4:58 am)
Re: Add git-archive [take #2], Franck Bui-Huu, (Fri Sep 8, 5:43 am)
Re: Add git-archive [take #2], Franck Bui-Huu, (Thu Sep 7, 1:26 pm)
[PATCH 3/4] git-archive: wire up ZIP format., Franck Bui-Huu, (Thu Sep 7, 9:12 am)
[PATCH 1/4] Add git-archive, Franck Bui-Huu, (Thu Sep 7, 9:12 am)
Re: [PATCH 1/4] Add git-archive, Junio C Hamano, (Thu Sep 7, 10:35 pm)
Re: [PATCH 1/4] Add git-archive, Franck Bui-Huu, (Fri Sep 8, 5:00 am)
Re: [PATCH 1/4] Add git-archive, Rene Scharfe, (Fri Sep 8, 4:21 pm)
Re: [PATCH 1/4] Add git-archive, Franck Bui-Huu, (Sat Sep 9, 10:31 am)
Re: [PATCH 1/4] Add git-archive, Rene Scharfe, (Sat Sep 9, 11:02 am)
Re: [PATCH 1/4] Add git-archive, Franck Bui-Huu, (Sat Sep 9, 11:25 am)
[PATCH 4/4] Add git-upload-archive, Franck Bui-Huu, (Thu Sep 7, 9:12 am)
[PATCH 2/4] git-archive: wire up TAR format., Franck Bui-Huu, (Thu Sep 7, 9:12 am)
Re: [PATCH 2/4] git-archive: wire up TAR format., Rene Scharfe, (Fri Sep 8, 4:21 pm)
Re: [PATCH 2/4] git-archive: wire up TAR format., Franck Bui-Huu, (Sat Sep 9, 10:38 am)
Re: [PATCH 1/2] Add git-archive, Rene Scharfe, (Wed Sep 6, 4:14 pm)