Search for Branch.java in onedev/server source #3107
Zak Siddiqui opened 2 days ago

Find the Branch entity class to understand current author tracking

  • Service Desk commented 2 days ago

    There is no Branch.java or persistent Branch entity in the onedev/server source. Branches are represented directly as Git refs: Project.getBranchRefs() / getBranchRef() return RefFacade objects wrapping JGit refs.

    The contributor shown on the branches page is derived from the branch tip commit’s author and committer (RevCommit.getAuthorIdent() / getCommitterIdent()), so it identifies the latest commit, not the branch creator or owner.

    For pushes, GitPostReceiveCallback attaches the authenticated OneDev user to a transient RefUpdated event. Listeners can use that user (for example, the branch-update trigger’s “pushed by” condition), but it is not persisted as an author property of the branch. GitService.createBranch() also emits RefUpdated without a user.

    So current author tracking is commit-level, with pusher identity available during ref-update processing; OneDev does not persist a branch creator/author or last-pusher record. Adding that concept would require new persistent metadata rather than extending an existing Branch entity.

  • Service Desk changed state to 'Closed' 2 days ago
    Previous Value Current Value
    Open
    Closed
1/1
Type
Question
Priority
Normal
Assignee
Labels
No labels
Issue Votes (0)
Watchers (3)
Reference
OD-3107
Please wait...
Connection lost or session expired, reload to recover
Page is in error, reload to recover