{"thread":{"id":"63302","subject":"[PATCH 0/4] update MyFirstContribution with current code base","startedAt":"2025-04-16T06:14:56Z","lastAt":"2025-05-20T14:15:28Z","messageCount":37,"participants":["K Jayatheerth","Junio C Hamano","JAYATHEERTH K","Emily Shaffer","D. Ben Knoble"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"516253","messageId":"20250416061450.25695-1-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":null,"subject":"[PATCH 0/4] update MyFirstContribution with current code base","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-04-16T06:14:46Z","receivedAt":"2025-04-16T06:14:56Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"A series of patches extending my GSOC microproject\nFixing the documentation MyFirstContribution.adoc\n\nUpdated various commits since the last patches sent.\n\nFeedbacks taken to write detailed commit messages\n\nK Jayatheerth (4):\n  Remove unused git-mentoring mailing list\n  Docs: Correct cmd_psuh and Explain UNUSED macro\n  Docs: Add cmd_psuh with repo and UNUSED removal\n  cmd_psuh: Prefer repo_config for config lookup\n\n Documentation/MyFirstContribution.adoc | 89 ++++++++++++++++++--------\n 1 file changed, 62 insertions(+), 27 deletions(-)\n\n-- \n2.49.GIT\n\n"},{"id":"516254","messageId":"20250416061450.25695-2-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250416061450.25695-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH 1/4] Remove unused git-mentoring mailing list","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-04-16T06:14:47Z","receivedAt":"2025-04-16T06:15:02Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"This commit removes the details,\nabout the git-mentoring@googlegroups.com mailing list.\n\nReason: This mentoring mailing list is no longer actively used.\nNew contributors often use the main Git mailing list,\ntheir queries almost always gets answered.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 8 --------\n 1 file changed, 8 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex ca1d688c9b..ef190d8748 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -40,14 +40,6 @@ the list by sending an email to <git+subscribe@vger.kernel.org>\n The https://lore.kernel.org/git[archive] of this mailing list is\n available to view in a browser.\n \n-==== https://groups.google.com/forum/#!forum/git-mentoring[git-mentoring@googlegroups.com]\n-\n-This mailing list is targeted to new contributors and was created as a place to\n-post questions and receive answers outside of the public eye of the main list.\n-Veteran contributors who are especially interested in helping mentor newcomers\n-are present on the list. In order to avoid search indexers, group membership is\n-required to view messages; anyone can join and no approval is required.\n-\n ==== https://web.libera.chat/#git-devel[#git-devel] on Libera Chat\n \n This IRC channel is for conversations between Git contributors. If someone is\n-- \n2.49.GIT\n\n"},{"id":"516255","messageId":"20250416061450.25695-3-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250416061450.25695-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH 2/4] Docs: Correct cmd_psuh and Explain UNUSED macro","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-04-16T06:14:48Z","receivedAt":"2025-04-16T06:15:12Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"The `cmd_psuh` function signature in the documentation,\nwas missing the `struct repository *repo` argument,\nwhich is standard for built-in commands.\nThis commit corrects the signature to include the `repo` argument.\n\nAdditionally, this commit adds an explanation,\nfor using the `UNUSED` macro to prevent compiler warnings.\n\nThis helps new contributors understand,\ncommon practices in the Git codebase.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 10 +++++++++-\n 1 file changed, 9 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex ef190d8748..b463d42f63 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -142,7 +142,15 @@ command in `builtin/psuh.c`. Create that file, and within it, write the entry\n point for your command in a function matching the style and signature:\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix)\n+int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo)\n+----\n+\n+We also use the UNUSED macro to make sure we don't recieve compiler warnings\n+for unused arguments from the function cmd_psuh.\n+\n+----\n+int cmd_psuh(int argc UNUSED, const char **argv UNUSED, \n+\t\t\tconst char *prefix UNUSED, struct repository *repo UNUSED)\n ----\n \n We'll also need to add the declaration of psuh; open up `builtin.h`, find the\n-- \n2.49.GIT\n\n"},{"id":"516256","messageId":"20250416061450.25695-4-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250416061450.25695-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH 3/4] Docs: Add cmd_psuh with repo and UNUSED removal","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-04-16T06:14:49Z","receivedAt":"2025-04-16T06:15:15Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"This commit improves the `cmd_psuh` documentation example by:\n\nCorrecting the function signature to include struct repository *repo.\nMakes the signature accurate and consistent with typical Git built-in\ncommands.\n\nRemoving the `UNUSED` macros from the `cmd_psuh` function arguments\n(argc, argv, prefix, repo). This is done because the example now\nuses these arguments.\n\nShowing how to access the repository's Git directory (repo->gitdir)\nwithin the cmd_psuh function. This provides a practical example of\nhow to use the repo argument and repository-related information.\n\nKeeps your existing printf() calls in place.\nThis lets the users see the arguments which is given to the function.\n\nThis enhanced example provides a more complete illustration of\nAdding a Git built-in command and use the repository argument.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 19 ++++++++++++++++---\n 1 file changed, 16 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex b463d42f63..ed6dcc1fc6 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -158,7 +158,7 @@ declaration for `cmd_pull`, and add a new line for `psuh` immediately before it,\n in order to keep the declarations alphabetically sorted:\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix);\n+int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo);\n ----\n \n Be sure to `#include \"builtin.h\"` in your `psuh.c`. You'll also need to\n@@ -174,7 +174,8 @@ Throughout the tutorial, we will mark strings for translation as necessary; you\n should also do so when writing your user-facing commands in the future.\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix)\n+int cmd_psuh(int argc UNUSED, const char **argv UNUSED, \n+\t\t\tconst char *prefix UNUSED, struct repository *repo UNUSED)\n {\n \tprintf(_(\"Pony saying hello goes here.\\n\"));\n \treturn 0;\n@@ -287,10 +288,14 @@ on the reference implementation linked at the top of this document.\n It's probably useful to do at least something besides printing out a string.\n Let's start by having a look at everything we get.\n \n-Modify your `cmd_psuh` implementation to dump the args you're passed, keeping\n+Modify your `cmd_psuh` implementation to dump the args you're passed\n+and removing the UNUSED macro from them, keeping\n existing `printf()` calls in place:\n \n ----\n+int cmd_psuh(int argc, const char **argv, \n+\t\t\tconst char *prefix, struct repository *repo)\n+{\n \tint i;\n \n \t...\n@@ -305,6 +310,14 @@ existing `printf()` calls in place:\n \tprintf(_(\"Your current working directory:\\n<top-level>%s%s\\n\"),\n \t       prefix ? \"/\" : \"\", prefix ? prefix : \"\");\n \n+\tif (repo && repo->gitdir) {\n+        printf(_(\"Git directory: %s\\n\"), repo->gitdir);\n+    } else {\n+        printf(_(\"No Git directory found.\\n\"));\n+    }\n+\n+\t...\n+}\n ----\n \n Build and try it. As you may expect, there's pretty much just whatever we give\n-- \n2.49.GIT\n\n"},{"id":"516257","messageId":"20250416061450.25695-5-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250416061450.25695-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH 4/4] cmd_psuh: Prefer repo_config for config lookup","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-04-16T06:14:50Z","receivedAt":"2025-04-16T06:15:17Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"This commit updates cmd_psuh to use repo_config and\nrepo_config_get_string_tmp for retrieving the user.name config\nvariable. This is a more robust and correct approach than using the\nglobal git_config functions because:\n\ngit_config uses the global configuration, ignoring any\nrepository-specific settings (e.g., in .git/config). repo_config\nloads the configuration specific to the repository,\nensuring that the correct settings are used.\n\nrepo_config_get_string_tmp retrieves configuration values\nrelative to the repository, respecting any local overrides.\n\nThis change ensures that cmd_psuh correctly reads the\nuser.name setting that applies to the current repository,\nrather than relying on globalsettings that might be\nincorrect or misleading. It also demonstrates the correct way\nto access repository-specific configuration within Git commands.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 52 ++++++++++++++++++--------\n 1 file changed, 37 insertions(+), 15 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex ed6dcc1fc6..688240ce8b 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -325,26 +325,48 @@ on the command line, including the name of our command. (If `prefix` is empty\n for you, try `cd Documentation/ && ../bin-wrappers/git psuh`). That's not so\n helpful. So what other context can we get?\n \n-Add a line to `#include \"config.h\"`. Then, add the following bits to the\n-function body:\n+Add a line to `#include \"config.h\"` and `#include \"repository.h\"`. \n+Then, add the following bits to the function body:\n \n ----\n-\tconst char *cfg_name;\n+#include \"builtin.h\"\n+#include \"gettext.h\"\n+#include \"config.h\"\n+#include \"repository.h\"  \n \n-...\n+int cmd_psuh(int argc, const char **argv, \n+\t\t\tconst char *prefix, struct repository *repo)\n+{\n+    const char *cfg_name;\n+\n+    printf(Q_(\"Your args (there is %d):\\n\",\n+              \"Your args (there are %d):\\n\",\n+              argc),\n+           argc);\n \n-\tgit_config(git_default_config, NULL);\n-\tif (git_config_get_string_tmp(\"user.name\", &cfg_name) > 0)\n-\t\tprintf(_(\"No name is found in config\\n\"));\n-\telse\n-\t\tprintf(_(\"Your name: %s\\n\"), cfg_name);\n+    for (int i = 0; i < argc; i++) {\n+        printf(\"%d: %s\\n\", i, argv[i]);\n+    }\n+\n+    printf(_(\"Your current working directory:\\n<top-level>%s%s\\n\"),\n+           prefix ? \"/\" : \"\", prefix ? prefix : \"\");\n+\n+    repo_config(repo, git_default_config, NULL);\n+\n+    if (repo_config_get_string_tmp(repo, \"user.name\", &cfg_name))\n+        printf(_(\"No name is found in config\\n\"));\n+    else\n+        printf(_(\"Your name: %s\\n\"), cfg_name);\n+\n+    return 0;\n+}\n ----\n \n-`git_config()` will grab the configuration from config files known to Git and\n-apply standard precedence rules. `git_config_get_string_tmp()` will look up\n+`repo_config()` will grab the configuration from config files known to Git and\n+apply standard precedence rules. `repo_config_get_string_tmp()` will look up\n a specific key (\"user.name\") and give you the value. There are a number of\n single-key lookup functions like this one; you can see them all (and more info\n-about how to use `git_config()`) in `Documentation/technical/api-config.adoc`.\n+about how to use `repo_config()`) in `Documentation/technical/api-config.adoc`.\n \n You should see that the name printed matches the one you see when you run:\n \n@@ -377,7 +399,7 @@ status_init_config(&s, git_status_config);\n ----\n \n But as we drill down, we can find that `status_init_config()` wraps a call\n-to `git_config()`. Let's modify the code we wrote in the previous commit.\n+to `repo_config()`. Let's modify the code we wrote in the previous commit.\n \n Be sure to include the header to allow you to use `struct wt_status`:\n \n@@ -393,8 +415,8 @@ prepare it, and print its contents:\n \n ...\n \n-\twt_status_prepare(the_repository, &status);\n-\tgit_config(git_default_config, &status);\n+\twt_status_prepare(repo, &status);\n+\trepo_config(repo, git_default_config, &status);\n \n ...\n \n-- \n2.49.GIT\n\n"},{"id":"516288","messageId":"xmqqr01si441.fsf@gitster.g","threadId":"63302","inReplyTo":"20250416061450.25695-1-jayatheerthkulkarni2005@gmail.com","subject":"Re: [PATCH 0/4] update MyFirstContribution with current code base","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-04-16T14:16:14Z","receivedAt":"2025-04-16T14:16:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"K Jayatheerth <jayatheerthkulkarni2005@gmail.com> writes:\n\n    To: git@vger.kernel.org\n    Cc: Junio C Hamano <gitster@pobox.com>, jayatheerthkulkarni2005@gmail.com\n\nPick a better reviewer than me if you want your patches reviewed\nmore quickly, perhaps?  I had only 3 patches to the file in the past\n3 years, while there are others who had their hands to the file with\nmore changes.  \"git shortlog --no-merges --since=3.years\" is your\nfriend ;-)\n\n> A series of patches extending my GSOC microproject\n> Fixing the documentation MyFirstContribution.adoc\n>\n> Updated various commits since the last patches sent.\n>\n> Feedbacks taken to write detailed commit messages\n>\n> K Jayatheerth (4):\n>   Remove unused git-mentoring mailing list\n>   Docs: Correct cmd_psuh and Explain UNUSED macro\n>   Docs: Add cmd_psuh with repo and UNUSED removal\n>   cmd_psuh: Prefer repo_config for config lookup\n>\n>  Documentation/MyFirstContribution.adoc | 89 ++++++++++++++++++--------\n>  1 file changed, 62 insertions(+), 27 deletions(-)\n"},{"id":"516290","messageId":"CA+rGoLfbshrkPvvQorMq4n1RkVnyL8XfJ9UjMFRA-6dG4QKdcw@mail.gmail.com","threadId":"63302","inReplyTo":"xmqqr01si441.fsf@gitster.g","subject":"Re: [PATCH 0/4] update MyFirstContribution with current code base","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-04-16T14:38:24Z","receivedAt":"2025-04-16T14:38:37Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"On Wed, Apr 16, 2025 at 7:46 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> K Jayatheerth <jayatheerthkulkarni2005@gmail.com> writes:\n>\n>     To: git@vger.kernel.org\n>     Cc: Junio C Hamano <gitster@pobox.com>, jayatheerthkulkarni2005@gmail.com\n>\n> Pick a better reviewer than me if you want your patches reviewed\n> more quickly, perhaps?  I had only 3 patches to the file in the past\n> 3 years, while there are others who had their hands to the file with\n> more changes.  \"git shortlog --no-merges --since=3.years\" is your\n> friend ;-)\n>\nUmm I got no issues with slow reviews too, but I also ran the command\nand I think the most amounts of commits for this file looks something like this\n\ngit shortlog --no-merges --since=6.years -- Documentation/MyFirstContributi\non.adoc\nJean-Noël Avila (1):\n      doc: add a blank line around block delimiters\n\nK Jayatheerth (4):\n      Remove unused git-mentoring mailing list\n      Docs: Correct cmd_psuh and Explain UNUSED macro\n      Docs: Add cmd_psuh with repo and UNUSED removal\n      cmd_psuh: Prefer repo_config for config lookup\n\nTodd Zullinger (1):\n      MyFirstContribution: *.txt -> *.adoc fixes\n\nbrian m. carlson (1):\n      doc: use .adoc extension for AsciiDoc files\n\n\nIf you can suggest someone, I could CC them in this thread.\n\nThank you,\n-Jayatheerth\n"},{"id":"517940","messageId":"CA+rGoLfx1fmCPvTRTMijAWOYT8JGGBkH9gqYsqVjwAVHXoX3eA@mail.gmail.com","threadId":"63302","inReplyTo":"CA+rGoLfbshrkPvvQorMq4n1RkVnyL8XfJ9UjMFRA-6dG4QKdcw@mail.gmail.com","subject":"Re: [PATCH 0/4] update MyFirstContribution with current code base","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-13T11:17:18Z","receivedAt":"2025-05-13T11:17:29Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"Hey people from Git,\n\nLooks like this might have gotten lost in the void.\n\nWould appreciate it if someone could take a look at this series of patches.\nThese are documentation-only changes and should not have any effect on\nthe actual source code.\n\nThanks in advance!\n\n-Jayatheerth\n"},{"id":"518028","messageId":"xmqqtt5ncq87.fsf@gitster.g","threadId":"63302","inReplyTo":"CA+rGoLfbshrkPvvQorMq4n1RkVnyL8XfJ9UjMFRA-6dG4QKdcw@mail.gmail.com","subject":"Re: [PATCH 0/4] update MyFirstContribution with current code base","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-14T12:48:56Z","receivedAt":"2025-05-14T12:48:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n\n> git shortlog --no-merges --since=6.years -- Documentation/MyFirstContributi\n> on.adoc\n\nThat would not work; due to mass rename, you'd need\n\n  $ git shortlog --no-merges -- Documentation/MyFirstContribution.{adoc,txt}\n\nor perhaps\n\n  $ git log --no-merges --follow Documentation/MyFirstContribution.adoc |\n    git shortlog\n\nor something like that.\n\n"},{"id":"518034","messageId":"CA+rGoLfcJ2r8S515msG5L-59=0nOBvdOX2TTn+-iaHw8v6Ndtw@mail.gmail.com","threadId":"63302","inReplyTo":"xmqqtt5ncq87.fsf@gitster.g","subject":"Re: [PATCH 0/4] update MyFirstContribution with current code base","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-14T13:06:08Z","receivedAt":"2025-05-14T13:06:20Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"On Wed, May 14, 2025 at 6:18 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n>\n> > git shortlog --no-merges --since=6.years -- Documentation/MyFirstContributi\n> > on.adoc\n>\n> That would not work; due to mass rename, you'd need\n>\n>   $ git shortlog --no-merges -- Documentation/MyFirstContribution.{adoc,txt}\n>\n> or perhaps\n>\n>   $ git log --no-merges --follow Documentation/MyFirstContribution.adoc |\n>     git shortlog\n>\n> or something like that.\n>\n\nOh I totally forgot the extension was changed to adoc\nThanks for pointing it out\n\nAs far as I see\n\nEmily Shaffer (9)\nPhilippe Blain (5)\n\nHave the two highest logs\nI think Emily is not active in Git\nSo for now I will cc Philippe\n\nThank you,\n\n-Jayatheerth\n"},{"id":"518192","messageId":"CAJoAoZnYOjqgeW8Stuj5T9qcxmUBE=_j_ufO8Hdbn3GV8LmMzA@mail.gmail.com","threadId":"63302","inReplyTo":"CA+rGoLfcJ2r8S515msG5L-59=0nOBvdOX2TTn+-iaHw8v6Ndtw@mail.gmail.com","subject":"Re: [PATCH 0/4] update MyFirstContribution with current code base","fromName":"Emily Shaffer","fromEmail":"nasamuffin@google.com","sentAt":"2025-05-15T22:38:58Z","receivedAt":"2025-05-15T22:39:12Z","isPatch":true,"sender":{"key":"nasamuffin@google.com","avatar":"https://avatars.githubusercontent.com/u/1606826?v=4"},"body":"On Wed, May 14, 2025 at 6:07 AM JAYATHEERTH K\n<jayatheerthkulkarni2005@gmail.com> wrote:\n> As far as I see\n>\n> Emily Shaffer (9)\n> Philippe Blain (5)\n>\n> Have the two highest logs\n> I think Emily is not active in Git\n\nMostly I lurk these days :) I do still keep an eye on the list. Will\nhappily take a look at your series tomorrow, I'm out of time for\ntoday. But per what I mention below, if you don't hear from me, please\ndon't feel blocked by the review, as I think the MyFirstContribution\ndoc is comfortably maintained by the whole project by now.\n\n> So for now I will cc Philippe\n\nFor what it's worth, I don't think it is harmful to CC people even if\nthey will be inactive. CCing someone is not necessarily the same thing\nas saying that person needs to approve your code change, right? So I\ndon't see the harm in CCing with low expectations - in fact, in my\ncase it would help make the email stand out, so you'd be more likely\nto get a review from me (I missed this thread going by initially).\n\n\n - Emily\n"},{"id":"518216","messageId":"CA+rGoLf7jf5r3C2mN7X84HNrWqsA9mMueEkCowm7Ftsgcd5EbQ@mail.gmail.com","threadId":"63302","inReplyTo":"CAJoAoZnYOjqgeW8Stuj5T9qcxmUBE=_j_ufO8Hdbn3GV8LmMzA@mail.gmail.com","subject":"Re: [PATCH 0/4] update MyFirstContribution with current code base","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-16T08:20:05Z","receivedAt":"2025-05-16T08:20:17Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"On Fri, May 16, 2025 at 4:09 AM Emily Shaffer <nasamuffin@google.com> wrote:\n\n> Mostly I lurk these days :) I do still keep an eye on the list. Will\n> happily take a look at your series tomorrow, I'm out of time for\n> today. But per what I mention below, if you don't hear from me, please\n> don't feel blocked by the review, as I think the MyFirstContribution\n> doc is comfortably maintained by the whole project by now.\n>\n\nUnderstood!! thanks for letting me know\n\n> > So for now I will cc Philippe\n>\n> For what it's worth, I don't think it is harmful to CC people even if\n> they will be inactive. CCing someone is not necessarily the same thing\n> as saying that person needs to approve your code change, right? So I\n> don't see the harm in CCing with low expectations - in fact, in my\n> case it would help make the email stand out, so you'd be more likely\n> to get a review from me (I missed this thread going by initially).\n>\n>\n\nOh, ok I will keep that in mind next time.\n\n>  - Emily\n\nThank you,\n\n-Jayatheerth\n"},{"id":"518259","messageId":"xmqqmsbcwn6t.fsf@gitster.g","threadId":"63302","inReplyTo":"CA+rGoLf7jf5r3C2mN7X84HNrWqsA9mMueEkCowm7Ftsgcd5EbQ@mail.gmail.com","subject":"Re: [PATCH 0/4] update MyFirstContribution with current code base","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-16T16:11:06Z","receivedAt":"2025-05-16T16:11:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n\n> On Fri, May 16, 2025 at 4:09 AM Emily Shaffer <nasamuffin@google.com> wrote:\n>\n>> Mostly I lurk these days :) I do still keep an eye on the list. Will\n>> happily take a look at your series tomorrow, I'm out of time for\n>> today. But per what I mention below, if you don't hear from me, please\n>> don't feel blocked by the review, as I think the MyFirstContribution\n>> doc is comfortably maintained by the whole project by now.\n>>\n>\n> Understood!! thanks for letting me know\n>\n>> > So for now I will cc Philippe\n>>\n>> For what it's worth, I don't think it is harmful to CC people even if\n>> they will be inactive. CCing someone is not necessarily the same thing\n>> as saying that person needs to approve your code change, right? So I\n>> don't see the harm in CCing with low expectations - in fact, in my\n>> case it would help make the email stand out, so you'd be more likely\n>> to get a review from me (I missed this thread going by initially).\n>>\n>>\n>\n> Oh, ok I will keep that in mind next time.\n>\n>>  - Emily\n>\n> Thank you,\n\nThanks for a pleasant conversation; others can also learn from this\nexchange, hopefully.  In Documentation/SubmittingPatches we have\n\"Choosing your reviewers\" section lacks anything more concrete than\n\"who are involved in the area you are touching\", and those who use\ncommon sense may say, just like you did, \"ah, most of the text I am\nreplacing was written N years ago by person X, whom I no longer see\non the list very often\" and decide to omit it.  Perhaps we would\nwant to enhance the text there somewhat?  I dunno.\n\nSince there were discussions on contrib/contacts recently (a few of\nthe participants there added to CC), I tried it and unfortunately I\nwas not very impressed by its output [*].\n\nAfter applying the four patches on top of 'master', you'd run the\ntool like so:\n\n    $ contrib/contacts/git-contacts master..\n    Jonathan Nieder <jrnieder@gmail.com>\n    Jacob Stopak <jacob@initialcommit.io>\n    Jeff King <peff@peff.net>\n    Jean-Noël Avila <jn.avila@free.fr>\n    Emily Shaffer <nasamuffin@google.com>\n    Atharva Raykar <raykar.ath@gmail.com>\n    Junio C Hamano <gitster@pobox.com>\n    Todd Zullinger <tmz@pobox.com>\n    Kyle Lippincott <spectral@google.com>\n\nThe tool gave output in a different order every time it was run.  It\nwasn't obvious what the ordering meant.\n\nBy looking at its source, I can tell that the names and addresses\nare collected from trailers like reported-by, which are counted with\nthe same importance as the authorship, that the reason why the\noutput is different each time it is run is due to use of keys %hash\nin a Perl script, etc., but counting sign-off would mean that I'd be\nsummoned for each and every change related in this project, which\nwould not be very productive use of everybody's time.\n\nAnd it of course is not clear who are still active in the recent\npast and why the name was in the list (it would not be as productive\nto ask for a review from somebody who was listed for reporting many\nproblems in the area affected by the proposed patch than those who\nwrote the original) from this output.  There may want an \"explain\"\nmode that lets you feed a patch and get observations like:\n\n    The majority of lines you are touching haven't changed much\n    since person X wrote commit W 5 years ago, and the text turned\n    into current shape with contributions by person Y and Z.  Here\n    are the URLs into the lore archive for the discussion that you\n    can see how X, Y, and Z participated in the original before you\n    touched.  You may also want to look at commit V and U as well.\n\n    Last time we saw person X, Y, and Z on the list were ..., here\n    are the URLs into the lore archive.\n    \nPerhaps some AI minded folks can write such a service for us ;-)?\n\n\n[Footnote]\n\n * I didn't try other alternatives which I didn't have, and the\n   other thread there was a mention of \"git related\" with \"seems\n   like rather more work\".\n\n   cf. https://lore.kernel.org/git/aBr9bwNQ1J46NNXI@pks.im/\n"},{"id":"518270","messageId":"CA+rGoLfFVcUFctoEx6wshovGnRW8pTW--ZB42ntd01VHMJm_Rw@mail.gmail.com","threadId":"63302","inReplyTo":"xmqqmsbcwn6t.fsf@gitster.g","subject":"Re: [PATCH 0/4] update MyFirstContribution with current code base","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-16T17:18:30Z","receivedAt":"2025-05-16T17:18:43Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"On Fri, May 16, 2025 at 9:41 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n>\n> > On Fri, May 16, 2025 at 4:09 AM Emily Shaffer <nasamuffin@google.com> wrote:\n> >\n> >> Mostly I lurk these days :) I do still keep an eye on the list. Will\n> >> happily take a look at your series tomorrow, I'm out of time for\n> >> today. But per what I mention below, if you don't hear from me, please\n> >> don't feel blocked by the review, as I think the MyFirstContribution\n> >> doc is comfortably maintained by the whole project by now.\n> >>\n> >\n> > Understood!! thanks for letting me know\n> >\n> >> > So for now I will cc Philippe\n> >>\n> >> For what it's worth, I don't think it is harmful to CC people even if\n> >> they will be inactive. CCing someone is not necessarily the same thing\n> >> as saying that person needs to approve your code change, right? So I\n> >> don't see the harm in CCing with low expectations - in fact, in my\n> >> case it would help make the email stand out, so you'd be more likely\n> >> to get a review from me (I missed this thread going by initially).\n> >>\n> >>\n> >\n> > Oh, ok I will keep that in mind next time.\n> >\n> >>  - Emily\n> >\n> > Thank you,\n>\n> Thanks for a pleasant conversation; others can also learn from this\n> exchange, hopefully.  In Documentation/SubmittingPatches we have\n> \"Choosing your reviewers\" section lacks anything more concrete than\n> \"who are involved in the area you are touching\", and those who use\n> common sense may say, just like you did, \"ah, most of the text I am\n> replacing was written N years ago by person X, whom I no longer see\n> on the list very often\" and decide to omit it.  Perhaps we would\n> want to enhance the text there somewhat?  I dunno.\n>\n\nAgreed even a single practical example in the \"Choosing your\nreviewers\" section of SubmittingPatches could guide contributors\nbetter.\nI'd be happy to draft a patch that adds such a line, based on this\nthread’s discussion.\n\n> Since there were discussions on contrib/contacts recently (a few of\n> the participants there added to CC), I tried it and unfortunately I\n> was not very impressed by its output [*].\n>\n> After applying the four patches on top of 'master', you'd run the\n> tool like so:\n>\n>     $ contrib/contacts/git-contacts master..\n>     Jonathan Nieder <jrnieder@gmail.com>\n>     Jacob Stopak <jacob@initialcommit.io>\n>     Jeff King <peff@peff.net>\n>     Jean-Noël Avila <jn.avila@free.fr>\n>     Emily Shaffer <nasamuffin@google.com>\n>     Atharva Raykar <raykar.ath@gmail.com>\n>     Junio C Hamano <gitster@pobox.com>\n>     Todd Zullinger <tmz@pobox.com>\n>     Kyle Lippincott <spectral@google.com>\n>\n> The tool gave output in a different order every time it was run.  It\n> wasn't obvious what the ordering meant.\n>\n> By looking at its source, I can tell that the names and addresses\n> are collected from trailers like reported-by, which are counted with\n> the same importance as the authorship, that the reason why the\n> output is different each time it is run is due to use of keys %hash\n> in a Perl script, etc., but counting sign-off would mean that I'd be\n> summoned for each and every change related in this project, which\n> would not be very productive use of everybody's time.\n>\n\nAgreed, but I don't know if there are any projects where there are no\nauthorship names\nand direct commit details.\nOr maybe there are two commits where it must create more confusion.\n\n> And it of course is not clear who are still active in the recent\n> past and why the name was in the list (it would not be as productive\n> to ask for a review from somebody who was listed for reporting many\n> problems in the area affected by the proposed patch than those who\n> wrote the original) from this output.  There may want an \"explain\"\n> mode that lets you feed a patch and get observations like:\n>\n>     The majority of lines you are touching haven't changed much\n>     since person X wrote commit W 5 years ago, and the text turned\n>     into current shape with contributions by person Y and Z.  Here\n>     are the URLs into the lore archive for the discussion that you\n>     can see how X, Y, and Z participated in the original before you\n>     touched.  You may also want to look at commit V and U as well.\n>\n>     Last time we saw person X, Y, and Z on the list were ..., here\n>     are the URLs into the lore archive.\n>\n> Perhaps some AI minded folks can write such a service for us ;-)?\n>\n\nIf we're talking about AI approaches, I do think this could be\nfeasible with LLMs. I imagine a pipeline where:\nA patch is parsed and matched to the line-level history (via git blame\nor log -L)\n\nThe commit history is summarized to extract contributor roles\nActivity is cross-checked on lore.kernel.org\nAn LLM generates human-readable explanations with references and\nconfidence indicators\n\nOf course, the risk of hallucinations is real but with a properly\ncurated context (e.g., logs and emails as input, strict templates), I\nthink we can keep it grounded.\nI'd like to prototype such a tool and would value the list's feedback\non this idea.\n\nAlso I think this idea would only make sense as a seperated solution\nand not adding in Git\nbecause it would cost a lot of compute to run LLMs locally, or perhaps like\nemail the way we add config on the before hand, (if we are combining\nwith git) giving people an option to add an API to their LLM would\nwork\nBut this is just a vague idea.\n\nThanks again and truly find this thread constructive.\n\n\n>\n> [Footnote]\n>\n>  * I didn't try other alternatives which I didn't have, and the\n>    other thread there was a mention of \"git related\" with \"seems\n>    like rather more work\".\n>\n>    cf. https://lore.kernel.org/git/aBr9bwNQ1J46NNXI@pks.im/\n\n\n\n-Jayatheerth\n"},{"id":"518275","messageId":"aCd_N-QeIi9hwnWd@google.com","threadId":"63302","inReplyTo":"20250416061450.25695-3-jayatheerthkulkarni2005@gmail.com","subject":"Re: [PATCH 2/4] Docs: Correct cmd_psuh and Explain UNUSED macro","fromName":"Emily Shaffer","fromEmail":"nasamuffin@google.com","sentAt":"2025-05-16T18:08:55Z","receivedAt":"2025-05-16T18:09:07Z","isPatch":true,"sender":{"key":"nasamuffin@google.com","avatar":"https://avatars.githubusercontent.com/u/1606826?v=4"},"body":"On Wed, Apr 16, 2025 at 11:44:48AM +0530, K Jayatheerth wrote:\n> \n> The `cmd_psuh` function signature in the documentation,\n> was missing the `struct repository *repo` argument,\n> which is standard for built-in commands.\n> This commit corrects the signature to include the `repo` argument.\n> \n> Additionally, this commit adds an explanation,\n> for using the `UNUSED` macro to prevent compiler warnings.\n> \n> This helps new contributors understand,\n> common practices in the Git codebase.\n\nFor this commit and others, take another look at the commit message\nguidelines in\nhttps://git-scm.com/docs/SubmittingPatches#describe-changes - this\ncommit message recaps \"what\" you are doing in the diff, which isn't\nnecessary because the diff is very simple to look at :) but it only\nbriefly explains \"why\". You did a good job explaining why in your cover\nletter, IMO - but your cover letter doesn't live in the code base\nforever. Your commit message does :)\n\n> \n> Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n> ---\n>  Documentation/MyFirstContribution.adoc | 10 +++++++++-\n>  1 file changed, 9 insertions(+), 1 deletion(-)\n> \n> diff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\n> index ef190d8748..b463d42f63 100644\n> --- a/Documentation/MyFirstContribution.adoc\n> +++ b/Documentation/MyFirstContribution.adoc\n> @@ -142,7 +142,15 @@ command in `builtin/psuh.c`. Create that file, and within it, write the entry\n>  point for your command in a function matching the style and signature:\n>  \n>  ----\n> -int cmd_psuh(int argc, const char **argv, const char *prefix)\n> +int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo)\n> +----\n> +\n> +We also use the UNUSED macro to make sure we don't recieve compiler warnings\n> +for unused arguments from the function cmd_psuh.\n\nI think it's a good idea to mention that this is temporary - since you\nare removing UNUSED in the very next step.\n\n> +\n> +----\n> +int cmd_psuh(int argc UNUSED, const char **argv UNUSED, \n> +\t\t\tconst char *prefix UNUSED, struct repository *repo UNUSED)\n>  ----\n>  \n>  We'll also need to add the declaration of psuh; open up `builtin.h`, find the\n> -- \n> 2.49.GIT\n> \n> \n"},{"id":"518290","messageId":"aCeAIqwvEVOdrsMg@google.com","threadId":"63302","inReplyTo":"20250416061450.25695-4-jayatheerthkulkarni2005@gmail.com","subject":"Re: [PATCH 3/4] Docs: Add cmd_psuh with repo and UNUSED removal","fromName":"Emily Shaffer","fromEmail":"nasamuffin@google.com","sentAt":"2025-05-16T18:12:50Z","receivedAt":"2025-05-16T18:12:57Z","isPatch":true,"sender":{"key":"nasamuffin@google.com","avatar":"https://avatars.githubusercontent.com/u/1606826?v=4"},"body":"On Wed, Apr 16, 2025 at 11:44:49AM +0530, K Jayatheerth wrote:\n> \n> This commit improves the `cmd_psuh` documentation example by:\n> \n> Correcting the function signature to include struct repository *repo.\n> Makes the signature accurate and consistent with typical Git built-in\n> commands.\n> \n> Removing the `UNUSED` macros from the `cmd_psuh` function arguments\n> (argc, argv, prefix, repo). This is done because the example now\n> uses these arguments.\n> \n> Showing how to access the repository's Git directory (repo->gitdir)\n> within the cmd_psuh function. This provides a practical example of\n> how to use the repo argument and repository-related information.\n> \n> Keeps your existing printf() calls in place.\n> This lets the users see the arguments which is given to the function.\n> \n> This enhanced example provides a more complete illustration of\n> Adding a Git built-in command and use the repository argument.\n\nAs I said for the prior patch, please revise the commit message; we\ndon't need the line by line description of what you're doing in the diff\nbelow as we can read the diff :)\n\nThe important part is pointing out that the codebase has moved on to\nrequire UNUSED and passing around a repository object, and that it's\ninteresting for newbies to see what's inside of `repo` in this learning\nexercise.\n\n> \n> Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n> ---\n>  Documentation/MyFirstContribution.adoc | 19 ++++++++++++++++---\n>  1 file changed, 16 insertions(+), 3 deletions(-)\n> \n> diff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\n> index b463d42f63..ed6dcc1fc6 100644\n> --- a/Documentation/MyFirstContribution.adoc\n> +++ b/Documentation/MyFirstContribution.adoc\n> @@ -158,7 +158,7 @@ declaration for `cmd_pull`, and add a new line for `psuh` immediately before it,\n>  in order to keep the declarations alphabetically sorted:\n>  \n>  ----\n> -int cmd_psuh(int argc, const char **argv, const char *prefix);\n> +int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo);\n>  ----\n>  \n>  Be sure to `#include \"builtin.h\"` in your `psuh.c`. You'll also need to\n> @@ -174,7 +174,8 @@ Throughout the tutorial, we will mark strings for translation as necessary; you\n>  should also do so when writing your user-facing commands in the future.\n>  \n>  ----\n> -int cmd_psuh(int argc, const char **argv, const char *prefix)\n> +int cmd_psuh(int argc UNUSED, const char **argv UNUSED, \n> +\t\t\tconst char *prefix UNUSED, struct repository *repo UNUSED)\n>  {\n>  \tprintf(_(\"Pony saying hello goes here.\\n\"));\n>  \treturn 0;\n> @@ -287,10 +288,14 @@ on the reference implementation linked at the top of this document.\n>  It's probably useful to do at least something besides printing out a string.\n>  Let's start by having a look at everything we get.\n>  \n> -Modify your `cmd_psuh` implementation to dump the args you're passed, keeping\n> +Modify your `cmd_psuh` implementation to dump the args you're passed\n> +and removing the UNUSED macro from them, keeping\n\n\"Modify ... and removing\" mixes up tenses. Better to say,\n\nModify your `cmd_psuh` implementation to dump the args you're passed,\nkeeping existing `printf()` calls in place; because the args are now\nused, remove the `UNUSED` macro from them:\n\n>  existing `printf()` calls in place:\n>  \n>  ----\n> +int cmd_psuh(int argc, const char **argv, \n> +\t\t\tconst char *prefix, struct repository *repo)\n> +{\n>  \tint i;\n>  \n>  \t...\n> @@ -305,6 +310,14 @@ existing `printf()` calls in place:\n>  \tprintf(_(\"Your current working directory:\\n<top-level>%s%s\\n\"),\n>  \t       prefix ? \"/\" : \"\", prefix ? prefix : \"\");\n>  \n> +\tif (repo && repo->gitdir) {\n> +        printf(_(\"Git directory: %s\\n\"), repo->gitdir);\n> +    } else {\n> +        printf(_(\"No Git directory found.\\n\"));\n> +    }\n\nYour whitespace is wonky here, Git uses tabs, not spaces. Double check\nit, please :)\n\n> +\n> +\t...\n> +}\n>  ----\n>  \n>  Build and try it. As you may expect, there's pretty much just whatever we give\n> -- \n> 2.49.GIT\n> \n> \n"},{"id":"518291","messageId":"aCeDZgaNWPbDV0Ra@google.com","threadId":"63302","inReplyTo":"20250416061450.25695-5-jayatheerthkulkarni2005@gmail.com","subject":"Re: [PATCH 4/4] cmd_psuh: Prefer repo_config for config lookup","fromName":"Emily Shaffer","fromEmail":"nasamuffin@google.com","sentAt":"2025-05-16T18:26:46Z","receivedAt":"2025-05-16T18:26:53Z","isPatch":true,"sender":{"key":"nasamuffin@google.com","avatar":"https://avatars.githubusercontent.com/u/1606826?v=4"},"body":"On Wed, Apr 16, 2025 at 11:44:50AM +0530, K Jayatheerth wrote:\n> \n> This commit updates cmd_psuh to use repo_config and\n> repo_config_get_string_tmp for retrieving the user.name config\n> variable. This is a more robust and correct approach than using the\n> global git_config functions because:\n> \n> git_config uses the global configuration, ignoring any\n> repository-specific settings (e.g., in .git/config). repo_config\n> loads the configuration specific to the repository,\n> ensuring that the correct settings are used.\n> \n> repo_config_get_string_tmp retrieves configuration values\n> relative to the repository, respecting any local overrides.\n> \n> This change ensures that cmd_psuh correctly reads the\n> user.name setting that applies to the current repository,\n> rather than relying on globalsettings that might be\n> incorrect or misleading. It also demonstrates the correct way\n> to access repository-specific configuration within Git commands.\n\nThis commit message is a really good start! I like that you're pointing\nout there's a real bug in using global config and ignoring repo-local\nconfig. Although I'm not sure that it's actually accurate... but it is\ntrue that git_config() is now an outdated way to access config, since it\nassumes the_repository instead of passing the `repo` variable that was\nprovided to cmd_psuh.\n\n> \n> Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n> ---\n>  Documentation/MyFirstContribution.adoc | 52 ++++++++++++++++++--------\n>  1 file changed, 37 insertions(+), 15 deletions(-)\n> \n> diff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\n> index ed6dcc1fc6..688240ce8b 100644\n> --- a/Documentation/MyFirstContribution.adoc\n> +++ b/Documentation/MyFirstContribution.adoc\n> @@ -325,26 +325,48 @@ on the command line, including the name of our command. (If `prefix` is empty\n>  for you, try `cd Documentation/ && ../bin-wrappers/git psuh`). That's not so\n>  helpful. So what other context can we get?\n>  \n> -Add a line to `#include \"config.h\"`. Then, add the following bits to the\n> -function body:\n> +Add a line to `#include \"config.h\"` and `#include \"repository.h\"`. \n> +Then, add the following bits to the function body:\n>  \n>  ----\n> -\tconst char *cfg_name;\n> +#include \"builtin.h\"\n> +#include \"gettext.h\"\n> +#include \"config.h\"\n> +#include \"repository.h\"  \n>  \n> -...\n> +int cmd_psuh(int argc, const char **argv, \n> +\t\t\tconst char *prefix, struct repository *repo)\n> +{\n> +    const char *cfg_name;\n> +\n> +    printf(Q_(\"Your args (there is %d):\\n\",\n> +              \"Your args (there are %d):\\n\",\n> +              argc),\n> +           argc);\n>  \n> -\tgit_config(git_default_config, NULL);\n> -\tif (git_config_get_string_tmp(\"user.name\", &cfg_name) > 0)\n> -\t\tprintf(_(\"No name is found in config\\n\"));\n> -\telse\n> -\t\tprintf(_(\"Your name: %s\\n\"), cfg_name);\n> +    for (int i = 0; i < argc; i++) {\n> +        printf(\"%d: %s\\n\", i, argv[i]);\n> +    }\n> +\n> +    printf(_(\"Your current working directory:\\n<top-level>%s%s\\n\"),\n> +           prefix ? \"/\" : \"\", prefix ? prefix : \"\");\n> +\n> +    repo_config(repo, git_default_config, NULL);\n> +\n> +    if (repo_config_get_string_tmp(repo, \"user.name\", &cfg_name))\n> +        printf(_(\"No name is found in config\\n\"));\n> +    else\n> +        printf(_(\"Your name: %s\\n\"), cfg_name);\n> +\n> +    return 0;\n> +}\n\nI'd prefer to see this stick to the prior formula of including only\nsmall chunks of the function, rather than a full function you can copy\nand paste. Because this is a tutorial, and the goal is for learners to\nunderstand each section of code as they add it, not just for them to\npaste it into their editor and hit run.\n\nSo, I don't think it's necessary for you to add the rest of the function\nhere in the process of switching to repo_config from git_config.\n\n\nGenerally, I find the changes to update the code snippets\nunobjectionable and don't have a problem with the added prose\nbeyond a couple nits. But as I assume you sent this series as a way to\nlearn more about the codebase, definitely please revisit your commit\nmessages to align their style with the rest of the codebase.\n\nBut I think with the stuff I called out taken into account in v2, this\nseries is good. Thanks for the effort to update it. I'd also like to\nupdate github.com/nasamuffin/git/tree/psuh once this series lands, if\nyou can point me to a branch of yours with the sample code I can pull\nfrom :)\n\n(Or, as we discussed when I sent this doc in the first place, does it\nmake sense for a branch with the sample code to be maintained\nonly-best-effort on git/git itself?)\n\n - Emily\n\n>\n>  ----\n>  \n> -`git_config()` will grab the configuration from config files known to Git and\n> -apply standard precedence rules. `git_config_get_string_tmp()` will look up\n> +`repo_config()` will grab the configuration from config files known to Git and\n> +apply standard precedence rules. `repo_config_get_string_tmp()` will look up\n>  a specific key (\"user.name\") and give you the value. There are a number of\n>  single-key lookup functions like this one; you can see them all (and more info\n> -about how to use `git_config()`) in `Documentation/technical/api-config.adoc`.\n> +about how to use `repo_config()`) in `Documentation/technical/api-config.adoc`.\n>  \n>  You should see that the name printed matches the one you see when you run:\n>  \n> @@ -377,7 +399,7 @@ status_init_config(&s, git_status_config);\n>  ----\n>  \n>  But as we drill down, we can find that `status_init_config()` wraps a call\n> -to `git_config()`. Let's modify the code we wrote in the previous commit.\n> +to `repo_config()`. Let's modify the code we wrote in the previous commit.\n>  \n>  Be sure to include the header to allow you to use `struct wt_status`:\n>  \n> @@ -393,8 +415,8 @@ prepare it, and print its contents:\n>  \n>  ...\n>  \n> -\twt_status_prepare(the_repository, &status);\n> -\tgit_config(git_default_config, &status);\n> +\twt_status_prepare(repo, &status);\n> +\trepo_config(repo, git_default_config, &status);\n>  \n>  ...\n>  \n> -- \n> 2.49.GIT\n> \n> \n"},{"id":"518300","messageId":"20250516185516.52311-1-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"aCeAIqwvEVOdrsMg@google.com","subject":"[PATCH v2 1/3] docs: remove unused mentoring mailing list reference","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-16T18:55:14Z","receivedAt":"2025-05-16T18:55:31Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"The git-mentoring group is being removed because new contributors\nnow approach the main mailing list directly and\nalmost always receive responses.\nTo reflect current practices and avoid confusion,\nreferences to the unused mentoring list have been removed.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 8 --------\n 1 file changed, 8 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex ca1d688c9b..ef190d8748 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -40,14 +40,6 @@ the list by sending an email to <git+subscribe@vger.kernel.org>\n The https://lore.kernel.org/git[archive] of this mailing list is\n available to view in a browser.\n \n-==== https://groups.google.com/forum/#!forum/git-mentoring[git-mentoring@googlegroups.com]\n-\n-This mailing list is targeted to new contributors and was created as a place to\n-post questions and receive answers outside of the public eye of the main list.\n-Veteran contributors who are especially interested in helping mentor newcomers\n-are present on the list. In order to avoid search indexers, group membership is\n-required to view messages; anyone can join and no approval is required.\n-\n ==== https://web.libera.chat/#git-devel[#git-devel] on Libera Chat\n \n This IRC channel is for conversations between Git contributors. If someone is\n-- \n2.49.GIT\n\n"},{"id":"518301","messageId":"20250516185516.52311-2-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250516185516.52311-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH v2 2/3] docs: clarify cmd_psuh signature and explain UNUSED macro","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-16T18:55:15Z","receivedAt":"2025-05-16T18:55:38Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"The documentation previously omitted the UNUSED macro,\nwhich often led to confusion for new contributors\nwhen they encountered compiler warnings related to unused parameters.\nThis commit adds a brief explanation to help clarify its\npurpose and common usage in the Git codebase.\n\nAdditionally, the function signature for cmd_psuh has been updated\nto include the struct repository *repo argument,\naligning it with the standard pattern for built-in commands.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 20 +++++++++++++++-----\n 1 file changed, 15 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex ef190d8748..f4320d8869 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -142,7 +142,15 @@ command in `builtin/psuh.c`. Create that file, and within it, write the entry\n point for your command in a function matching the style and signature:\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix)\n+int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo)\n+----\n+\n+We will use the UNUSED macro to make sure we don't recieve compiler warnings\n+for unused arguments from the function cmd_psuh.\n+\n+----\n+int cmd_psuh(int argc UNUSED, const char **argv UNUSED,\n+\t    const char *prefix UNUSED, struct repository *repo UNUSED)\n ----\n \n We'll also need to add the declaration of psuh; open up `builtin.h`, find the\n@@ -150,7 +158,7 @@ declaration for `cmd_pull`, and add a new line for `psuh` immediately before it,\n in order to keep the declarations alphabetically sorted:\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix);\n+int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo);\n ----\n \n Be sure to `#include \"builtin.h\"` in your `psuh.c`. You'll also need to\n@@ -166,7 +174,8 @@ Throughout the tutorial, we will mark strings for translation as necessary; you\n should also do so when writing your user-facing commands in the future.\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix)\n+int cmd_psuh(int argc UNUSED, const char **argv UNUSED, \n+\t    const char *prefix UNUSED, struct repository *repo UNUSED)\n {\n \tprintf(_(\"Pony saying hello goes here.\\n\"));\n \treturn 0;\n@@ -279,8 +288,9 @@ on the reference implementation linked at the top of this document.\n It's probably useful to do at least something besides printing out a string.\n Let's start by having a look at everything we get.\n \n-Modify your `cmd_psuh` implementation to dump the args you're passed, keeping\n-existing `printf()` calls in place:\n+Modify your `cmd_psuh` implementation to dump the args you're passed,\n+keeping existing `printf()` calls in place; because the args are now\n+used, remove the `UNUSED` macro from them:\n \n ----\n \tint i;\n-- \n2.49.GIT\n\n"},{"id":"518302","messageId":"20250516185516.52311-3-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250516185516.52311-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH v2 3/3] docs: replace git_config to repo_config","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-16T18:55:16Z","receivedAt":"2025-05-16T18:55:40Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"This change updates the example in cmd_psuh to use repo_config and\nrepo_config_get_string_tmp instead of the global git_config functions.\n\nWhile git_config() accesses global configuration via the_repository,\nusing repo_config() makes use of the repo parameter passed to built-in commands.\nThis is the preferred pattern in the Git codebase,\nas it respects repository-specific configuration (e.g., .git/config)\nand avoids relying on global state.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 19 ++++++++++---------\n 1 file changed, 10 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex f4320d8869..8c2ca5c092 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -314,7 +314,8 @@ on the command line, including the name of our command. (If `prefix` is empty\n for you, try `cd Documentation/ && ../bin-wrappers/git psuh`). That's not so\n helpful. So what other context can we get?\n \n-Add a line to `#include \"config.h\"`. Then, add the following bits to the\n+Add a line to `#include \"config.h\"` and `#include \"repository.h\"`.\n+Then, add the following bits to the function body:\n function body:\n \n ----\n@@ -322,18 +323,18 @@ function body:\n \n ...\n \n-\tgit_config(git_default_config, NULL);\n-\tif (git_config_get_string_tmp(\"user.name\", &cfg_name) > 0)\n+\trepo_config(repo, git_default_config, NULL);\n+\tif (repo_config_get_string_tmp(repo, \"user.name\", &cfg_name))\n \t\tprintf(_(\"No name is found in config\\n\"));\n \telse\n \t\tprintf(_(\"Your name: %s\\n\"), cfg_name);\n ----\n \n-`git_config()` will grab the configuration from config files known to Git and\n-apply standard precedence rules. `git_config_get_string_tmp()` will look up\n+`repo_config()` will grab the configuration from config files known to Git and\n+apply standard precedence rules. `repo_config_get_string_tmp()` will look up\n a specific key (\"user.name\") and give you the value. There are a number of\n single-key lookup functions like this one; you can see them all (and more info\n-about how to use `git_config()`) in `Documentation/technical/api-config.adoc`.\n+about how to use `repo_config()`) in `Documentation/technical/api-config.adoc`.\n \n You should see that the name printed matches the one you see when you run:\n \n@@ -366,7 +367,7 @@ status_init_config(&s, git_status_config);\n ----\n \n But as we drill down, we can find that `status_init_config()` wraps a call\n-to `git_config()`. Let's modify the code we wrote in the previous commit.\n+to `repo_config()`. Let's modify the code we wrote in the previous commit.\n \n Be sure to include the header to allow you to use `struct wt_status`:\n \n@@ -382,8 +383,8 @@ prepare it, and print its contents:\n \n ...\n \n-\twt_status_prepare(the_repository, &status);\n-\tgit_config(git_default_config, &status);\n+\twt_status_prepare(repo, &status);\n+\trepo_config(repo, git_default_config, &status);\n \n ...\n \n-- \n2.49.GIT\n\n"},{"id":"518303","messageId":"CA+rGoLfk=m4QzrRnCsweBsL35yiLEUHJagetEL9DD2Pty5FgAQ@mail.gmail.com","threadId":"63302","inReplyTo":"aCeDZgaNWPbDV0Ra@google.com","subject":"Re: [PATCH 4/4] cmd_psuh: Prefer repo_config for config lookup","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-16T19:06:01Z","receivedAt":"2025-05-16T19:06:13Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"So, I've consolidated these patches in only 3 rather than 4,\nthe UNUSED fix patch was actually delving into 2 patches so I fixed\nthat in a single one.\n\nAlso the commit messages, I gotta admit I was given the same feedback from Junio\nBut these were actually written before that, Apologies I should've checked once.\n\n\n> I'd prefer to see this stick to the prior formula of including only\n> small chunks of the function, rather than a full function you can copy\n> and paste. Because this is a tutorial, and the goal is for learners to\n> understand each section of code as they add it, not just for them to\n> paste it into their editor and hit run.\n>\n\nYes I've done this. I've just changed git_config to repo_config\nwithout changing the other parts.\n\n> So, I don't think it's necessary for you to add the rest of the function\n> here in the process of switching to repo_config from git_config.\n>\n>\n> Generally, I find the changes to update the code snippets\n> unobjectionable and don't have a problem with the added prose\n> beyond a couple nits. But as I assume you sent this series as a way to\n> learn more about the codebase, definitely please revisit your commit\n> messages to align their style with the rest of the codebase.\n>\n> But I think with the stuff I called out taken into account in v2, this\n> series is good. Thanks for the effort to update it. I'd also like to\n> update github.com/nasamuffin/git/tree/psuh once this series lands, if\n> you can point me to a branch of yours with the sample code I can pull\n> from :)\n\nSurely, I will write the builtin function with a test case and make\nsure it compiles.\n\n> (Or, as we discussed when I sent this doc in the first place, does it\n> make sense for a branch with the sample code to be maintained\n> only-best-effort on git/git itself?)\n>\n\nI think it's fine both ways as long as we link it to the proper place\nin the docs.\n\n>  - Emily\n>\n> >\n> >  ----\n...\n\nIn the new series I tried to keep commit messages as good as I could\nwithout naming every line I edited and just keeping it to why instead of what.\n\nThank you,\n\n-Jayatheerth\n"},{"id":"518311","messageId":"aCemyqUnLBZc4gyy@google.com","threadId":"63302","inReplyTo":"20250516185516.52311-1-jayatheerthkulkarni2005@gmail.com","subject":"Re: [PATCH v2 1/3] docs: remove unused mentoring mailing list reference","fromName":"Emily Shaffer","fromEmail":"nasamuffin@google.com","sentAt":"2025-05-16T20:57:46Z","receivedAt":"2025-05-16T20:57:53Z","isPatch":true,"sender":{"key":"nasamuffin@google.com","avatar":"https://avatars.githubusercontent.com/u/1606826?v=4"},"body":"On Sat, May 17, 2025 at 12:25:14AM +0530, K Jayatheerth wrote:\n> \n> The git-mentoring group is being removed because new contributors\n> now approach the main mailing list directly and\n> almost always receive responses.\n> To reflect current practices and avoid confusion,\n> references to the unused mentoring list have been removed.\n> \n> Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n> ---\n>  Documentation/MyFirstContribution.adoc | 8 --------\n>  1 file changed, 8 deletions(-)\n> \n> diff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\n> index ca1d688c9b..ef190d8748 100644\n> --- a/Documentation/MyFirstContribution.adoc\n> +++ b/Documentation/MyFirstContribution.adoc\n> @@ -40,14 +40,6 @@ the list by sending an email to <git+subscribe@vger.kernel.org>\n>  The https://lore.kernel.org/git[archive] of this mailing list is\n>  available to view in a browser.\n>  \n> -==== https://groups.google.com/forum/#!forum/git-mentoring[git-mentoring@googlegroups.com]\n> -\n> -This mailing list is targeted to new contributors and was created as a place to\n> -post questions and receive answers outside of the public eye of the main list.\n> -Veteran contributors who are especially interested in helping mentor newcomers\n> -are present on the list. In order to avoid search indexers, group membership is\n> -required to view messages; anyone can join and no approval is required.\n> -\n>  ==== https://web.libera.chat/#git-devel[#git-devel] on Libera Chat\n>  \n>  This IRC channel is for conversations between Git contributors. If someone is\n> -- \n> 2.49.GIT\n\nThe contents of the series now look good to me, I have no problem with\nthem being merged as is.\n\nBy the way, when I look at your history on the mailing list I think this\nis your first multi-patch series; I think when preparing v2 you forgot to\ninclude --cover-letter in your arguments to `git format-patch`. On this\nlist it's more typical to always include a cover letter with multipatch\nseries, which you did with your initial version but forgot on this one.\n:)\n\nI'll leave it up to Junio whether this is acceptable to merge as-is or\nwhether he needs a cover letter, but all of v2 LGTM.\n\n - Emily\n\n> \n> \n"},{"id":"518318","messageId":"xmqqecworq39.fsf@gitster.g","threadId":"63302","inReplyTo":"20250516185516.52311-1-jayatheerthkulkarni2005@gmail.com","subject":"Re: [PATCH v2 1/3] docs: remove unused mentoring mailing list reference","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-17T01:19:38Z","receivedAt":"2025-05-17T01:19:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"K Jayatheerth <jayatheerthkulkarni2005@gmail.com> writes:\n\n> The git-mentoring group is being removed because new contributors\n> now approach the main mailing list directly and\n> almost always receive responses.\n> To reflect current practices and avoid confusion,\n> references to the unused mentoring list have been removed.\n\nWe typically phrase the last line more like\n\n\tremove the reference to the unused mentoring group.\n\ni.e., to give an order to the sources to \"become like so\".  Also,\nthe early part contrasted the mentoring group vs the main mailing\nlist, so \"group\" would probably be a less confusing reference.\n\nOther than that, looks OK.  The actual change is also good.\n\n> Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n> ---\n>  Documentation/MyFirstContribution.adoc | 8 --------\n>  1 file changed, 8 deletions(-)\n>\n> diff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\n> index ca1d688c9b..ef190d8748 100644\n> --- a/Documentation/MyFirstContribution.adoc\n> +++ b/Documentation/MyFirstContribution.adoc\n> @@ -40,14 +40,6 @@ the list by sending an email to <git+subscribe@vger.kernel.org>\n>  The https://lore.kernel.org/git[archive] of this mailing list is\n>  available to view in a browser.\n>  \n> -==== https://groups.google.com/forum/#!forum/git-mentoring[git-mentoring@googlegroups.com]\n> -\n> -This mailing list is targeted to new contributors and was created as a place to\n> -post questions and receive answers outside of the public eye of the main list.\n> -Veteran contributors who are especially interested in helping mentor newcomers\n> -are present on the list. In order to avoid search indexers, group membership is\n> -required to view messages; anyone can join and no approval is required.\n> -\n>  ==== https://web.libera.chat/#git-devel[#git-devel] on Libera Chat\n>  \n>  This IRC channel is for conversations between Git contributors. If someone is\n"},{"id":"518319","messageId":"20250517033626.8052-1-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"xmqqecworq39.fsf@gitster.g","subject":"[PATCH v3 0/3] Update MyFirstContribution.adoc to follow modern practices","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-17T03:36:23Z","receivedAt":"2025-05-17T03:36:35Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"The following changes are made to MyFirstContribution.adoc \nto make the tutorial follow modern git practices.\n\nThe tutorial codes actually help newbies like myself to actually know what is going on \nin the source code as the Git source code is vast.\n\nTherefore these patches.\n\n\nK Jayatheerth (3):\n  docs: remove unused mentoring mailing list reference\n  docs: clarify cmd_psuh signature and explain UNUSED macro\n  docs: replace git_config to repo_config\n\n Documentation/MyFirstContribution.adoc | 47 ++++++++++++++------------\n 1 file changed, 25 insertions(+), 22 deletions(-)\n\n-- \n2.49.GIT\n\n"},{"id":"518320","messageId":"20250517033626.8052-2-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250517033626.8052-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH v3 1/3] docs: remove unused mentoring mailing list reference","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-17T03:36:24Z","receivedAt":"2025-05-17T03:36:37Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"The git-mentoring group is being removed because new contributors\nnow approach the main mailing list directly and\nalmost always receive responses.\nTo reflect current practices and avoid confusion,\nremove the reference to the unused mentoring group.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 8 --------\n 1 file changed, 8 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex ca1d688c9b..ef190d8748 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -40,14 +40,6 @@ the list by sending an email to <git+subscribe@vger.kernel.org>\n The https://lore.kernel.org/git[archive] of this mailing list is\n available to view in a browser.\n \n-==== https://groups.google.com/forum/#!forum/git-mentoring[git-mentoring@googlegroups.com]\n-\n-This mailing list is targeted to new contributors and was created as a place to\n-post questions and receive answers outside of the public eye of the main list.\n-Veteran contributors who are especially interested in helping mentor newcomers\n-are present on the list. In order to avoid search indexers, group membership is\n-required to view messages; anyone can join and no approval is required.\n-\n ==== https://web.libera.chat/#git-devel[#git-devel] on Libera Chat\n \n This IRC channel is for conversations between Git contributors. If someone is\n-- \n2.49.GIT\n\n"},{"id":"518321","messageId":"20250517033626.8052-3-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250517033626.8052-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH v3 2/3] docs: clarify cmd_psuh signature and explain UNUSED macro","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-17T03:36:25Z","receivedAt":"2025-05-17T03:36:40Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"The documentation previously omitted the UNUSED macro,\nwhich often led to confusion for new contributors\nwhen they encountered compiler warnings related to unused parameters.\nThis commit adds a brief explanation to help clarify its\npurpose and common usage in the Git codebase.\n\nAdditionally, the function signature for cmd_psuh has been updated\nto include the struct repository *repo argument,\nalign it with standard practices.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 20 +++++++++++++++-----\n 1 file changed, 15 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex ef190d8748..f4320d8869 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -142,7 +142,15 @@ command in `builtin/psuh.c`. Create that file, and within it, write the entry\n point for your command in a function matching the style and signature:\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix)\n+int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo)\n+----\n+\n+We will use the UNUSED macro to make sure we don't recieve compiler warnings\n+for unused arguments from the function cmd_psuh.\n+\n+----\n+int cmd_psuh(int argc UNUSED, const char **argv UNUSED,\n+\t    const char *prefix UNUSED, struct repository *repo UNUSED)\n ----\n \n We'll also need to add the declaration of psuh; open up `builtin.h`, find the\n@@ -150,7 +158,7 @@ declaration for `cmd_pull`, and add a new line for `psuh` immediately before it,\n in order to keep the declarations alphabetically sorted:\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix);\n+int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo);\n ----\n \n Be sure to `#include \"builtin.h\"` in your `psuh.c`. You'll also need to\n@@ -166,7 +174,8 @@ Throughout the tutorial, we will mark strings for translation as necessary; you\n should also do so when writing your user-facing commands in the future.\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix)\n+int cmd_psuh(int argc UNUSED, const char **argv UNUSED, \n+\t    const char *prefix UNUSED, struct repository *repo UNUSED)\n {\n \tprintf(_(\"Pony saying hello goes here.\\n\"));\n \treturn 0;\n@@ -279,8 +288,9 @@ on the reference implementation linked at the top of this document.\n It's probably useful to do at least something besides printing out a string.\n Let's start by having a look at everything we get.\n \n-Modify your `cmd_psuh` implementation to dump the args you're passed, keeping\n-existing `printf()` calls in place:\n+Modify your `cmd_psuh` implementation to dump the args you're passed,\n+keeping existing `printf()` calls in place; because the args are now\n+used, remove the `UNUSED` macro from them:\n \n ----\n \tint i;\n-- \n2.49.GIT\n\n"},{"id":"518322","messageId":"20250517033626.8052-4-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250517033626.8052-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH v3 3/3] docs: replace git_config to repo_config","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-17T03:36:26Z","receivedAt":"2025-05-17T03:36:42Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"This change updates the example in cmd_psuh to use repo_config and\nrepo_config_get_string_tmp instead of the global git_config functions.\n\nWhile git_config() accesses global configuration via the_repository,\nusing repo_config() makes use of the repo parameter passed to built-in commands.\nThis is the preferred pattern in the Git codebase,\nrespect repository-specific configuration (e.g., .git/config)\nand avoid relying on global state.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 19 ++++++++++---------\n 1 file changed, 10 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex f4320d8869..8c2ca5c092 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -314,7 +314,8 @@ on the command line, including the name of our command. (If `prefix` is empty\n for you, try `cd Documentation/ && ../bin-wrappers/git psuh`). That's not so\n helpful. So what other context can we get?\n \n-Add a line to `#include \"config.h\"`. Then, add the following bits to the\n+Add a line to `#include \"config.h\"` and `#include \"repository.h\"`.\n+Then, add the following bits to the function body:\n function body:\n \n ----\n@@ -322,18 +323,18 @@ function body:\n \n ...\n \n-\tgit_config(git_default_config, NULL);\n-\tif (git_config_get_string_tmp(\"user.name\", &cfg_name) > 0)\n+\trepo_config(repo, git_default_config, NULL);\n+\tif (repo_config_get_string_tmp(repo, \"user.name\", &cfg_name))\n \t\tprintf(_(\"No name is found in config\\n\"));\n \telse\n \t\tprintf(_(\"Your name: %s\\n\"), cfg_name);\n ----\n \n-`git_config()` will grab the configuration from config files known to Git and\n-apply standard precedence rules. `git_config_get_string_tmp()` will look up\n+`repo_config()` will grab the configuration from config files known to Git and\n+apply standard precedence rules. `repo_config_get_string_tmp()` will look up\n a specific key (\"user.name\") and give you the value. There are a number of\n single-key lookup functions like this one; you can see them all (and more info\n-about how to use `git_config()`) in `Documentation/technical/api-config.adoc`.\n+about how to use `repo_config()`) in `Documentation/technical/api-config.adoc`.\n \n You should see that the name printed matches the one you see when you run:\n \n@@ -366,7 +367,7 @@ status_init_config(&s, git_status_config);\n ----\n \n But as we drill down, we can find that `status_init_config()` wraps a call\n-to `git_config()`. Let's modify the code we wrote in the previous commit.\n+to `repo_config()`. Let's modify the code we wrote in the previous commit.\n \n Be sure to include the header to allow you to use `struct wt_status`:\n \n@@ -382,8 +383,8 @@ prepare it, and print its contents:\n \n ...\n \n-\twt_status_prepare(the_repository, &status);\n-\tgit_config(git_default_config, &status);\n+\twt_status_prepare(repo, &status);\n+\trepo_config(repo, git_default_config, &status);\n \n ...\n \n-- \n2.49.GIT\n\n"},{"id":"518329","messageId":"xmqq34d3s6ed.fsf@gitster.g","threadId":"63302","inReplyTo":"20250516185516.52311-2-jayatheerthkulkarni2005@gmail.com","subject":"Re: [PATCH v2 2/3] docs: clarify cmd_psuh signature and explain UNUSED macro","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-17T13:39:38Z","receivedAt":"2025-05-17T13:39:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"K Jayatheerth <jayatheerthkulkarni2005@gmail.com> writes:\n\n> The documentation previously omitted the UNUSED macro,\n> which often led to confusion for new contributors\n> when they encountered compiler warnings related to unused parameters.\n\nThe above is not quite easy to reason about.  It is more like we\nwrote this document, and then later tightened the default compiler\nwarnings for developer builds.  So \"omitted\" may technically be\ncorrect, but it was more like \"did not use it, because there was no\nneed\".\n\n    The sample program, as written, would not build for at least two\n    reasons:\n\n    - Since this document was first written, the calling convention\n      to subcommand implementation has changed, and now cmd_psuh()\n      needs to accept the third parameter, repository.\n\n    - These days, compiler warning options for developers include\n      one that detects and complains about unused parameters, so\n      ones that are deliberately unused have to be marked as such.\n\nAfter such observation on the status quo and description of the\nproblem you are going to solve, you give an order to the code base\nto fix it, perhaps like:\n\n    Update the old-style examples to adjust to the current\n    practices, with explanations as needed.\n\n\nTo recap, the usual way to compose a log message of this project is\nto\n\n - Give an observation on how the current system works in the\n   present tense (so no need to say \"Currently X is Y\", or\n   \"Previously X was Y\" to describe the state before your change;\n   just \"X is Y\" is enough), and discuss what you perceive as a\n   problem in it.\n\n - Propose a solution (optional---often, problem description\n   trivially leads to an obvious solution in reader's minds).\n\n - Give commands to the codebase to \"become like so\".\n\nin this order.\n\n>\n> Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n> ---\n>  Documentation/MyFirstContribution.adoc | 20 +++++++++++++++-----\n>  1 file changed, 15 insertions(+), 5 deletions(-)\n>\n> diff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\n> index ef190d8748..f4320d8869 100644\n> --- a/Documentation/MyFirstContribution.adoc\n> +++ b/Documentation/MyFirstContribution.adoc\n> @@ -142,7 +142,15 @@ command in `builtin/psuh.c`. Create that file, and within it, write the entry\n>  point for your command in a function matching the style and signature:\n>  \n>  ----\n> -int cmd_psuh(int argc, const char **argv, const char *prefix)\n> +int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo)\n> +----\n> +\n> +We will use the UNUSED macro to make sure we don't recieve compiler warnings\n> +for unused arguments from the function cmd_psuh.\n> +----\n> +int cmd_psuh(int argc UNUSED, const char **argv UNUSED,\n> +\t    const char *prefix UNUSED, struct repository *repo UNUSED)\n>  ----\n\nI do not quite understand.  Why do we need a new one here?  Wouldn't\nit be easier to read for a newcomer if you just give the last one\nand explain what UNUSED are for?  Perhaps like\n\n    ... matching the style and signature:\n\n    ----\n    int cmd_psuh(int argc UNUSED, const char **argv UNUSED,\n\t         const char *prefix UNUSED, struct repository *repo UNUSED)\n    ----\n\n    A few things to note:\n\n    * A subcommand implementation takes its command line arguments\n      in `int argc` + `const char **argv`, like `main()` would\n\n    * It also takes two extra parameters, `prefix` and `repo`.  What\n      they mean will not be discussed until much later.\n\n    * Because this first example will not use any of the parameters,\n      your compiler will give warnings on unused parameters.  As the\n      list of these four parameters is mandated by the API to add\n      new built-in commands, you cannot omit them.  Instead, you add\n      `UNUSED` to each of them to tell the compiler that you _know_\n      you are not (yet) using it.\n\nTake a special note on the last one.  There may be multiple ways to\nsquelch warnings, but it is worth telling your readers that use of\nUNUSED is the right way.\n\nI'll stop here for this patch.\n\nThanks.\n"},{"id":"518331","messageId":"xmqqwmafqrtu.fsf@gitster.g","threadId":"63302","inReplyTo":"20250516185516.52311-3-jayatheerthkulkarni2005@gmail.com","subject":"Re: [PATCH v2 3/3] docs: replace git_config to repo_config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-17T13:39:41Z","receivedAt":"2025-05-17T13:39:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"K Jayatheerth <jayatheerthkulkarni2005@gmail.com> writes:\n\n> This change updates the example in cmd_psuh to use repo_config and\n> repo_config_get_string_tmp instead of the global git_config functions.\n>\n> While git_config() accesses global configuration via the_repository,\n> using repo_config() makes use of the repo parameter passed to built-in commands.\n> This is the preferred pattern in the Git codebase,\n> as it respects repository-specific configuration (e.g., .git/config)\n> and avoids relying on global state.\n\nAgain, do not start with \"I did this, I did that\".  The reason why\nyou needed to do such things is a lot more important.\n\n    Since this document was written, the built-in API has been\n    updated a few times, but the document was left stale.  Adjust to\n    the current best practices by calling repo_config() on the\n    repository instance the subcommand implementation receives as a\n    parameter, instead of calling git_config() that used to be the\n    common practice.\n\nor something like that, perhaps.\n"},{"id":"518335","messageId":"xmqqplg7qenl.fsf@gitster.g","threadId":"63302","inReplyTo":"CA+rGoLf7jf5r3C2mN7X84HNrWqsA9mMueEkCowm7Ftsgcd5EbQ@mail.gmail.com","subject":"Re: [PATCH 0/4] update MyFirstContribution with current code base","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-17T18:24:14Z","receivedAt":"2025-05-17T18:24:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n\n> On Fri, May 16, 2025 at 4:09 AM Emily Shaffer <nasamuffin@google.com> wrote:\n>\n>> Mostly I lurk these days :) I do still keep an eye on the list. Will\n>> happily take a look at your series tomorrow, I'm out of time for\n>> today. But per what I mention below, if you don't hear from me, please\n>> don't feel blocked by the review, as I think the MyFirstContribution\n>> doc is comfortably maintained by the whole project by now.\n>>\n>\n> Understood!! thanks for letting me know\n>\n>> > So for now I will cc Philippe\n>>\n>> For what it's worth, I don't think it is harmful to CC people even if\n>> they will be inactive. CCing someone is not necessarily the same thing\n>> as saying that person needs to approve your code change, right? So I\n>> don't see the harm in CCing with low expectations - in fact, in my\n>> case it would help make the email stand out, so you'd be more likely\n>> to get a review from me (I missed this thread going by initially).\n>>\n>>\n>\n> Oh, ok I will keep that in mind next time.\n>\n>>  - Emily\n>\n> Thank you,\n\nThanks, both.  \n"},{"id":"518338","messageId":"xmqqa57bqdxt.fsf@gitster.g","threadId":"63302","inReplyTo":"xmqq34d3s6ed.fsf@gitster.g","subject":"Re: [PATCH v2 2/3] docs: clarify cmd_psuh signature and explain UNUSED macro","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-17T18:39:42Z","receivedAt":"2025-05-17T18:39:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> K Jayatheerth <jayatheerthkulkarni2005@gmail.com> writes:\n>\n>> The documentation previously omitted the UNUSED macro,\n>> which often led to confusion for new contributors\n>> when they encountered compiler warnings related to unused parameters.\n>\n> The above is not quite easy to reason about.  It is more like we\n> wrote this document, and then later tightened the default compiler\n> warnings for developer builds.  So \"omitted\" may technically be\n> correct, but it was more like \"did not use it, because there was no\n> need\".\n>\n>     The sample program, as written, would not build for at least two\n>     reasons:\n\n\"not\" -> \"no longer\" to hint that the change in the environment,\nnot a bug in the document, is the reason of breakage.\n\n>     - Since this document was first written, the calling convention\n>       to subcommand implementation has changed, and now cmd_psuh()\n>       needs to accept the third parameter, repository.\n\n\"third\" -> \"fourth\"; I cannot count X-<.\n\n"},{"id":"518347","messageId":"20250518073442.72666-1-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"xmqqa57bqdxt.fsf@gitster.g","subject":"[PATCH v3 0/3] Update MyFirstContribution.adoc to follow modern practices","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-18T07:34:39Z","receivedAt":"2025-05-18T07:34:48Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"The following changes are made to MyFirstContribution.adoc \nto make the tutorial follow modern git practices.\n\nThe tutorial codes actually help newbies like myself to actually know what is going on \nin the source code as the Git source code is vast.\n\nTherefore these patches.\n\nK Jayatheerth (3):\n  docs: remove unused mentoring mailing list reference\n  docs: clarify cmd_psuh signature and explain UNUSED macro\n  docs: replace git_config to repo_config\n\n Documentation/MyFirstContribution.adoc | 55 +++++++++++++++-----------\n 1 file changed, 33 insertions(+), 22 deletions(-)\n\n-- \n2.49.GIT\n\n"},{"id":"518348","messageId":"20250518073442.72666-2-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250518073442.72666-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH v3 1/3] docs: remove unused mentoring mailing list reference","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-18T07:34:40Z","receivedAt":"2025-05-18T07:34:51Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"The git-mentoring group was initially created to help newcomers\nwith their development itches. However, in practice,\nmost of their questions were already being addressed\ndirectly on the mailing list, and contributors consistently\nreceived helpful responses there.\n\nRemove the mentoring group details from the Documentation.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 8 --------\n 1 file changed, 8 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex ca1d688c9b..ef190d8748 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -40,14 +40,6 @@ the list by sending an email to <git+subscribe@vger.kernel.org>\n The https://lore.kernel.org/git[archive] of this mailing list is\n available to view in a browser.\n \n-==== https://groups.google.com/forum/#!forum/git-mentoring[git-mentoring@googlegroups.com]\n-\n-This mailing list is targeted to new contributors and was created as a place to\n-post questions and receive answers outside of the public eye of the main list.\n-Veteran contributors who are especially interested in helping mentor newcomers\n-are present on the list. In order to avoid search indexers, group membership is\n-required to view messages; anyone can join and no approval is required.\n-\n ==== https://web.libera.chat/#git-devel[#git-devel] on Libera Chat\n \n This IRC channel is for conversations between Git contributors. If someone is\n-- \n2.49.GIT\n\n"},{"id":"518349","messageId":"20250518073442.72666-3-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250518073442.72666-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH v3 2/3] docs: clarify cmd_psuh signature and explain UNUSED macro","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-18T07:34:41Z","receivedAt":"2025-05-18T07:34:53Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"The sample program, as written, would no longer build for at least two\nreasons:\n\n    - Since this document was first written, the calling convention\n      to subcommand implementation has changed, and now cmd_psuh()\n      needs to accept the fourth parameter, repository.\n\n    - These days, compiler warning options for developers include\n      one that detects and complains about unused parameters, so\n      ones that are deliberately unused have to be marked as such.\n\nUpdate the old-style examples to adjust to the current\npractices, with explanations as needed.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 28 +++++++++++++++++++++-----\n 1 file changed, 23 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex ef190d8748..da15d43d1f 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -142,15 +142,31 @@ command in `builtin/psuh.c`. Create that file, and within it, write the entry\n point for your command in a function matching the style and signature:\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix)\n+int cmd_psuh(int argc UNUSED, const char **argv UNUSED,\n+\t     const char *prefix UNUSED, struct repository *repo UNUSED)\n ----\n \n+A few things to note:\n+\n+* A subcommand implementation takes its command line arguments\n+  in `int argc` + `const char **argv`, like `main()` would.\n+\n+* It also takes two extra parameters, `prefix` and `repo`. What\n+  they mean will not be discussed until much later.\n+\n+* Because this first example will not use any of the parameters,\n+  your compiler will give warnings on unused parameters. As the\n+  list of these four parameters is mandated by the API to add\n+  new built-in commands, you cannot omit them. Instead, you add\n+  `UNUSED` to each of them to tell the compiler that you *know*\n+  you are not (yet) using it.\n+\n We'll also need to add the declaration of psuh; open up `builtin.h`, find the\n declaration for `cmd_pull`, and add a new line for `psuh` immediately before it,\n in order to keep the declarations alphabetically sorted:\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix);\n+int cmd_psuh(int argc, const char **argv, const char *prefix, struct repository *repo);\n ----\n \n Be sure to `#include \"builtin.h\"` in your `psuh.c`. You'll also need to\n@@ -166,7 +182,8 @@ Throughout the tutorial, we will mark strings for translation as necessary; you\n should also do so when writing your user-facing commands in the future.\n \n ----\n-int cmd_psuh(int argc, const char **argv, const char *prefix)\n+int cmd_psuh(int argc UNUSED, const char **argv UNUSED, \n+\t     const char *prefix UNUSED, struct repository *repo UNUSED)\n {\n \tprintf(_(\"Pony saying hello goes here.\\n\"));\n \treturn 0;\n@@ -279,8 +296,9 @@ on the reference implementation linked at the top of this document.\n It's probably useful to do at least something besides printing out a string.\n Let's start by having a look at everything we get.\n \n-Modify your `cmd_psuh` implementation to dump the args you're passed, keeping\n-existing `printf()` calls in place:\n+Modify your `cmd_psuh` implementation to dump the args you're passed,\n+keeping existing `printf()` calls in place; because the args are now\n+used, remove the `UNUSED` macro from them:\n \n ----\n \tint i;\n-- \n2.49.GIT\n\n"},{"id":"518350","messageId":"20250518073442.72666-4-jayatheerthkulkarni2005@gmail.com","threadId":"63302","inReplyTo":"20250518073442.72666-1-jayatheerthkulkarni2005@gmail.com","subject":"[PATCH v3 3/3] docs: replace git_config to repo_config","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-18T07:34:42Z","receivedAt":"2025-05-18T07:34:55Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"Since this document was written, the built-in API has been\nupdated a few times, but the document was left stale.\n\nAdjust to the current best practices by calling repo_config() on the\nrepository instance the subcommand implementation receives as a\nparameter, instead of calling git_config() that used to be the\ncommon practice.\n\nSigned-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>\n---\n Documentation/MyFirstContribution.adoc | 19 ++++++++++---------\n 1 file changed, 10 insertions(+), 9 deletions(-)\n\ndiff --git a/Documentation/MyFirstContribution.adoc b/Documentation/MyFirstContribution.adoc\nindex da15d43d1f..08a3137101 100644\n--- a/Documentation/MyFirstContribution.adoc\n+++ b/Documentation/MyFirstContribution.adoc\n@@ -322,7 +322,8 @@ on the command line, including the name of our command. (If `prefix` is empty\n for you, try `cd Documentation/ && ../bin-wrappers/git psuh`). That's not so\n helpful. So what other context can we get?\n \n-Add a line to `#include \"config.h\"`. Then, add the following bits to the\n+Add a line to `#include \"config.h\"` and `#include \"repository.h\"`.\n+Then, add the following bits to the function body:\n function body:\n \n ----\n@@ -330,18 +331,18 @@ function body:\n \n ...\n \n-\tgit_config(git_default_config, NULL);\n-\tif (git_config_get_string_tmp(\"user.name\", &cfg_name) > 0)\n+\trepo_config(repo, git_default_config, NULL);\n+\tif (repo_config_get_string_tmp(repo, \"user.name\", &cfg_name))\n \t\tprintf(_(\"No name is found in config\\n\"));\n \telse\n \t\tprintf(_(\"Your name: %s\\n\"), cfg_name);\n ----\n \n-`git_config()` will grab the configuration from config files known to Git and\n-apply standard precedence rules. `git_config_get_string_tmp()` will look up\n+`repo_config()` will grab the configuration from config files known to Git and\n+apply standard precedence rules. `repo_config_get_string_tmp()` will look up\n a specific key (\"user.name\") and give you the value. There are a number of\n single-key lookup functions like this one; you can see them all (and more info\n-about how to use `git_config()`) in `Documentation/technical/api-config.adoc`.\n+about how to use `repo_config()`) in `Documentation/technical/api-config.adoc`.\n \n You should see that the name printed matches the one you see when you run:\n \n@@ -374,7 +375,7 @@ status_init_config(&s, git_status_config);\n ----\n \n But as we drill down, we can find that `status_init_config()` wraps a call\n-to `git_config()`. Let's modify the code we wrote in the previous commit.\n+to `repo_config()`. Let's modify the code we wrote in the previous commit.\n \n Be sure to include the header to allow you to use `struct wt_status`:\n \n@@ -390,8 +391,8 @@ prepare it, and print its contents:\n \n ...\n \n-\twt_status_prepare(the_repository, &status);\n-\tgit_config(git_default_config, &status);\n+\twt_status_prepare(repo, &status);\n+\trepo_config(repo, git_default_config, &status);\n \n ...\n \n-- \n2.49.GIT\n\n"},{"id":"518354","messageId":"CA+rGoLerj9U9T+3RAzk2qO5QoTwJc6M9HqsX1zMAJSDHq9c4OQ@mail.gmail.com","threadId":"63302","inReplyTo":"20250518073442.72666-4-jayatheerthkulkarni2005@gmail.com","subject":"Re: [PATCH v3 3/3] docs: replace git_config to repo_config","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2025-05-18T07:40:18Z","receivedAt":"2025-05-18T07:40:30Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"Whoops : )\n\nI think I did V3 again\n\nI think I should really start a new thread because this thread has 2\ndifferent sets of conversations going on\nWill send v4 in a new thread\n\n-Jayatheerth\n"},{"id":"518487","messageId":"CALnO6CD7Ao23nzV3QR208P3uvofqXXe6nLQ4v51wJ-WRDoF25g@mail.gmail.com","threadId":"63302","inReplyTo":"xmqqmsbcwn6t.fsf@gitster.g","subject":"Re: [PATCH 0/4] update MyFirstContribution with current code base","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-05-20T14:15:15Z","receivedAt":"2025-05-20T14:15:28Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Fri, May 16, 2025 at 12:11 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com> writes:\n>\n> > On Fri, May 16, 2025 at 4:09 AM Emily Shaffer <nasamuffin@google.com> wrote:\n> >\n> >> Mostly I lurk these days :) I do still keep an eye on the list. Will\n> >> happily take a look at your series tomorrow, I'm out of time for\n> >> today. But per what I mention below, if you don't hear from me, please\n> >> don't feel blocked by the review, as I think the MyFirstContribution\n> >> doc is comfortably maintained by the whole project by now.\n> >>\n> >\n> > Understood!! thanks for letting me know\n> >\n> >> > So for now I will cc Philippe\n> >>\n> >> For what it's worth, I don't think it is harmful to CC people even if\n> >> they will be inactive. CCing someone is not necessarily the same thing\n> >> as saying that person needs to approve your code change, right? So I\n> >> don't see the harm in CCing with low expectations - in fact, in my\n> >> case it would help make the email stand out, so you'd be more likely\n> >> to get a review from me (I missed this thread going by initially).\n> >>\n> >>\n> >\n> > Oh, ok I will keep that in mind next time.\n> >\n> >>  - Emily\n> >\n> > Thank you,\n>\n> Thanks for a pleasant conversation; others can also learn from this\n> exchange, hopefully.  In Documentation/SubmittingPatches we have\n> \"Choosing your reviewers\" section lacks anything more concrete than\n> \"who are involved in the area you are touching\", and those who use\n> common sense may say, just like you did, \"ah, most of the text I am\n> replacing was written N years ago by person X, whom I no longer see\n> on the list very often\" and decide to omit it.  Perhaps we would\n> want to enhance the text there somewhat?  I dunno.\n>\n> Since there were discussions on contrib/contacts recently (a few of\n> the participants there added to CC), I tried it and unfortunately I\n> was not very impressed by its output [*].\n>\n> After applying the four patches on top of 'master', you'd run the\n> tool like so:\n>\n>     $ contrib/contacts/git-contacts master..\n>     Jonathan Nieder <jrnieder@gmail.com>\n>     Jacob Stopak <jacob@initialcommit.io>\n>     Jeff King <peff@peff.net>\n>     Jean-Noël Avila <jn.avila@free.fr>\n>     Emily Shaffer <nasamuffin@google.com>\n>     Atharva Raykar <raykar.ath@gmail.com>\n>     Junio C Hamano <gitster@pobox.com>\n>     Todd Zullinger <tmz@pobox.com>\n>     Kyle Lippincott <spectral@google.com>\n>\n> The tool gave output in a different order every time it was run.  It\n> wasn't obvious what the ordering meant.\n>\n> By looking at its source, I can tell that the names and addresses\n> are collected from trailers like reported-by, which are counted with\n> the same importance as the authorship, that the reason why the\n> output is different each time it is run is due to use of keys %hash\n> in a Perl script, etc., but counting sign-off would mean that I'd be\n> summoned for each and every change related in this project, which\n> would not be very productive use of everybody's time.\n>\n> And it of course is not clear who are still active in the recent\n> past and why the name was in the list (it would not be as productive\n> to ask for a review from somebody who was listed for reporting many\n> problems in the area affected by the proposed patch than those who\n> wrote the original) from this output.  There may want an \"explain\"\n> mode that lets you feed a patch and get observations like:\n>\n>     The majority of lines you are touching haven't changed much\n>     since person X wrote commit W 5 years ago, and the text turned\n>     into current shape with contributions by person Y and Z.  Here\n>     are the URLs into the lore archive for the discussion that you\n>     can see how X, Y, and Z participated in the original before you\n>     touched.  You may also want to look at commit V and U as well.\n>\n>     Last time we saw person X, Y, and Z on the list were ..., here\n>     are the URLs into the lore archive.\n>\n> Perhaps some AI minded folks can write such a service for us ;-)?\n>\n>\n> [Footnote]\n>\n>  * I didn't try other alternatives which I didn't have, and the\n>    other thread there was a mention of \"git related\" with \"seems\n>    like rather more work\".\n>\n>    cf. https://lore.kernel.org/git/aBr9bwNQ1J46NNXI@pks.im/\n>\n\nI sometimes use another alternative \"git overwritten\" [1] which counts\nblame information instead. I've not tried to modify it to be\ncompatible with contacts, though.\n\nFor example, after applying the initial version of patches (which had\nwhitespace errors, btw; didn't check the latest version) on 7a1d2bd0a5\n(Merge branch 'master' of https://github.com/j6t/gitk, 2025-05-09),\n\"git overwritten\" shows\n\n  10 76644e3268 (documentation: add tutorial for first contribution,\n2019-05-17) by Emily Shaffer\n   5 a2dc43414c (MyFirstContribution: rephrase contact info,\n2020-02-13) by Emily Shaffer\n   3 4bb4fd4290 (MyFirstContribution: add avenues for getting help,\n2020-01-24) by Emily Shaffer\n   2 9a53219f69 (config: drop git_config_get_string_const(),\n2020-08-17) by Jeff King\n   2 2656fb16dd (doc: add some nit fixes to MyFirstContribution,\n2019-05-29) by Emily Shaffer\n   1 8b4b41aefb (MyFirstContribution: *.txt -> *.adoc fixes,\n2025-03-03) by Todd Zullinger\n\n[1]: https://github.com/benknoble/Dotfiles/blob/master/links/bin/git-overwritten\n\n-- \nD. Ben Knoble\n"}]}