From: ZheNing Hu <adlternative@gmail.com>
To: Git List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>,
Christian Couder <christian.couder@gmail.com>,
Hariom verma <hariom18599@gmail.com>,
Felipe Contreras <felipe.contreras@gmail.com>,
Phillip Wood <phillip.wood123@gmail.com>
Subject: [QUESTION] how to quickly find an oid in the git repository
Date: Sun, 30 May 2021 14:53:24 +0800 [thread overview]
Message-ID: <CAOLTT8SS8Wypho7eCCGH7LtOLwM6tWCzp8mGGEVASBC80MwJ5A@mail.gmail.com> (raw)
When I tried to make cat-file --batch use ref-filter logic,
I encountered this problem:
get_oid_with_context() does not really let me know
if an oid is in the git repository. E.g.
get_oid_with_context(the_repository,
"0000000000000000000000000000000000000000",...)
will return FOUND. (I really want it to tell me MISSING_OBJECT
or something else)
On the other hand, oid_object_info_extended() will parse an object
in depth, using it will seriously affect performance. So I want to know
if there is a function that can quickly find the oid? I searched in
`object-name.c`, `object-file.c`, and there seems to be no clue...
--
ZheNing Hu
next reply other threads:[~2021-05-30 6:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-30 6:53 ZheNing Hu [this message]
2021-05-30 20:54 ` [QUESTION] how to quickly find an oid in the git repository Jeff King
2021-05-31 11:30 ` ZheNing Hu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAOLTT8SS8Wypho7eCCGH7LtOLwM6tWCzp8mGGEVASBC80MwJ5A@mail.gmail.com \
--to=adlternative@gmail.com \
--cc=christian.couder@gmail.com \
--cc=felipe.contreras@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=hariom18599@gmail.com \
--cc=phillip.wood123@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).