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

Re: [RTC/PATCH] Add 'update-branch' hook

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 22, 2014, 16:30 UTC
Message-ID
<535699181d3d9_3e5aed730876@nysa.notmuch>
In-Reply-To
<53560F28.9020904@gmail.com>
Ilya Bobyr wrote:
Show 15 quoted lines
> On 4/21/2014 1:49 PM, Felipe Contreras wrote:
> > Ilya Bobyr wrote:
> >> On 4/20/2014 7:23 PM, Felipe Contreras wrote:
> >>> This hook is invoked whenever a branch is updated, either when a branch
> >>> is created or updated with 'git branch', or when it's rebased with 'git
> >>> rebase'. It receives two parameters; the name of the branch, and the
> >>> SHA-1 of the latest commit, additionally, if there was a base commit the
> >>> branch was rebased onto, a third parameter contains it.
> >> And the old branch SHA could be found from in the reflog, correct?
> > Actually the old branch SHA-1 is actually the current one, since the branch
> > hasn't been updated at that point. Personally I don't see much value in adding
> > something the script can easily find out.
> 
> If the hook is about a branch update, I would expect it to provide both
> old and new points for the branch, along with the name.

Again, I don't see the the point of passing something that is easy to find out: `git rev-parse $branch` gives you that information.

> The fact that for rebases it also provides new base SHA is very
> convenient.  As it is an optional argument it may make further extension
> of the interface a bit awkward.
> So, is seems reasonable to provide both from the very beginning.
So basically `git branch` would send the same SHA-1 twice.
-- 
Felipe Contreras
Previous: Ilya BobyrNext: Ilya Bobyr
Message 28 of 39 in “Add 'update-branch' hook”
  1. Add 'update-branch' hookFelipe Contreras, Apr 21, 2014
  2. Eric SunshineApr 21, 2014
  3. Ilya BobyrApr 21, 2014
  4. Felipe ContrerasApr 21, 2014
  5. Ilya BobyrApr 21, 2014
  6. Felipe ContrerasApr 21, 2014
  7. Ilya BobyrApr 21, 2014
  8. Felipe ContrerasApr 21, 2014
  9. Stephen LeakeApr 22, 2014
  10. Felipe ContrerasApr 22, 2014
  11. Ilya BobyrApr 22, 2014
  12. Felipe ContrerasApr 22, 2014
  13. Stephen LeakeApr 23, 2014
  14. Felipe ContrerasApr 23, 2014
  15. Junio C HamanoApr 23, 2014
  16. Felipe ContrerasApr 24, 2014
  17. Junio C HamanoApr 26, 2014
  18. Felipe ContrerasApr 26, 2014
  19. Stephen LeakeApr 24, 2014
  20. Felipe ContrerasApr 24, 2014
  21. Junio C HamanoApr 21, 2014
  22. Felipe ContrerasApr 21, 2014
  23. Junio C HamanoApr 21, 2014
  24. Felipe ContrerasApr 23, 2014
  25. Junio C HamanoApr 23, 2014
  26. Felipe ContrerasApr 24, 2014
  27. Ilya BobyrApr 22, 2014
  28. Felipe ContrerasApr 22, 2014
  29. Ilya BobyrApr 21, 2014
  30. Felipe ContrerasApr 21, 2014
  31. Ilya BobyrApr 21, 2014
  32. Felipe ContrerasApr 21, 2014
  33. Ilya BobyrApr 22, 2014
  34. Felipe ContrerasApr 22, 2014
  35. Felipe ContrerasApr 21, 2014
  36. Ilya BobyrApr 22, 2014
  37. Felipe ContrerasApr 22, 2014
  38. Ilya BobyrApr 22, 2014
  39. Felipe ContrerasApr 22, 2014

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.