{"thread":{"id":"64969","subject":"Re: [Outreachy PATCH v6 1/3] environment: stop storing `core.attributesFile` globally","startedAt":"2026-02-10T10:17:36Z","lastAt":"2026-02-12T17:13:46Z","messageCount":8,"participants":["Bello Caleb Olamide","Phillip Wood","Bello Olamide","Junio C Hamano"],"isPatch":true,"patchVersion":6,"patchTotal":3},"messages":[{"id":"535665","messageId":"aYsEpvFwCSHb5DYO@ubuntu","threadId":"64969","inReplyTo":null,"subject":"Re: [Outreachy PATCH v6 1/3] environment: stop storing `core.attributesFile` globally","fromName":"Bello Caleb Olamide","fromEmail":"belkid98@gmail.com","sentAt":"2026-02-10T10:17:21Z","receivedAt":"2026-02-10T10:17:36Z","isPatch":true,"sender":{"key":"belkid98@gmail.com","avatar":"https://avatars.githubusercontent.com/u/73387291?v=4"},"body":"This is how I implemented the suggestion\n\ndiff --git a/oss-fuzz/fuzz-commit-graph.c b/oss-fuzz/fuzz-commit-graph.c\nindex fb8b8787a4..59bbb849d1 100644\n--- a/oss-fuzz/fuzz-commit-graph.c\n+++ b/oss-fuzz/fuzz-commit-graph.c\n@@ -10,6 +10,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)\n {\n \tstruct commit_graph *g;\n \n+\tmemset(the_repository, 0, sizeof(*the_repository));\n \tinitialize_repository(the_repository);\n \n \t/*\ndiff --git a/repository.c b/repository.c\nindex c7e75215ac..0af40b016e 100644\n--- a/repository.c\n+++ b/repository.c\n@@ -50,13 +50,27 @@ static void set_default_hash_algo(struct repository *repo)\n \trepo_set_hash_algo(repo, algo);\n }\n \n+struct repo_config_values *repo_config_values(struct repository *repo)\n+{\n+\tif (repo != the_repository)\n+\t\tBUG(\"trying to read config from wrong repository instance\");\n+\tif(!repo->initialized)\n+\t\tBUG(\"config values from uninitialized repository\");\n+\treturn &repo->config_values_private_;\n+}\n+\n void initialize_repository(struct repository *repo)\n {\n+\tif (repo->initialized)\n+\t\tBUG(\"repository initialized already\");\n+\trepo->initialized = true;\n+\n \trepo->remote_state = remote_state_new();\n \trepo->parsed_objects = parsed_object_pool_new(repo);\n \tALLOC_ARRAY(repo->index, 1);\n \tindex_state_init(repo->index, repo);\n \trepo->check_deprecated_config = true;\n+\trepo_config_values_init(repo_config_values(repo));\n \n \t/*\n \t * When a command runs inside a repository, it learns what\n\nSome of the tests that fail are related to the submodule and a\ncouple output is shown below\n\n./t7412-submodule-absorbgitdirs.sh  -i -v\n...\nInitialized empty Git repository in /home/ubuntu/Code/open_source/git/t/trash directory.t7412-submodule-absorbgitdirs/sub1/.git/\n[master (root-commit) 50e526b] first\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 first.t\nBUG: repository.c:56: trying to read config from wrong repository instance\nAborted (core dumped)\nnot ok 1 - setup a real submodule\n#\n# cwd=\"$(pwd)\" &&\n# git init sub1 &&\n# test_commit -C sub1 first &&\n# git submodule add ./sub1 &&\n# test_tick &&\n# git commit -m superproject\n#\n1..1\n\n./t4027-diff-submodule.sh  -i -v\n...\nInitialized empty Git repository in /home/ubuntu/Code/open_source/git/t/trash directory.t4027-diff-submodule/sub/.git/\n[master (root-commit) 4431e0b] submodule\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n create mode 100644 world\nBUG: repository.c:56: trying to read config from wrong repository instance\nAborted (core dumped)\nnot ok 1 - setup\n#\n# test_tick &&\n# test_create_repo sub &&\n# (\n# cd sub &&\n# echo hello >world &&\n# git add world &&\n# git commit -m submodule\n# ) &&\n#\n# test_tick &&\n# echo frotz >nitfol &&\n# git add nitfol sub &&\n# git commit -m superproject &&\n#\n# (\n# cd sub &&\n# echo goodbye >world &&\n# git add world &&\n# git commit -m \"submodule #2\"\n# ) &&\n#\n# git -C sub rev-list HEAD >revs &&\n# set x $(cat revs) &&\n# echo \":160000 160000 $3 $ZERO_OID M sub\" >expect &&\n# subtip=$3 subprev=$2\n#\n1..1\n\nThanks\n"},{"id":"535681","messageId":"0a45d72a-2a11-4363-ad2b-9fabff70bc9f@gmail.com","threadId":"64969","inReplyTo":"aYsEpvFwCSHb5DYO@ubuntu","subject":"Re: [Outreachy PATCH v6 1/3] environment: stop storing `core.attributesFile` globally","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-10T15:07:41Z","receivedAt":"2026-02-10T15:07:44Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"On 10/02/2026 10:17, Bello Caleb Olamide wrote:\n\n> Initialized empty Git repository in /home/ubuntu/Code/open_source/git/t/trash directory.t4027-diff-submodule/sub/.git/\n> [master (root-commit) 4431e0b] submodule\n>   Author: A U Thor <author@example.com>\n>   1 file changed, 1 insertion(+)\n>   create mode 100644 world\n> BUG: repository.c:56: trying to read config from wrong repository instance\n> Aborted (core dumped)\n\nWhat does the backtrace show if you load the coredump into gdb? If \nyou're using systemd you should be able to run\n\n     coredumpctl gdb\n\nto start gdb on the last coredump (you can list them with \"coredumpctl \nlist\" if you need to select a different one) and then you can run\n\n     bt full\n\nin gdb to get a backtrace.\n\nIf you have an actual coredump file then you can just run \"gdb \npath/to/coredump\"\n\nThanks\n\nPhillip\n\n> not ok 1 - setup\n> #\n> # test_tick &&\n> # test_create_repo sub &&\n> # (\n> # cd sub &&\n> # echo hello >world &&\n> # git add world &&\n> # git commit -m submodule\n> # ) &&\n> #\n> # test_tick &&\n> # echo frotz >nitfol &&\n> # git add nitfol sub &&\n> # git commit -m superproject &&\n> #\n> # (\n> # cd sub &&\n> # echo goodbye >world &&\n> # git add world &&\n> # git commit -m \"submodule #2\"\n> # ) &&\n> #\n> # git -C sub rev-list HEAD >revs &&\n> # set x $(cat revs) &&\n> # echo \":160000 160000 $3 $ZERO_OID M sub\" >expect &&\n> # subtip=$3 subprev=$2\n> #\n> 1..1\n> \n> Thanks\n> \n\n"},{"id":"535739","messageId":"CAD=f0L8WwC8rkUVseKWme--xaJO5YnrKUmEVrr8w-KQxqLRCcQ@mail.gmail.com","threadId":"64969","inReplyTo":"0a45d72a-2a11-4363-ad2b-9fabff70bc9f@gmail.com","subject":"Re: [Outreachy PATCH v6 1/3] environment: stop storing `core.attributesFile` globally","fromName":"Bello Olamide","fromEmail":"belkid98@gmail.com","sentAt":"2026-02-11T08:05:45Z","receivedAt":"2026-02-11T08:05:46Z","isPatch":true,"sender":{"key":"belkid98@gmail.com","avatar":"https://avatars.githubusercontent.com/u/73387291?v=4"},"body":"On Tue, 10 Feb 2026 at 16:07, Phillip Wood <phillip.wood123@gmail.com> wrote:\n>\n> On 10/02/2026 10:17, Bello Caleb Olamide wrote:\n>\n> > Initialized empty Git repository in /home/ubuntu/Code/open_source/git/t/trash directory.t4027-diff-submodule/sub/.git/\n> > [master (root-commit) 4431e0b] submodule\n> >   Author: A U Thor <author@example.com>\n> >   1 file changed, 1 insertion(+)\n> >   create mode 100644 world\n> > BUG: repository.c:56: trying to read config from wrong repository instance\n> > Aborted (core dumped)\n>\n> What does the backtrace show if you load the coredump into gdb? If\n> you're using systemd you should be able to run\n>\n>      coredumpctl gdb\n>\n> to start gdb on the last coredump (you can list them with \"coredumpctl\n> list\" if you need to select a different one) and then you can run\n>\n>      bt full\n>\n> in gdb to get a backtrace.\n>\n> If you have an actual coredump file then you can just run \"gdb\n> path/to/coredump\"\n>\n\nThank you Phillip.\nI have been able to generate the backtrace\n\ncoredumpctl gdb\n           PID: 43422 (git)\n           UID: 1000 (ubuntu)\n           GID: 1000 (ubuntu)\n        Signal: 6 (ABRT)\n     Timestamp: Wed 2026-02-11 08:43:11 WAT (15s ago)\n  Command Line: git submodule--helper add -- ./S\n    Executable: /home/ubuntu/Code/open_source/git/git\n Control Group:\n/user.slice/user-1000.slice/user@1000.service/app.slice/app-org.gnome.Terminal.slice/vte-spawn-29116a64-3a3d-4a87-b321-1dd9a0e862c7.scope\n          Unit: user@1000.service\n     User Unit: vte-spawn-29116a64-3a3d-4a87-b321-1dd9a0e862c7.scope\n         Slice: user-1000.slice\n     Owner UID: 1000 (ubuntu)\n       Boot ID: a3430056a91d43f49b602796f4eafc8c\n    Machine ID: 4fb1781ac9f64d5cad47e77f1ed4f268\n      Hostname: ubuntu\n       Storage:\n/var/lib/systemd/coredump/core.git.1000.a3430056a91d43f49b602796f4eafc8c.43422.1770795791000000.zst\n(present)\n     Disk Size: 43.4K\n       Message: Process 43422 (git) of user 1000 dumped core.\n\n                Found module /home/ubuntu/Code/open_source/git/git\nwith build-id: d3afb1a6b38e0303f833747d30b120a5c520f40e\n                Found module linux-vdso.so.1 with build-id:\nc1c6868625bceb6f487c419392bd09e4edbfc5d9\n                Found module libc.so.6 with build-id:\n9f32d43c341bff10b9e7196738eedcfc4f3cc36c\n                Found module libz.so.1 with build-id:\nb781927da654e744ed29ff39815bef9c750eaf24\n                Found module libc_malloc_debug.so.0 with build-id:\n1e0d2faf0cfdf8b3b9940dc5937792836187f911\n                Stack trace of thread 43422:\n                #0  0x0000ffffb8802008 __pthread_kill_implementation\n(libc.so.6 + 0x82008)\n                #1  0x0000ffffb87ba83c __GI_raise (libc.so.6 + 0x3a83c)\n                #2  0x0000ffffb87a7134 __GI_abort (libc.so.6 + 0x27134)\n                #3  0x0000aaaab14af398 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x39f398)\n                #4  0x0000aaaab14af398 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x39f398)\n                #5  0x0000aaaab14af454 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x39f454)\n                #6  0x0000aaaab14257ac n/a\n(/home/ubuntu/Code/open_source/git/git + 0x3157ac)\n                #7  0x0000aaaab1425890 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x315890)\n                #8  0x0000aaaab142609c n/a\n(/home/ubuntu/Code/open_source/git/git + 0x31609c)\n                #9  0x0000aaaab142625c n/a\n(/home/ubuntu/Code/open_source/git/git + 0x31625c)\n                #10 0x0000aaaab13eeedc n/a\n(/home/ubuntu/Code/open_source/git/git + 0x2deedc)\n                #11 0x0000aaaab13eeab8 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x2deab8)\n                #12 0x0000aaaab1249088 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x139088)\n                #13 0x0000aaaab1249650 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x139650)\n                #14 0x0000aaaab1249c84 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x139c84)\n                #15 0x0000aaaab1132314 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x22314)\n                #16 0x0000aaaab11328b0 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x228b0)\n                #17 0x0000aaaab1132bd4 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x22bd4)\n                #18 0x0000aaaab1133074 n/a\n(/home/ubuntu/Code/open_source/git/git + 0x23074)\n                #19 0x0000aaaab125e86c n/a\n(/home/ubuntu/Code/open_source/git/git + 0x14e86c)\n                #20 0x0000ffffb87a7400 __libc_start_call_main\n(libc.so.6 + 0x27400)\n                #21 0x0000ffffb89cf370 n/a (n/a + 0x0)\n                #22 0x0000ffffb89cf370 n/a (n/a + 0x0)\n                #23 0x3d455441445f524f n/a (n/a + 0x0)\n\nGNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1\nCopyright (C) 2022 Free Software Foundation, Inc.\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law.\nType \"show copying\" and \"show warranty\" for details.\nThis GDB was configured as \"aarch64-linux-gnu\".\nType \"show configuration\" for configuration details.\nFor bug reporting instructions, please see:\n<https://www.gnu.org/software/gdb/bugs/>.\nFind the GDB manual and other documentation resources online at:\n    <http://www.gnu.org/software/gdb/documentation/>.\n\nFor help, type \"help\".\nType \"apropos word\" to search for commands related to \"word\"...\nReading symbols from /home/ubuntu/Code/open_source/git/git...\n[New LWP 43422]\n[Thread debugging using libthread_db enabled]\nUsing host libthread_db library \"/lib/aarch64-linux-gnu/libthread_db.so.1\".\nCore was generated by `git submodule--helper add -- ./S'.\nProgram terminated with signal SIGABRT, Aborted.\n#0  __pthread_kill_implementation (threadid=281473778995232,\nsigno=signo@entry=6,\n    no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44\n44 ./nptl/pthread_kill.c: No such file or directory.\n(gdb) bt full\n#0  __pthread_kill_implementation (threadid=281473778995232,\nsigno=signo@entry=6,\n    no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44\n        tid = 43422\n        ret = 0\n        pd = 0xffffb89c5020\n        old_mask = {__val = {16453191242184589568, 281474327489088,\n187650095641156,\n            281474327489568, 281474327489568, 281474327489520,\n18446743528248704984,\n            17298308644996116495, 17298308644996116495, 17298308644996116480,\n            16453191242184589568, 281474327488672, 187650095637040,\n281474327488752,\n            18446743042917400560, 281474327489088}}\n        ret = <optimized out>\n#1  0x0000ffffb8802054 in __pthread_kill_internal (signo=6,\nthreadid=<optimized out>)\n    at ./nptl/pthread_kill.c:78\nNo locals.\n#2  0x0000ffffb87ba83c in __GI_raise (sig=sig@entry=6) at\n../sysdeps/posix/raise.c:26\n        ret = <optimized out>\n#3  0x0000ffffb87a7134 in __GI_abort () at ./stdlib/abort.c:79\n        save_stage = 1\n        act = {__sigaction_handler = {sa_handler = 0xaaaad0012bfb,\n            sa_sigaction = 0xaaaad0012bfb}, sa_mask = {__val =\n{187650610900023, 0, 0,\n              0, 0, 0, 4294967295, 0, 187651416064000, 0, 281473778608136,\n              281474327489232, 187650095641436, 281474327489264,\n281473778608284,\n              187650610899888}}, sa_flags = -1, sa_restorer = 0x88}\n        sigs = {__val = {32, 187650096456616, 243494161448, 187650096456672,\n            281474327489824, 8099004987637978434, 3348833620946678639,\n            18374721914061273699, 281474327488992, 281474904195073,\n187650610899963,\n            187650610899963, 187650610899963, 187650610899963, 187650610899964,\n            187650610900023}}\n#4  0x0000aaaab14af398 in BUG_vfl (file=0xaaaab15763e0 \"repository.c\", line=56,\n    fmt=0xaaaab15763a8 \"trying to read config from wrong repository instance\",\n    params=...) at usage.c:350\n        params_copy = {__stack = 0xffffd94dac20, __gr_top = 0xffffd94dac20,\n          __vr_top = 0xffffd94dabf0, __gr_offs = -40, __vr_offs = -128}\n        in_bug = 1\n#5  0x0000aaaab14af454 in BUG_fl (file=0xaaaab15763e0 \"repository.c\", line=56,\n    fmt=0xaaaab15763a8 \"trying to read config from wrong repository instance\")\n--Type <RET> for more, q to quit, c to continue without paging--\n    at usage.c:360\n        ap = {__stack = 0xffffd94dac20, __gr_top = 0xffffd94dac20,\n          __vr_top = 0xffffd94dabf0, __gr_offs = -40, __vr_offs = -128}\n#6  0x0000aaaab14257ac in repo_config_values (repo=0xaaaad0012900) at\nrepository.c:56\nNo locals.\n#7  0x0000aaaab1425890 in initialize_repository (repo=0xaaaad0012900)\n    at repository.c:73\nNo locals.\n#8  0x0000aaaab142609c in repo_init (repo=0xaaaad0012900,\n    gitdir=0xaaaad0012b10 \"/home/ubuntu/Code/open_source/git/t/trash\ndirectory.t7422-submodule-output/S/.git\",\n    worktree=0xaaaad0012bb0 \"/home/ubuntu/Code/open_source/git/t/trash\ndirectory.t7422-submodule-output/S\") at repository.c:284\n        format = {version = -1, precious_objects = 0, partial_clone = 0x0,\n          worktree_config = 0, relative_worktrees = 0, is_bare = -1,\nhash_algo = 1,\n          compat_hash_algo = 0, ref_storage_format = REF_STORAGE_FORMAT_FILES,\n          sparse_index = 0, work_tree = 0x0, unknown_extensions = {items = 0x0,\n            nr = 0, alloc = 0, strdup_strings = 1, cmp = 0x0},\nv1_only_extensions = {\n            items = 0x0, nr = 0, alloc = 0, strdup_strings = 1, cmp = 0x0}}\n#9  0x0000aaaab142625c in repo_submodule_init (subrepo=0xaaaad0012900,\n    superproject=0xaaaab1656c98 <the_repo>, path=0xaaaad0012080 \"S\",\n    treeish_name=0xaaaab1558cc8 <null_oid_sha1>) at repository.c:329\n        gitdir = {alloc = 136, len = 81,\n          buf = 0xaaaad0012b10\n\"/home/ubuntu/Code/open_source/git/t/trash\ndirectory.t7422-submodule-output/S/.git\"}\n        worktree = {alloc = 136, len = 76,\n          buf = 0xaaaad0012bb0\n\"/home/ubuntu/Code/open_source/git/t/trash\ndirectory.t7422-submodule-output/S\"}\n        ret = 0\n#10 0x0000aaaab13eeedc in repo_get_submodule_ref_store (\n    repo=0xaaaab1656c98 <the_repo>, submodule=0xaaaad0012080 \"S\") at refs.c:2258\n        submodule_sb = {alloc = 24, len = 6, buf = 0xaaaad0012500 \"S/.git\"}\n        refs = 0x0\n        to_free = 0x0\n        len = 1\n        subrepo = 0xaaaad0012900\n--Type <RET> for more, q to quit, c to continue without paging--\n#11 0x0000aaaab13eeab8 in repo_resolve_gitlink_ref (r=0xaaaab1656c98 <the_repo>,\n    submodule=0xaaaad0012080 \"S\", refname=0xaaaab1537d50 \"HEAD\",\noid=0xffffd94dae80)\n    at refs.c:2141\n        refs = 0x1\n        flags = 1\n#12 0x0000aaaab1249088 in die_on_repo_without_commits (path=0xaaaad0012080 \"S\")\n    at builtin/submodule--helper.c:3423\n        oid = {hash = '\\000' <repeats 24 times>, \"\\200\n\\001\\u042a\\252\\000\", algo = 0}\n        sb = {alloc = 24, len = 1, buf = 0xaaaad00125f0 \"S\"}\n#13 0x0000aaaab1249650 in module_add (argc=1, argv=0xaaaad0010ce0, prefix=0x0,\n    repo=0xaaaab1656c98 <the_repo>) at builtin/submodule--helper.c:3522\n        force = 0\n        quiet = 0\n        progress = 0\n        dissociate = 0\n        add_data = {prefix = 0x0, branch = 0x0, reference_path = 0x0,\n          sm_path = 0xaaaad0012080 \"S\", sm_name = 0x0, repo =\n0xaaaad0010ae0 \"./S\",\n          realrepo = 0xaaaad0012590\n\"/home/ubuntu/Code/open_source/git/t/trash\ndirectory.t7422-submodule-output/S\", ref_storage_format =\nREF_STORAGE_FORMAT_UNKNOWN,\n          depth = -1, force = 0, quiet = 0, progress = 0, dissociate = 0}\n        ref_storage_format = 0x0\n        to_free = 0xaaaad0012590\n\"/home/ubuntu/Code/open_source/git/t/trash\ndirectory.t7422-submodule-output/S\"\n        existing = 0xaaaab156aa08\n        buf = {alloc = 0, len = 0, buf = 0xaaaab16572f8 <strbuf_slopbuf> \"\"}\n        sm_name_to_free = 0x0\n        options = {{type = OPTION_STRING, short_name = 98,\n            long_name = 0xaaaab1539658 \"branch\", value = 0xffffd94daf60,\n            precision = 0, argh = 0xaaaab1539658 \"branch\",\n            help = 0xaaaab1539c80 \"branch of repository to add as submodule\",\n            flags = 0, callback = 0x0, defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0x0}, {type = OPTION_COUNTUP, short_name = 102,\n            long_name = 0xaaaab1538070 \"force\", value =\n0xffffd94daee8, precision = 4,\n            argh = 0x0,\n            help = 0xaaaab1539cb0 \"allow adding an otherwise ignored\nsubmodule path\",\n            flags = (PARSE_OPT_NOARG | PARSE_OPT_NOCOMPLETE), callback = 0x0,\n--Type <RET> for more, q to quit, c to continue without paging--\n            defval = 0, ll_callback = 0x0, extra = 0, subcommand_fn = 0x0}, {\n            type = OPTION_COUNTUP, short_name = 113,\n            long_name = 0xaaaab15375e0 \"quiet\", value =\n0xffffd94daeec, precision = 4,\n            argh = 0x0, help = 0xaaaab1539748 \"print only error messages\",\n            flags = PARSE_OPT_NOARG, callback = 0x0, defval = 0,\nll_callback = 0x0,\n            extra = 0, subcommand_fn = 0x0}, {type = OPTION_SET_INT,\nshort_name = 0,\n            long_name = 0xaaaab15387a0 \"progress\", value = 0xffffd94daef0,\n            precision = 4, argh = 0x0, help = 0xaaaab15387b0 \"force\ncloning progress\",\n            flags = PARSE_OPT_NOARG, callback = 0x0, defval = 1,\nll_callback = 0x0,\n            extra = 0, subcommand_fn = 0x0}, {type = OPTION_STRING,\nshort_name = 0,\n            long_name = 0xaaaab15386a8 \"reference\", value = 0xffffd94daf68,\n            precision = 0, argh = 0xaaaab1539ce8 \"repository\",\n            help = 0xaaaab15386c0 \"reference repository\", flags = 0,\ncallback = 0x0,\n            defval = 0, ll_callback = 0x0, extra = 0, subcommand_fn = 0x0}, {\n            type = OPTION_STRING, short_name = 0,\n            long_name = 0xaaaab15386d8 \"ref-format\", value = 0xffffd94daf00,\n            precision = 0, argh = 0xaaaab15386e8 \"format\",\n            help = 0xaaaab15386f0 \"specify the reference format to\nuse\", flags = 0,\n            callback = 0x0, defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0x0}, {type = OPTION_SET_INT, short_name = 0,\n            long_name = 0xaaaab1538718 \"dissociate\", value = 0xffffd94daef4,\n            precision = 4, argh = 0x0,\n            help = 0xaaaab1539cf8 \"borrow the objects from reference\nrepositories\",\n            flags = PARSE_OPT_NOARG, callback = 0x0, defval = 1,\nll_callback = 0x0,\n            extra = 0, subcommand_fn = 0x0}, {type = OPTION_STRING,\nshort_name = 0,\n            long_name = 0xaaaab1538648 \"name\", value = 0xffffd94daf78,\nprecision = 0,\n            argh = 0xaaaab1538648 \"name\",\n            help = 0xaaaab1539d28 \"sets the submodule's name to the\ngiven string instead of defaulting to its path\", flags = 0, callback =\n0x0, defval = 0, ll_callback = 0x0,\n            extra = 0, subcommand_fn = 0x0}, {type = OPTION_INTEGER,\nshort_name = 0,\n            long_name = 0xaaaab1538750 \"depth\", value =\n0xffffd94daf94, precision = 4,\n            argh = 0xaaaab1537cf0 \"n\",\n            help = 0xaaaab1538758 \"depth for shallow clones\", flags = 0,\n            callback = 0x0, defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0x0}, {type = OPTION_END, short_name = 0,\nlong_name = 0x0,\n            value = 0x0, precision = 0, argh = 0x0, help = 0x0, flags = 0,\n--Type <RET> for more, q to quit, c to continue without paging--\n            callback = 0x0, defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0x0}}\n        usage = {\n          0xaaaab1539d78 \"git submodule add [<options>] [--]\n<repository> [<path>]\",\n          0x0}\n        sb = {alloc = 0, len = 0, buf = 0xaaaab16572f8 <strbuf_slopbuf> \"\"}\n        ret = 1\n#14 0x0000aaaab1249c84 in cmd_submodule__helper (argc=3, argv=0xaaaad0010ce0,\n    prefix=0x0, repo=0xaaaab1656c98 <the_repo>) at\nbuiltin/submodule--helper.c:3616\n        fn = 0xaaaab12490dc <module_add>\n        usage = {0xaaaab1539ec0 \"git submodule--helper <command>\", 0x0}\n        options = {{type = OPTION_SUBCOMMAND, short_name = 0,\n            long_name = 0xaaaab15384b8 \"clone\", value =\n0xffffd94db430, precision = 0,\n            argh = 0x0, help = 0x0, flags = 0, callback = 0x0, defval = 0,\n            ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab124403c <module_clone>}, {type =\nOPTION_SUBCOMMAND,\n            short_name = 0, long_name = 0xaaaab1539b98 \"add\", value =\n0xffffd94db430,\n            precision = 0, argh = 0x0, help = 0x0, flags = 0, callback = 0x0,\n            defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab12490dc <module_add>}, {type =\nOPTION_SUBCOMMAND,\n            short_name = 0, long_name = 0xaaaab1538f78 \"update\",\n            value = 0xffffd94db430, precision = 0, argh = 0x0, help =\n0x0, flags = 0,\n            callback = 0x0, defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab1246e44 <module_update>}, {\n            type = OPTION_SUBCOMMAND, short_name = 0,\n            long_name = 0xaaaab1537500 \"foreach\", value = 0xffffd94db430,\n            precision = 0, argh = 0x0, help = 0x0, flags = 0, callback = 0x0,\n            defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab123fe24 <module_foreach>}, {\n            type = OPTION_SUBCOMMAND, short_name = 0,\n            long_name = 0xaaaab1539110 \"init\", value = 0xffffd94db430,\nprecision = 0,\n            argh = 0x0, help = 0x0, flags = 0, callback = 0x0, defval = 0,\n            ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab1240418 <module_init>}, {type =\nOPTION_SUBCOMMAND,\n            short_name = 0, long_name = 0xaaaab15378e8 \"status\",\n            value = 0xffffd94db430, precision = 0, argh = 0x0, help =\n0x0, flags = 0,\n--Type <RET> for more, q to quit, c to continue without paging--\n            callback = 0x0, defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab1240ca8 <module_status>}, {\n            type = OPTION_SUBCOMMAND, short_name = 0,\n            long_name = 0xaaaab1537e48 \"sync\", value = 0xffffd94db430,\nprecision = 0,\n            argh = 0x0, help = 0x0, flags = 0, callback = 0x0, defval = 0,\n            ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab1242a0c <module_sync>}, {type =\nOPTION_SUBCOMMAND,\n            short_name = 0, long_name = 0xaaaab1539ee0 \"deinit\",\n            value = 0xffffd94db430, precision = 0, argh = 0x0, help =\n0x0, flags = 0,\n            callback = 0x0, defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab1243074 <module_deinit>}, {\n            type = OPTION_SUBCOMMAND, short_name = 0,\n            long_name = 0xaaaab1539ee8 \"summary\", value = 0xffffd94db430,\n            precision = 0, argh = 0x0, help = 0x0, flags = 0, callback = 0x0,\n            defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab1242164 <module_summary>}, {\n            type = OPTION_SUBCOMMAND, short_name = 0,\n            long_name = 0xaaaab1539ef0 \"push-check\", value = 0xffffd94db430,\n            precision = 0, argh = 0x0, help = 0x0, flags = 0, callback = 0x0,\n            defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab12476f4 <push_check>}, {type =\nOPTION_SUBCOMMAND,\n            short_name = 0, long_name = 0xaaaab1539f00 \"absorbgitdirs\",\n            value = 0xffffd94db430, precision = 0, argh = 0x0, help =\n0x0, flags = 0,\n            callback = 0x0, defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab12479a8 <absorb_git_dirs>}, {\n            type = OPTION_SUBCOMMAND, short_name = 0,\n            long_name = 0xaaaab1539f10 \"set-url\", value = 0xffffd94db430,\n            precision = 0, argh = 0x0, help = 0x0, flags = 0, callback = 0x0,\n            defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab1247b40 <module_set_url>}, {\n            type = OPTION_SUBCOMMAND, short_name = 0,\n            long_name = 0xaaaab1539f18 \"set-branch\", value = 0xffffd94db430,\n            precision = 0, argh = 0x0, help = 0x0, flags = 0, callback = 0x0,\n            defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab1247d74 <module_set_branch>}, {\n            type = OPTION_SUBCOMMAND, short_name = 0,\n--Type <RET> for more, q to quit, c to continue without paging--\n            long_name = 0xaaaab1539f28 \"create-branch\", value = 0xffffd94db430,\n            precision = 0, argh = 0x0, help = 0x0, flags = 0, callback = 0x0,\n            defval = 0, ll_callback = 0x0, extra = 0,\n            subcommand_fn = 0xaaaab1248038 <module_create_branch>}, {\n            type = OPTION_END, short_name = 0, long_name = 0x0, value = 0x0,\n            precision = 0, argh = 0x0, help = 0x0, flags = 0, callback = 0x0,\n            defval = 0, ll_callback = 0x0, extra = 0, subcommand_fn = 0x0}}\n#15 0x0000aaaab1132314 in run_builtin (p=0xaaaab1624be8 <commands+3024>, argc=4,\n    argv=0xaaaad0010ce0, repo=0xaaaab1656c98 <the_repo>) at git.c:506\n        status = 0\n        help = 0\n        no_repo = 0\n        st = {st_dev = 187650095680628, st_ino = 281474327493248,\n          st_mode = 2974518388, st_nlink = 43690, st_uid = 3645750856,\nst_gid = 65535,\n          st_rdev = 5, __pad1 = 187650097155112, st_size = 281473779032128,\n          st_blksize = -1322915768, __pad2 = 43690, st_blocks = 40, st_atim = {\n            tv_sec = 281474327493280, tv_nsec = 187650091976020}, st_mtim = {\n            tv_sec = 5, tv_nsec = 8}, st_ctim = {tv_sec = 281474327493408,\n            tv_nsec = 187650091985032}, __glibc_reserved = {8, 0}}\n        prefix = 0x0\n        run_setup = 1\n        __PRETTY_FUNCTION__ = \"run_builtin\"\n#16 0x0000aaaab11328b0 in handle_builtin (args=0xffffd94dbc50) at git.c:779\n        argv_copy = 0xaaaad0010ce0\n        ret = 43690\n        cmd = 0xaaaad00109b0 \"submodule--helper\"\n        builtin = 0xaaaab1624be8 <commands+3024>\n#17 0x0000aaaab1132bd4 in run_argv (args=0xffffd94dbc50) at git.c:862\n        done_alias = 0\n        expanded_aliases = {items = 0x0, nr = 0, alloc = 0, strdup_strings = 1,\n          cmp = 0x0}\n#18 0x0000aaaab1133074 in cmd_main (argc=4, argv=0xffffd94dbe50) at git.c:984\n        was_alias = 65535\n        args = {v = 0xaaaad00109d0, nr = 4, alloc = 24}\n        cmd = 0xffffd94dc7ff \"submodule--helper\"\n        done_help = 0\n--Type <RET> for more, q to quit, c to continue without paging--\n#19 0x0000aaaab125e86c in main (argc=5, argv=0xffffd94dbe48) at common-main.c:9\n        result = 0\n"},{"id":"535742","messageId":"37abfe28-ff89-460a-962d-4503ec3f7975@gmail.com","threadId":"64969","inReplyTo":"aYsEpvFwCSHb5DYO@ubuntu","subject":"Re: [Outreachy PATCH v6 1/3] environment: stop storing `core.attributesFile` globally","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-11T09:31:53Z","receivedAt":"2026-02-11T09:31:58Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Thanks for the backtrace which helped me spot the problem though I \nshould have spotted this yesterday. The problem is in \ninitialize_repository()\n\n>   void initialize_repository(struct repository *repo)\n>   {\n> +\tif (repo->initialized)\n> +\t\tBUG(\"repository initialized already\");\n> +\trepo->initialized = true;\n> +\n>   \trepo->remote_state = remote_state_new();\n>   \trepo->parsed_objects = parsed_object_pool_new(repo);\n>   \tALLOC_ARRAY(repo->index, 1);\n>   \tindex_state_init(repo->index, repo);\n>   \trepo->check_deprecated_config = true;\n> +\trepo_config_values_init(repo_config_values(repo));\n\nHere you need to use repo->config_values_private_ instead of using the \naccessor as it is fine to initialize the config values to their defaults \nin any instance, it is only when we read them that we want to assert \nthat we're reading from \"the_repository\".\n\nThanks\n\nPhillip\n\n>   \n>   \t/*\n>   \t * When a command runs inside a repository, it learns what\n> \n> Some of the tests that fail are related to the submodule and a\n> couple output is shown below\n> \n> ./t7412-submodule-absorbgitdirs.sh  -i -v\n> ...\n> Initialized empty Git repository in /home/ubuntu/Code/open_source/git/t/trash directory.t7412-submodule-absorbgitdirs/sub1/.git/\n> [master (root-commit) 50e526b] first\n>   Author: A U Thor <author@example.com>\n>   1 file changed, 1 insertion(+)\n>   create mode 100644 first.t\n> BUG: repository.c:56: trying to read config from wrong repository instance\n> Aborted (core dumped)\n> not ok 1 - setup a real submodule\n> #\n> # cwd=\"$(pwd)\" &&\n> # git init sub1 &&\n> # test_commit -C sub1 first &&\n> # git submodule add ./sub1 &&\n> # test_tick &&\n> # git commit -m superproject\n> #\n> 1..1\n> \n> ./t4027-diff-submodule.sh  -i -v\n> ...\n> Initialized empty Git repository in /home/ubuntu/Code/open_source/git/t/trash directory.t4027-diff-submodule/sub/.git/\n> [master (root-commit) 4431e0b] submodule\n>   Author: A U Thor <author@example.com>\n>   1 file changed, 1 insertion(+)\n>   create mode 100644 world\n> BUG: repository.c:56: trying to read config from wrong repository instance\n> Aborted (core dumped)\n> not ok 1 - setup\n> #\n> # test_tick &&\n> # test_create_repo sub &&\n> # (\n> # cd sub &&\n> # echo hello >world &&\n> # git add world &&\n> # git commit -m submodule\n> # ) &&\n> #\n> # test_tick &&\n> # echo frotz >nitfol &&\n> # git add nitfol sub &&\n> # git commit -m superproject &&\n> #\n> # (\n> # cd sub &&\n> # echo goodbye >world &&\n> # git add world &&\n> # git commit -m \"submodule #2\"\n> # ) &&\n> #\n> # git -C sub rev-list HEAD >revs &&\n> # set x $(cat revs) &&\n> # echo \":160000 160000 $3 $ZERO_OID M sub\" >expect &&\n> # subtip=$3 subprev=$2\n> #\n> 1..1\n> \n> Thanks\n> \n\n"},{"id":"535761","messageId":"CAD=f0L8Mz2jLMnkyvAUbtDC65RwKSk6Q-ZgB3+pLFpJo_DN9qw@mail.gmail.com","threadId":"64969","inReplyTo":"37abfe28-ff89-460a-962d-4503ec3f7975@gmail.com","subject":"Re: [Outreachy PATCH v6 1/3] environment: stop storing `core.attributesFile` globally","fromName":"Bello Olamide","fromEmail":"belkid98@gmail.com","sentAt":"2026-02-11T12:05:17Z","receivedAt":"2026-02-11T12:05:21Z","isPatch":true,"sender":{"key":"belkid98@gmail.com","avatar":"https://avatars.githubusercontent.com/u/73387291?v=4"},"body":"On Wed, 11 Feb 2026 at 10:31, Phillip Wood <phillip.wood123@gmail.com> wrote:\n>\n> Thanks for the backtrace which helped me spot the problem though I\n> should have spotted this yesterday. The problem is in\n> initialize_repository()\n>\n> >   void initialize_repository(struct repository *repo)\n> >   {\n> > +     if (repo->initialized)\n> > +             BUG(\"repository initialized already\");\n> > +     repo->initialized = true;\n> > +\n> >       repo->remote_state = remote_state_new();\n> >       repo->parsed_objects = parsed_object_pool_new(repo);\n> >       ALLOC_ARRAY(repo->index, 1);\n> >       index_state_init(repo->index, repo);\n> >       repo->check_deprecated_config = true;\n> > +     repo_config_values_init(repo_config_values(repo));\n>\n> Here you need to use repo->config_values_private_ instead of using the\n> accessor as it is fine to initialize the config values to their defaults\n> in any instance, it is only when we read them that we want to assert\n> that we're reading from \"the_repository\".\n>\n\nOkay thank you very much.\nI will send an updated version.\n"},{"id":"535782","messageId":"xmqq5x83w7m1.fsf@gitster.g","threadId":"64969","inReplyTo":"37abfe28-ff89-460a-962d-4503ec3f7975@gmail.com","subject":"Re: [Outreachy PATCH v6 1/3] environment: stop storing `core.attributesFile` globally","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-11T16:46:46Z","receivedAt":"2026-02-11T16:46:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n> Thanks for the backtrace which helped me spot the problem though I \n> should have spotted this yesterday. The problem is in \n> initialize_repository()\n>\n>>   void initialize_repository(struct repository *repo)\n>>   {\n>> +\tif (repo->initialized)\n>> +\t\tBUG(\"repository initialized already\");\n>> +\trepo->initialized = true;\n>> +\n>>   \trepo->remote_state = remote_state_new();\n>>   \trepo->parsed_objects = parsed_object_pool_new(repo);\n>>   \tALLOC_ARRAY(repo->index, 1);\n>>   \tindex_state_init(repo->index, repo);\n>>   \trepo->check_deprecated_config = true;\n>> +\trepo_config_values_init(repo_config_values(repo));\n>\n> Here you need to use repo->config_values_private_ instead of using the \n> accessor as it is fine to initialize the config values to their defaults \n> in any instance, it is only when we read them that we want to assert \n> that we're reading from \"the_repository\".\n\nSorry, but ...\n\nAt the beginning of repo_config_values() in the patch, there is a\ncheck to ensure that repo->initialized is true and otherwise you get\nan error.  But the initialization is already done in the early part\nof initialize_repository() as quoted above.  So I do not see what\ndifference it would make if we rewrote the last line as\n\n\trepo_config_values_init(&repo->config_values_private_);\n\nI am confused.\n\n"},{"id":"535855","messageId":"7d9e0e9b-4565-492c-81b7-2471a916015e@gmail.com","threadId":"64969","inReplyTo":"xmqq5x83w7m1.fsf@gitster.g","subject":"Re: [Outreachy PATCH v6 1/3] environment: stop storing `core.attributesFile` globally","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2026-02-12T10:33:33Z","receivedAt":"2026-02-12T10:33:39Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"On 11/02/2026 16:46, Junio C Hamano wrote:\n> Phillip Wood <phillip.wood123@gmail.com> writes:\n> \n> At the beginning of repo_config_values() in the patch, there is a\n> check to ensure that repo->initialized is true and otherwise you get\n> an error.  But the initialization is already done in the early part\n> of initialize_repository() as quoted above.  So I do not see what\n> difference it would make if we rewrote the last line as\n\nIn Bello's patch there is a second assertion in repo_config_values() \nthat checks \"repo == the_repository\" and that one fails. I suggested \nadding it because the config values are still global rather than per \nrepository so we should only be reading them from \"the_repository\".\n\nThanks\n\nPhillip\n\n> \trepo_config_values_init(&repo->config_values_private_);\n> \n> I am confused.\n> \n\n"},{"id":"535875","messageId":"xmqqy0kxq3zt.fsf@gitster.g","threadId":"64969","inReplyTo":"7d9e0e9b-4565-492c-81b7-2471a916015e@gmail.com","subject":"Re: [Outreachy PATCH v6 1/3] environment: stop storing `core.attributesFile` globally","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-12T17:13:42Z","receivedAt":"2026-02-12T17:13:46Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n> On 11/02/2026 16:46, Junio C Hamano wrote:\n>> Phillip Wood <phillip.wood123@gmail.com> writes:\n>> \n>> At the beginning of repo_config_values() in the patch, there is a\n>> check to ensure that repo->initialized is true and otherwise you get\n>> an error.  But the initialization is already done in the early part\n>> of initialize_repository() as quoted above.  So I do not see what\n>> difference it would make if we rewrote the last line as\n>\n> In Bello's patch there is a second assertion in repo_config_values() \n> that checks \"repo == the_repository\" and that one fails. I suggested \n> adding it because the config values are still global rather than per \n> repository so we should only be reading them from \"the_repository\".\n\nAh, OK.  It may indeed be a good safety valve with the current\ncodebase.  I am not sure what the upgrade path would look like from\nthere, though.\n\nThanks.\n"}]}