aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-07 08:37:43 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-07 10:30:48 -0700
commitc113c5df7911bf7bc6a4542131ac5bf983532a97 (patch)
treed27882381efd85f487bb96ecab3d2a43941dba6f /builtin/commit.c
parentglobal: improve const correctness when assigning string constants (diff)
downloadgit-c113c5df7911bf7bc6a4542131ac5bf983532a97.tar.gz
git-c113c5df7911bf7bc6a4542131ac5bf983532a97.zip
global: convert intentionally-leaking config strings to consts
There are multiple cases where we intentionally leak config strings: - `struct gpg_format` is used to track programs that can be used for signing commits, either via gpg(1), gpgsm(1) or ssh-keygen(1). The user can override the commands via several config variables. As the array is populated once, only, and the struct memers are never written to or free'd. - `struct ll_merge_driver` is used to track merge drivers. Same as with the GPG format, these drivers are populated once and then reused. Its data is never written to or free'd, either. - `struct userdiff_funcname` and `struct userdiff_driver` can be configured via `diff.<driver>.*` to add additional drivers. Again, these have a global lifetime and are never written to or free'd. All of these are intentionally kept alive and are never written to. Furthermore, all of these are being assigned both string constants in some places, and allocated strings in other places. This will cause warnings once we enable `-Wwrite-strings`, so let's mark the respective fields as `const char *` and cast away the constness when assigning those values. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions
>2008-03-02Documentation: Remove --{min,max}-age option from git-log(1)Jakub Narebski1-0/+2 2008-03-02cleanup: remove unused git_checkout_configDenis Cheng1-6/+1 2008-03-02Fix make_absolute_path() for parameters without a slashJohannes Schindelin2-1/+5 2008-03-02diff: make sure work tree side is shown as 0{40} when differentJunio C Hamano2-5/+55 2008-03-02diff-lib.c: constness strengtheningJunio C Hamano1-7/+6 2008-03-01Clean up find_unique_abbrev() callersJunio C Hamano3-11/+3 2008-03-01find_unique_abbrev(): redefine semanticsJunio C Hamano1-7/+6 2008-03-01git rebase --abort: always restore the right commitMike Hommey2-4/+3 2008-03-01Documentation/git-rebase.txt: Add --strategy to synopsysMike Hommey1-0/+1 2008-03-01CodingGuidelines: spell out how we use grep in our scriptsJunio C Hamano1-0/+12 2008-03-01add storage size output to 'git verify-pack -v'Nicolas Pitre3-7/+7 2008-03-01fix unimplemented packed_object_info_detail() featuresNicolas Pitre2-3/+10 2008-03-01make verify_one_pack() a bit less wrong wrt packed_git structureNicolas Pitre1-1/+1 2008-03-01factorize revindex code out of builtin-pack-objects.cNicolas Pitre4-152/+167 2008-03-01allow git-am to run in a subdirectoryJeff King1-0/+2 2008-03-01rename: warn user when we have turned off rename detectionJeff King1-3/+4