Changes
Page history
enhance gitlab's hash lookup
authored
Mar 11, 2025
by
anarcat
The `config` file does *not* have the full path, actually.
Show whitespace changes
Inline
Side-by-side
howto/gitlab.md
View page @
27836e00
...
@@ -599,8 +599,26 @@ then:
...
@@ -599,8 +599,26 @@ then:
ProjectRepository.find_by(disk_path: '@hashed/b1/7e/b17ef6d19c7a5b1ee83b907c595526dcb1eb06db8227d650d5dda0a9f4ce8cd9').project
ProjectRepository.find_by(disk_path: '@hashed/b1/7e/b17ef6d19c7a5b1ee83b907c595526dcb1eb06db8227d650d5dda0a9f4ce8cd9').project
The project's full path is also available in the
`config`
file in the
... will return the
`project`
object. You probably want the
git repository, under the
`fullpath`
config entry.
`path_with_namespace`
from there:
ProjectRepository.find_by(disk_path: '@hashed/b1/7e/b17ef6d19c7a5b1ee83b907c595526dcb1eb06db8227d650d5dda0a9f4ce8cd9').project.path_with_namespace
You can chain those in the console to display multiple repos:
```
ruby
[
'@hashed/e0/b0/e0b08ad65f5b6f6b75d18c8642a041ca1160609af1b7dfc55ab7f2d293fd8758'
,
'@hashed/f1/5a/f15a3a5d34619f23d79d4124224e69f757a36d8ffb90aa7c17bf085ceb6cd53a'
,
'@hashed/09/dc/09dc1bb2b25a72c6a5deecbd211750ba6f81b0bd809a2475eefcad2c11ab9091'
,
'@hashed/a0/bd/a0bd94956b9f42cde97b95b10ad65bbaf2a8d87142caf819e4c099ed75126d72'
,
'@hashed/32/71/32718321fcedd1bcfbef86cac61aa50938668428fddd0e5810c97b3574f2e070'
,
'@hashed/7d/a0/7da08b799010a8dd3e6071ef53cd8f52049187881fbb381b6dfe33bba5a8f8f0'
,
'@hashed/26/c1/26c151f9669f97e9117673c9283843f75cab75cf338c189234dd048f08343e69'
,
'@hashed/92/b6/92b690fedfae7ea8024eb6ea6d53f64cd0a4d20e44acf71417dca4f0d28f5c74'
,
'@hashed/ff/49/ff49a4f6ed54f15fa0954b265ad056a6f0fdab175ac8a1c3eb0a98a38e46da3d'
,
'@hashed/9a/0d/9a0d49266d4f5e24ff7841a16012f3edab7668657ccaee858e0d55b97d5b8f9a'
,
'@hashed/95/9d/959daad7593e37c5ab21d4b54173deb4a203f4071db42803fde47ecba3f0edcd'
].
each
do
|
hash
|
print
(
ProjectRepository
.
find_by
(
disk_path:
hash
).
project
.
path_with_namespace
,
"
\n
"
)
end
```
Finally, you can also generate a rainbow table of all possible hashes
Finally, you can also generate a rainbow table of all possible hashes
to get the project ID, and from there, find the project using the API
to get the project ID, and from there, find the project using the API
...
...
...
...