git-rev-list

In my repo, how long must the longest hash prefix be to prevent any overlap?

女生的网名这么多〃 提交于 2019-11-30 07:27:29
问题 The --abbrev-commit flag can be used in conjunction with git log and git rev-list in order to show partial prefixes instead of the full 40-character SHA-1 hashes of commit objects. According to the Pro Git book, it defaults to using seven characters but makes them longer if necessary to keep the SHA-1 unambiguous [...] Additionally, short SHAs are at least 4-character long. Still according to the Pro Git book, Generally, eight to ten characters are more than enough to be unique within a

In my repo, how long must the longest hash prefix be to prevent any overlap?

徘徊边缘 提交于 2019-11-29 04:03:33
The --abbrev-commit flag can be used in conjunction with git log and git rev-list in order to show partial prefixes instead of the full 40-character SHA-1 hashes of commit objects. According to the Pro Git book , it defaults to using seven characters but makes them longer if necessary to keep the SHA-1 unambiguous [...] Additionally, short SHAs are at least 4-character long. Still according to the Pro Git book, Generally, eight to ten characters are more than enough to be unique within a project. As an example, the Linux kernel, which is a pretty large project with over 450k commits and 3.6

Git - how to list ALL objects in the database

a 夏天 提交于 2019-11-26 08:59:23
问题 Is there a better way of getting a raw list of SHA1s for ALL objects in a repository than doing ls .git/objects/??/\\* and cat .git/objects/pack/*.idx | git show-index ? I know about git rev-list --all but that only lists commit objects that are referenced by .git/refs, and I\'m looking for everything including unreferenced objects that are created by git-hash-object, git-mktree etc. 回答1: Edit: Aristotle posted an even better answer, which should be marked as correct. Edit: the script