1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-24 13:06:10 +02:00
git/contrib
Patrick Steinhardt fc134b41ce git-prompt: stop manually parsing HEAD with unknown ref formats
We're manually parsing the HEAD reference in git-prompt to figure out
whether it is a symbolic or direct reference. This makes it intimately
tied to the on-disk format we use to store references and will stop
working once we gain additional reference backends in the Git project.

Ideally, we would refactor the code to exclusively use plumbing tools to
read refs such that we do not have to care about the on-disk format at
all. Unfortunately though, spawning processes can be quite expensive on
some systems like Windows. As the Git prompt logic may be executed quite
frequently we try very hard to spawn as few processes as possible. This
refactoring is thus out of question for now.

Instead, condition the logic on the repository's ref format: if the repo
uses the the "files" backend we can continue to use the old logic and
read the respective files from disk directly. If it's anything else,
then we use git-symbolic-ref(1) to read the value of HEAD.

This change makes the Git prompt compatible with the upcoming "reftable"
format.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-01-08 11:21:45 -08:00
..
buildsystems Merge branch 'js/doc-unit-tests-with-cmake' 2023-12-09 16:37:47 -08:00
coccinelle config: pass kvi to die_bad_number() 2023-06-28 14:06:40 -07:00
completion git-prompt: stop manually parsing HEAD with unknown ref formats 2024-01-08 11:21:45 -08:00
contacts
credential Merge branch 'mh/credential-erase-improvements-more' 2023-08-28 09:51:16 -07:00
diff-highlight perl: bump the required Perl version to 5.8.1 from 5.8.0 2023-11-17 07:26:32 +09:00
emacs
examples
fast-import import-tars: ignore the global PAX header 2020-03-24 14:39:47 -07:00
git-jump git-jump: admit to passing merge mode args to ls-files 2023-10-05 12:55:38 -07:00
git-shell-commands
hg-to-git hg-to-git: make it compatible with both python3 and python2 2019-09-18 12:03:05 -07:00
hooks multimail: stop shipping a copy 2021-06-11 13:35:19 +09:00
long-running-filter
mw-to-git Merge branch 'tz/send-email-negatable-options' 2023-12-09 16:37:51 -08:00
persistent-https
remote-helpers
stats
subtree contrib/subtree: convert subtree type check to use case statement 2023-11-11 09:21:00 +09:00
thunderbird-patch-inline
update-unicode
vscode vscode: improve tab size and wrapping 2022-06-27 15:37:44 -07:00
workdir
README doc: fix some typos, grammar and wording issues 2023-10-05 12:55:38 -07:00
coverage-diff.sh
git-resurrect.sh contrib/git-resurrect.sh: use hash-agnostic OID pattern 2020-10-08 11:48:56 -07:00
remotes2config.sh
rerere-train.sh contrib/rerere-train: avoid useless gpg sign in training 2022-07-19 11:24:08 -07:00

Contributed Software

Although these pieces are available as part of the official git
source tree, they are in somewhat different status.  The
intention is to keep interesting tools around git here, maybe
even experimental ones, to give users an easier access to them,
and to give tools wider exposure, so that they can be improved
faster.

I am not expecting to touch these myself that much.  As far as
my day-to-day operation is concerned, these subdirectories are
owned by their respective primary authors.  I am willing to help
if users of these components and the contrib/ subtree "owners"
have technical/design issues to resolve, but the initiative to
fix and/or enhance things _must_ be on the side of the subtree
owners.  IOW, I won't be actively looking for bugs and rooms for
enhancements in them as the git maintainer -- I may only do so
just as one of the users when I want to scratch my own itch.  If
you have patches to things in contrib/ area, the patch should be
first sent to the primary author, and then the primary author
should ack and forward it to me (git pull request is nicer).
This is the same way as how I have been treating gitk, and to a
lesser degree various foreign SCM interfaces, so you know the
drill.

I expect things that start their life in the contrib/ area
to graduate out of contrib/ once they mature, either by becoming
projects on their own, or moving to the toplevel directory.  On
the other hand, I expect I'll be proposing removal of disused
and inactive ones from time to time.

If you have new things to add to this area, please first propose
it on the git mailing list, and after a list discussion proves
there is general interest (it does not have to be a
list-wide consensus for a tool targeted to a relatively narrow
audience -- for example I do not work with projects whose
upstream is svn, so I have no use for git-svn myself, but it is
of general interest for people who need to interoperate with SVN
repositories in a way git-svn works better than git-svnimport),
submit a patch to create a subdirectory of contrib/ and put your
stuff there.

-jc