git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] fetch: add tweak-fetch hook

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 9, 2018, 22:40 UTC
Message-ID
<xmqqk1vlvlan.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20180209214458.16135-2-leo@gaspard.io>
Leo Gaspard <leo@gaspard.io> writes:
Show 6 quoted lines
> +tweak-fetch
> +~~~~~~~~~~~
> +
> +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
> +fetched.

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)?

Show 6 quoted lines
> +  <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?

Previous: Leo GaspardNext: Junio C Hamano
Message 37 of 38 in “Fetch-hooks”
  1. Leo GaspardFeb 7, 2018
  2. Ævar Arnfjörð BjarmasonFeb 7, 2018
  3. Leo GaspardFeb 8, 2018
  4. Joey HessFeb 8, 2018
  5. Leo GaspardFeb 8, 2018
  6. Ævar Arnfjörð BjarmasonFeb 8, 2018
  7. Leo GaspardFeb 8, 2018
  8. Ævar Arnfjörð BjarmasonFeb 9, 2018
  9. Leo GaspardFeb 9, 2018
  10. Ævar Arnfjörð BjarmasonFeb 9, 2018
  11. Jeff KingFeb 9, 2018
  12. Junio C HamanoFeb 9, 2018
  13. Leo GaspardFeb 9, 2018
  14. Jeff KingFeb 10, 2018
  15. Leo GaspardFeb 10, 2018
  16. Junio C HamanoFeb 10, 2018
  17. Leo GaspardFeb 10, 2018
  18. Leo GaspardFeb 10, 2018
  19. Jeff KingFeb 10, 2018
  20. Leo GaspardFeb 10, 2018
  21. Brandon WilliamsFeb 12, 2018
  22. Leo GaspardFeb 13, 2018
  23. Jeff KingFeb 14, 2018
  24. Jeff KingFeb 14, 2018
  25. Leo GaspardFeb 14, 2018
  26. Jeff KingFeb 19, 2018
  27. Leo GaspardFeb 19, 2018
  28. Jacob KellerFeb 20, 2018
  29. Jeff KingFeb 20, 2018
  30. Leo GaspardFeb 20, 2018
  31. Jacob KellerFeb 14, 2018
  32. Leo GaspardFeb 9, 2018
  33. Joey HessFeb 9, 2018
  34. 0/2 fetch: add tweak-fetch hookLeo Gaspard, Feb 9, 2018
  35. 1/2 fetch: preparations for tweak-fetch hookLeo Gaspard, Feb 9, 2018
  36. 2/2 fetch: add tweak-fetch hookLeo Gaspard, Feb 9, 2018
  37. Junio C HamanoFeb 9, 2018
  38. Junio C HamanoFeb 9, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.