Re: [PATCH v4 6/6] cat-file: add remote-object-info to batch-command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Ju <eric.peijian@xxxxxxxxx> writes:

[snip]

> @@ -314,7 +323,10 @@ newline. The available atoms are:
>  	line) are output in place of the `%(rest)` atom.
>
>  If no format is specified, the default format is `%(objectname)
> -%(objecttype) %(objectsize)`.
> +%(objecttype) %(objectsize)`, except for `remote-object-info` commands which use
> +`%(objectname) %(objectsize)` for now because "%(objecttype)" is not supported yet.
> +WARNING: When "%(objecttype)" is supported, the default format WILL be unified, so
> +DO NOT RELY on the current the default format to stay the same!!!
>

This seems like a planned breakage, wouldn't it make more sense to
implement %(objecttype) first?

> diff --git a/builtin/cat-file.c b/builtin/cat-file.c
> index 5db55fabc4..714c182f39 100644
> --- a/builtin/cat-file.c
> +++ b/builtin/cat-file.c
> @@ -24,6 +24,9 @@
>  #include "promisor-remote.h"
>  #include "mailmap.h"
>  #include "write-or-die.h"
> +#include "alias.h"
> +#include "remote.h"
> +#include "transport.h"
>
>  enum batch_mode {
>  	BATCH_MODE_CONTENTS,
> @@ -42,9 +45,12 @@ struct batch_options {
>  	char input_delim;
>  	char output_delim;
>  	const char *format;
> +	int use_remote_info;
>  };
>
>  static const char *force_path;
> +static struct object_info *remote_object_info;
> +static struct oid_array object_info_oids = OID_ARRAY_INIT;
>
>  static struct string_list mailmap = STRING_LIST_INIT_NODUP;
>  static int use_mailmap;
> @@ -528,7 +534,7 @@ static void batch_one_object(const char *obj_name,
>  	enum get_oid_result result;
>
>  	result = get_oid_with_context(the_repository, obj_name,
> -				      flags, &data->oid, &ctx);
> +								  flags, &data->oid, &ctx);

Nit: we usually don't fix parts of code, which we're not explicitly
modifying.

[snip]

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux