git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to add custom metadata to Git commit object
@ 2016-05-30 17:58 Kirill Likhodedov
  2016-05-30 18:24 ` Konstantin Khomoutov
  2016-05-30 18:30 ` Jeff King
  0 siblings, 2 replies; 6+ messages in thread
From: Kirill Likhodedov @ 2016-05-30 17:58 UTC (permalink / raw)
  To: git

Is it possible to add custom metadata to Git commit object? 
Such metadata should be ignored by Git commands, but could be used by a 3-party tool which knows the format and knows where to look. 

I assume that this should be possible, given that Git objects are actually patches, and patches can contain additional details. But can this be done with the help of Git commands? 

----

The reason why I am asking this - is to create a tool which could overcome false rename detection. 

As all of you know, if I make significant changes to the code together with rename, Git won’t detect this rename and will treat this change as added + deleted. And sometimes there are false rename detections as well. It would be useful to record the fact of rename and use it afterwards.

If a user is developing with our IDE (IntelliJ IDEA), we could remember the fact that he renamed a file, then write this information to the commit object, and when the commit information is requested (e.g. from the git log graphical view), the IDE could read the additional information of the commit and display the file as renamed, not as added + deleted. The IDE could also use this information to follow rename through the file history.

As a real example, in our project we are converting a lot of files from Java to Kotlin, and such conversion always looses history unless the developer remembers to prepare a separate rename-commit first, which is tedious. 

There are git-notes, which could be used for the purpose, but they are visible to the user via standard Git command, and could be used by the user for other purposes, so they are not very suitable for the task.

Thanks a lot!
-- Kirill

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-05-31 15:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-30 17:58 How to add custom metadata to Git commit object Kirill Likhodedov
2016-05-30 18:24 ` Konstantin Khomoutov
2016-05-30 18:30 ` Jeff King
2016-05-30 18:52   ` Junio C Hamano
2016-05-31 15:17     ` Kirill Likhodedov
2016-05-31 15:25       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).