Re: [PATCH v4] Allow update hooks to update refs on their own.

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

 



Steven Grimm <koreth@xxxxxxxxxxxxx> writes:

> +The hook may optionally choose to update the ref on its own, e.g.,
> +if it needs to modify incoming revisions in some way. If it updates
> +the ref, it should exit with a status of 100.  The hook should exit
> +with a status between 1 and 99 if it wants to disallow updating the
> +named ref.  Otherwise it should exit with zero, and the ref will be
> +updated automatically.

This makes one wonder what happens if it returns 101, iow if there is
difference between returning 99 and 101, and if so why.

> +Remote Tracking Refs
> +--------------------
> +
> +After successfully sending a pack to the remote, 'git-send-pack'
> +updates the corresponding remote tracking ref in the local repository
> +to point to the same commit as was just sent to the remote side. In
> +most cases this eliminates the need to subsequently fetch from the
> +remote repository since there would be nothing new to fetch.

Micronit.  The above is all "if exists".  Not everybody pushes to
somewhere he uses tracking with.

> @@ -70,8 +73,11 @@ static struct command *commands;
>  static const char pre_receive_hook[] = "hooks/pre-receive";
>  static const char post_receive_hook[] = "hooks/post-receive";
>  
> -static int hook_status(int code, const char *hook_name)
> +static int hook_status(int code, const char *hook_name, int ok_start)
>  {
> +	if (ok_start && -code >= ok_start)
> +		return -code;
> +

I've always been puzzled by this "ok_start" parameter from the very
beginning edition of your patch.  It is not like "if this is true, then
it is ok to run the hook but otherwise do not run".  In layman's terms,
what does the parameter mean?

Maybe the variable is misnamed and not expressing the concept well
enough.  Maybe the concept itself is muddy and hard to understand.  I
cannot tell.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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