Cook: Colliding with the SHA prefix of Linux's initial Git commit
This is not yet in the upstream Linux tree, for fear of breaking countless other tools out in the wild. But it can serve as a test commit for those that want to get this fixed ahead of any future collisions (or this commit actually landing).
LWN looked at commit-ID collisions a few
weeks back.
Posted Dec 30, 2024 22:39 UTC (Mon)
by mricon (subscriber, #59252)
[Link] (8 responses)
Anyway, all of this is to say that this story 100% checks out and this is totally something Case would do.
Posted Dec 30, 2024 23:08 UTC (Mon)
by mricon (subscriber, #59252)
[Link] (4 responses)
Posted Dec 31, 2024 0:50 UTC (Tue)
by Cyberax (✭ supporter ✭, #52523)
[Link] (2 responses)
Posted Dec 31, 2024 10:15 UTC (Tue)
by lkundrak (subscriber, #43452)
[Link]
Posted Jan 3, 2025 22:16 UTC (Fri)
by Lennie (subscriber, #49641)
[Link]
Posted Jan 1, 2025 0:29 UTC (Wed)
by ssmith32 (subscriber, #72404)
[Link]
Posted Dec 31, 2024 12:15 UTC (Tue)
by bof (subscriber, #110741)
[Link] (2 responses)
I laughed so hard...
Posted Dec 31, 2024 13:38 UTC (Tue)
by Wol (subscriber, #4433)
[Link]
Embankment was closed just west of Charing Cross. Seeing that there was not much traffic on a major thoroughfare, Google Maps was trying to send all the traffic down Embankment ...
I was wondering whether to trust Google Maps or not, and wish I hadn't - once committed, it took me well over half an hour to extricate myself just to get back to where I was, quite possibly an hour ... like *MOST* AI, when you need it most is exactly when it is most likely to screw up. If there's a traffic jam, trust the official diversion or your instincts, as AI is quite likely to mess up completely. I think I completely lost faith in it when it tried to divert a closed motorway down a single-track road ...
Cheers,
Posted Jan 1, 2025 20:39 UTC (Wed)
by deptrai (guest, #70612)
[Link]
https://www.simonweckert.com/googlemapshacks.html
Posted Dec 31, 2024 10:08 UTC (Tue)
by epa (subscriber, #39769)
[Link] (7 responses)
(I know worse is better and you can build anything you want on top of an unstructured field, but there is value in having a single defined way which you can reasonably expect most people to follow.)
Posted Dec 31, 2024 10:33 UTC (Tue)
by pbonzini (subscriber, #60935)
[Link] (4 responses)
Posted Dec 31, 2024 11:32 UTC (Tue)
by epa (subscriber, #39769)
[Link] (3 responses)
Posted Dec 31, 2024 15:33 UTC (Tue)
by jorgegv (subscriber, #60484)
[Link] (2 responses)
You could shorten in 'git log' but that doesn't do much to encourage use of the full SHA in the original message. If only eight characters are going to be printed, why bother pasting in all of it? Because when you are pasting a commit ID, you have most probably copied it from the terminal (or somewhere else), and doing double click on the full commit ID selects it completely? I mean: I believe nobody keys in commit IDs letter by letter, but instead copy&paste them everywhere (or use some kind of autocomplete), and the copy operation is the same to copy the full ID or an abbreviation. My view is that commit IDs should be used in full size whenever a machine could be using them, and only shorten them when showing then to a human. As someone already said, that's what forges already do, and I think it's the correct way.
Posted Dec 31, 2024 17:03 UTC (Tue)
by NYKevin (subscriber, #129325)
[Link]
But that's obviously a bad user experience. The better option would be one or more of the following:
* As suggested, auto-expand unambiguous abbreviations to full hashes at commit time (with a flag to disable this behavior, and possibly also a warning message on stderr to let you know that an expansion has occurred). Auto-abbreviate them in git log (with a flag to disable).
Posted Jan 1, 2025 0:24 UTC (Wed)
by epa (subscriber, #39769)
[Link]
Posted Dec 31, 2024 14:21 UTC (Tue)
by adobriyan (subscriber, #30858)
[Link] (1 responses)
Posted Jan 1, 2025 18:26 UTC (Wed)
by ceplm (subscriber, #41334)
[Link]
See also https://lwn.net/Articles/898522/
Posted Dec 31, 2024 15:26 UTC (Tue)
by jengelh (guest, #33263)
[Link] (3 responses)
1. `git describe`: "v6.11-7343-g70fd1966c93b". The chance that there are two commits with prefix 70fd19 *and* with distance 7343 from v6.11 is a lot lower than the chance that there are two commits with prefix 70fd19 anywhere in the entire history.
2. `git describe --contains` (if it yields a result): "v6.12~355^2~3" is unambiguous, at least as long as the tree has no grafts (or the modern equivalent thereof).
Posted Dec 31, 2024 16:21 UTC (Tue)
by mathstuf (subscriber, #69389)
[Link] (2 responses)
I don't think I can recommend `git describe` for this purpose.
[1] https://lore.kernel.org/git/ZNffWAgldUZdpQcr@farprobe/T/#u
Posted Jan 9, 2025 16:22 UTC (Thu)
by smurf (subscriber, #17840)
[Link] (1 responses)
Maybe not currently, but fixing these problems (maybe only consider signed tags?) shouldn't be too difficult.
Posted Jan 9, 2025 18:24 UTC (Thu)
by mathstuf (subscriber, #69389)
[Link]
Posted Jan 2, 2025 15:48 UTC (Thu)
by mfranc (subscriber, #164119)
[Link] (2 responses)
Posted Jan 3, 2025 7:50 UTC (Fri)
by jirislaby (subscriber, #129812)
[Link] (1 responses)
Posted Jan 3, 2025 12:47 UTC (Fri)
by mfranc (subscriber, #164119)
[Link]
Totally something Case would do
Totally something Case would do
Totally something Case would do
Totally something Case would do
Totally something Case would do
Totally something Case would do
Totally something Case would do
Totally something Case would do
Wol
Totally something Case would do
https://www.wired.com/story/99-phones-fake-google-maps-tr...
SHAs in commit messages
SHAs in commit messages
SHAs in commit messages
SHAs in commit messages
SHAs in commit messages
* Provide a reasonably terse syntax that performs auto-expansion at commit time (and can be escaped or disabled if necessary). You can probably do this now by configuring your editor to perform the expansion, but it would also require everyone to agree that expansion is preferred.
* When resolving commit IDs that appear in a given commit message, first look for matching ancestors of the given commit, then for matching non-descendant commits that are older than the given commit according to the date field, then for matching non-descendant commits that are less than 24 hours younger (to allow for wrong timezone shenanigans), and finally for all matching non-descendant commits in the repo. This requires you to know where the commit ID came from in the first place, but forges do in fact have that information when they are linkifying a commit message. Of course, they might already be doing something like this.
SHAs in commit messages
SHAs in commit messages
SHAs in commit messages
Just describe it
Just describe it
Just describe it
Just describe it
I wish for a longer prefix
I wish for a longer prefix
I wish for a longer prefix
