git/builtin
Patrick Steinhardt 07658e9ce5 builtin/rev-parse: allow shortening to more than 40 hex characters
The `--short=` option for git-rev-parse(1) allows the user to specify
to how many characters object IDs should be shortened to. The option is
broken though for SHA256 repositories because we set the maximum allowed
hash size to `the_hash_algo->hexsz` before we have even set up the repo.
Consequently, `the_hash_algo` will always be SHA1 and thus we truncate
every hash after at most 40 characters.

Fix this by accessing `the_hash_algo` only after we have set up the
repo.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-05-06 22:50:49 -07:00
..
add.c Merge branch 'ps/the-index-is-no-more' into ps/undecided-is-not-necessarily-sha1 2024-05-06 22:50:29 -07:00
am.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
annotate.c
apply.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
archive.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:33 -08:00
bisect.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
blame.c date: make DATE_MODE thread-safe 2024-04-05 15:21:14 -07:00
branch.c Merge branch 'jk/core-comment-string' 2024-04-05 10:49:49 -07:00
bugreport.c bugreport.c: fix a crash in `git bugreport` with `--no-suffix` option 2024-03-16 09:31:42 -07:00
bundle.c
cat-file.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
check-attr.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
check-ignore.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
check-mailmap.c
check-ref-format.c
checkout--worker.c
checkout-index.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
checkout.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
clean.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
clone.c builtin/clone: stop using `the_index` 2024-04-18 12:30:42 -07:00
column.c column: disallow negative padding 2024-02-13 10:18:50 -08:00
commit-graph.c Merge branch 'ja/doc-placeholders-fix' 2024-02-08 13:20:34 -08:00
commit-tree.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
commit.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
config.c config: allow tweaking whitespace between value and comment 2024-03-15 16:07:39 -07:00
count-objects.c
credential-cache--daemon.c Win32: detect unix socket support at runtime 2024-04-03 14:54:28 -07:00
credential-cache.c Win32: detect unix socket support at runtime 2024-04-03 14:54:28 -07:00
credential-store.c
credential.c
describe.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
diagnose.c
diff-files.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
diff-index.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
diff-tree.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
diff.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
difftool.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
fast-export.c use xstrncmpz() 2024-02-12 09:32:41 -08:00
fast-import.c fast-import: make comments more precise 2024-04-15 10:06:18 -07:00
fetch-pack.c
fetch.c Merge branch 'ds/fetch-config-parse-microfix' 2024-04-15 14:11:43 -07:00
fmt-merge-msg.c
for-each-ref.c for-each-ref: add new option to include root refs 2024-02-23 10:36:28 -08:00
for-each-repo.c for-each-repo: optionally keep going on an error 2024-04-24 10:46:03 -07:00
fsck.c refs: drop unused params from the reflog iterator callback 2024-02-21 09:58:06 -08:00
fsmonitor--daemon.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:33 -08:00
gc.c Merge branch 'js/for-each-repo-keep-going' 2024-04-30 14:49:45 -07:00
get-tar-commit-id.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
grep.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
hash-object.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
help.c
hook.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
index-pack.c unpack: replace xwrite() loop with write_in_full() 2024-03-02 11:12:16 -08:00
init-db.c Merge branch 'ps/refstorage-extension' 2024-01-16 10:11:57 -08:00
interpret-trailers.c Merge branch 'ja/doc-formatting-fix' 2024-03-25 16:16:34 -07:00
log.c Merge branch 'jc/format-patch-rfc-more' 2024-04-30 14:49:43 -07:00
ls-files.c factor out strbuf_expand_bad_format() 2024-03-25 11:59:24 -07:00
ls-remote.c Merge branch 'en/header-cleanup' 2024-01-08 14:05:15 -08:00
ls-tree.c Merge branch 'rs/strbuf-expand-bad-format' 2024-04-03 10:56:20 -07:00
mailinfo.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
mailsplit.c
merge-base.c commit-reach(repo_get_merge_bases_many_dirty): pass on errors 2024-02-29 08:06:01 -08:00
merge-file.c merge-file: add --diff-algorithm option 2023-11-22 14:23:06 +09:00
merge-index.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
merge-ours.c
merge-recursive.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
merge-tree.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
merge.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
mktag.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:33 -08:00
mktree.c
multi-pack-index.c midx: disable replace objects 2024-04-17 12:35:41 -07:00
mv.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
name-rev.c name-rev: use mem_pool_strfmt() 2024-02-26 09:35:40 -08:00
notes.c strbuf: accept a comment string for strbuf_add_commented_lines() 2024-03-12 13:28:10 -07:00
pack-objects.c Merge branch 'eb/hash-transition' 2024-03-28 14:13:50 -07:00
pack-redundant.c
pack-refs.c builtin/pack-refs: introduce new "--auto" flag 2024-03-25 09:54:07 -07:00
patch-id.c
prune-packed.c
prune.c
pull.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
push.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
range-diff.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
read-tree.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
rebase.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
receive-pack.c Merge branch 'ps/run-auto-maintenance-in-receive-pack' 2024-04-23 15:05:56 -07:00
reflog.c Merge branch 'ps/reflog-list' into HEAD 2024-03-01 14:38:55 -08:00
remote-ext.c
remote-fd.c
remote.c builtin/remote.c: trivial fix of error message 2024-03-05 14:11:56 -08:00
repack.c repack: check error writing to pack-objects subprocess 2024-03-02 11:12:16 -08:00
replace.c
replay.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
rerere.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
reset.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
rev-list.c Merge branch 'jk/pretty-subject-cleanup' 2024-04-01 13:21:34 -07:00
rev-parse.c builtin/rev-parse: allow shortening to more than 40 hex characters 2024-05-06 22:50:49 -07:00
revert.c cherry-pick: add `--empty` for more robust redundant commit handling 2024-03-25 16:45:41 -07:00
rm.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
send-pack.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
shortlog.c shortlog: stop setting pp.print_email_subject 2024-03-19 17:54:15 -07:00
show-branch.c
show-index.c
show-ref.c Merge branch 'tc/show-ref-exists-fix' into maint-2.43 2024-02-13 14:44:47 -08:00
sparse-checkout.c Merge branch 'en/header-cleanup' into maint-2.43 2024-02-08 16:22:10 -08:00
stash.c Merge branch 'ps/the-index-is-no-more' into ps/undecided-is-not-necessarily-sha1 2024-05-06 22:50:29 -07:00
stripspace.c strbuf: accept a comment string for strbuf_add_commented_lines() 2024-03-12 13:28:10 -07:00
submodule--helper.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
symbolic-ref.c
tag.c Merge branch 'jk/core-comment-string' 2024-04-05 10:49:49 -07:00
unpack-file.c
unpack-objects.c unpack: replace xwrite() loop with write_in_full() 2024-03-02 11:12:16 -08:00
update-index.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
update-ref.c update-ref: use {old,new}-oid instead of {old,new}value 2024-04-02 10:20:28 -07:00
update-server-info.c
upload-archive.c
upload-pack.c upload-pack: always turn off save_commit_buffer 2024-02-28 14:42:01 -08:00
var.c config: rename global config function 2024-01-18 12:17:41 -08:00
verify-commit.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
verify-pack.c
verify-tag.c treewide: remove unnecessary includes in source files 2023-12-26 12:04:31 -08:00
worktree.c Merge branch 'jk/core-comment-string' 2024-04-05 10:49:49 -07:00
write-tree.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00