Skip to content

Feed the reference log when creating and updating references#1577

Closed
nulltoken wants to merge 5 commits intolibgit2:developmentfrom
nulltoken:topic/reference_log
Closed

Feed the reference log when creating and updating references#1577
nulltoken wants to merge 5 commits intolibgit2:developmentfrom
nulltoken:topic/reference_log

Conversation

@nulltoken
Copy link
Member

  • git_reference_create_with_log()
  • git_reference_symbolic_create_with_log()
  • git_reference_symbolic_set_target_with_log()
  • git_reference_set_target_with_log()

@carlosmn
Copy link
Member

It'd be awesome if you could make git_reference_create use this.

@nulltoken
Copy link
Member Author

@carlosmn Actually @vmg was rather in favor of exposing a set of separate functions and keep git_reference_create() and git_reference_symbolic_create() as they are.

@carlosmn
Copy link
Member

I of course mean git_commit_create.

@nulltoken
Copy link
Member Author

You mean adding a git_commit_create_with_log()? Otherwise, it'd be complex to generate the proper message for commit or amend.

@carlosmn
Copy link
Member

Fair enough, that keeps the semantics of a part failing simpler for us.

@carlosmn
Copy link
Member

You're right, we don't know whether it is an amend or a newly-created branch, so we wouldn't produce the same output as git.

This makes the first argument of git_commit_create much less helpful though, as every user should leave it blank and update the reflog themselves, which requires you to hold the right git_reference * anyway.

@nulltoken
Copy link
Member Author

@cmn If that makes sense, I'd rather work incrementally and tackle the git_commit_create_with_log() in a separate PR.

@carlosmn
Copy link
Member

Sure, I was just thinking out loud

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not good. The reflog was designed to be an append data structure: we should be able to call git_reflog_append without having to read the reflog beforehand.

@vmg
Copy link
Member

vmg commented May 24, 2013

I would prefer if this PR came in conjunction with:

  1. Making the reflog API part of the refdb abstraction.
  2. Making the on-disk reflog API allow appends without having to parse the reflog beforehand.

@vmg
Copy link
Member

vmg commented Nov 14, 2013

@carlosmn is taking this over in another PR. Following there.

@vmg vmg closed this Nov 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants