Re: [PATCH 2/2] fetch: add tweak-fetch hook
- Date: Fri, 09 Feb 2018 14:40:48 -0800
- From: Junio C Hamano <gitster@xxxxxxxxx>
- Subject: Re: [PATCH 2/2] fetch: add tweak-fetch hook
Leo Gaspard <leo@xxxxxxxxxx> writes:
> +This hook is invoked by 'git fetch' (commonly called by 'git pull'), after refs
> +have been fetched from the remote repository. It is not executed, if nothing was
Need to tighten explanation of "nothing was fetched". If the only
change I made to my repository is that I created a new branch that
points at an existing object since last time you fetched, you would
obtain no new object when you fetch from me. Would that count as
"nothing was fetched"? Or would it be still fetching something
(i.e. your remote-tracking hierarchy will record the fact that I now
have this new branch)?
> + <sha1> SP not-for-merge|merge|ignore SP <remote-refname> SP <local-refname> LF
> + ...
> +The `<remote-refname>` is the remote's name for the ref that was fetched, and
> +`<local-refname>` is a name of a remote-tracking branch, like
> +"refs/remotes/origin/master". `<local-refname>` can be undefined if the fetched
> +ref is not being stored in a local refname. In this case, it will be set to `@`,
Don't use "@"; leave it empty instead.
> +TODO: Add documentation for the “ignore” parameter. Unfortunately, I'm not
> +really sure I get what this does or what invariants it is supposed to maintain
> +(eg. all “ignore” updates at the end of the refs list?), so this may also
> +require code changes.
If you are not using the feature, wouldn't it make more sense not to
add it in the first place?