Bug 578852 - [push] PrePushHook is called too early
Summary: [push] PrePushHook is called too early
Status: RESOLVED FIXED
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 6.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 6.1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-02-20 11:19 EST by Thomas Wolf CLA
Modified: 2022-03-07 05:51 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wolf CLA 2022-02-20 11:19:34 EST
C git calls the pre-push hook only after the remote advertisement has been received, and rejections have been already determined. See [1]: they don't pass updates that were rejected early (or that are up to date) to the hook.

JGit calls the hook in Transport.push(), before the PushProcess is even started. This is too early.

[1] https://github.com/git/git/blob/e6ebfd0e8/transport.c#L1200
Comment 1 Eclipse Genie CLA 2022-02-20 13:07:18 EST
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/190989