On this page:
git_  reflog_  append
git_  reflog_  delete
git_  reflog_  drop
git_  reflog_  entry_  byindex
git_  reflog_  entry_  committer
git_  reflog_  entry_  id_  new
git_  reflog_  entry_  id_  old
git_  reflog_  entry_  message
git_  reflog_  entrycount
git_  reflog_  free
git_  reflog_  read
git_  reflog_  rename
git_  reflog_  write
8.12

34 Reflog🔗ℹ

 (require libgit2/include/reflog) package: libgit2

procedure

(git_reflog_append reflog id committer msg)  integer?

  reflog : reflog?
  id : oid?
  committer : signature?
  msg : string?
Add a new entry to the in-memory reflog.

msg is optional and can be NULL.

procedure

(git_reflog_delete repo name)  integer?

  repo : repository?
  name : string?
Delete the reflog for the given reference

procedure

(git_reflog_drop reflog    
  idx    
  rewrite_previous_entry)  integer?
  reflog : reflog?
  idx : size_t
  rewrite_previous_entry : boolean?
Remove an entry from the reflog by its index

To ensure there’s no gap in the log history, set rewrite_previous_entry param value to 1. When deleting entry n, member old_oid of entry n-1 (if any) will be updated with the value of member new_oid of entry n+1.

procedure

(git_reflog_entry_byindex reflog idx)  integer?

  reflog : reflog?
  idx : size_t
Lookup an entry by its index

Requesting the reflog entry with an index of 0 (zero) will return the most recently created entry.

procedure

(git_reflog_entry_committer entry)  integer?

  entry : reflog_entry?
Get the committer of this entry

procedure

(git_reflog_entry_id_new entry)  integer?

  entry : reflog_entry?
Get the new oid

procedure

(git_reflog_entry_id_old entry)  integer?

  entry : reflog_entry?
Get the old oid

procedure

(git_reflog_entry_message entry)  integer?

  entry : reflog_entry?
Get the log message

procedure

(git_reflog_entrycount reflog)  integer?

  reflog : reflog?
Get the number of log entries in a reflog

procedure

(git_reflog_free reflog)  void?

  reflog : reflog?
Free the reflog

procedure

(git_reflog_read repo name)  reflog?

  repo : repository?
  name : string?
Read the reflog for the given reference

If there is no reflog file for the given reference yet, an empty reflog object will be returned.

The reflog must be freed manually by using git_reflog_free().

procedure

(git_reflog_rename repo old_name name)  integer?

  repo : repository?
  old_name : string?
  name : string?
Rename a reflog

The reflog to be renamed is expected to already exist

The new name will be checked for validity. See git_reference_create_symbolic() for rules about valid names.

procedure

(git_reflog_write reflog)  integer?

  reflog : reflog?
Write an existing in-memory reflog object back to disk using an atomic file lock.