{"thread":{"id":"65070","subject":"[RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","startedAt":"2026-02-24T20:41:00Z","lastAt":"2026-02-25T17:02:25Z","messageCount":14,"participants":["SoutrikDas","Junio C Hamano","K Jayatheerth","Lucas Seiki Oshiro","Kristoffer Haugsbakk","JAYATHEERTH K"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"537016","messageId":"20260224204047.8452-1-valusoutrik@gmail.com","threadId":"65070","inReplyTo":null,"subject":"[RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"SoutrikDas","fromEmail":"valusoutrik@gmail.com","sentAt":"2026-02-24T20:40:47Z","receivedAt":"2026-02-24T20:41:00Z","isPatch":true,"sender":{"key":"valusoutrik@gmail.com","avatar":"https://avatars.githubusercontent.com/u/56778179?v=4"},"body":"Hi everyone!\n\nI wish to undertake the \"Improve repo\" GSOC idea,so I was going through\nthe repo.c code and trying to make a small patch.\n\nI saw that by default \"git repo info\" does not print anything at all,\nI went through the first discussions [1] : \n>> Also add a flag --allow-empty, which will force the output data to be\n>> empty when no field is requested.\n>>\n>\n> Why do you suppose we need this, I'm not against it, but it would be\n> nice to state why this is necessary. The idea is to have a default\n> output when a user runs `git repo-info`, so I'm missing why this would\n> be useful.\n\nAnd \n\n> I was thinking about use cases where repo-info is used inside scripts.\n> A simple (but kinda useless...) example: an application that is a GUI\n> for this command, where the fields are selected in a checkbox, calling\n> repo-info with them and then displaying their contents in a dialog.\n> \n> In this example, if no field is selected and there's no validation in\n> the GUI side, the default set of data will be retrieved. With\n> git repo-info --allow-empty, we don't need to care about it.\n\nWould it not be a bit better if we allow the default behaviour to show all\nfields and then any subsequent scripts or application can make sure to \ncheck if they are appending any fields to the git repo info command, \nif not then dont show anything, because even if they ran the command without \nany fields they would get nothing. \n\nBut now if we change default behaviour to show all fields then it becomes a \nbit more user friendly.\n\n> After this review, I'm starting to think that leaving it empty by default\n> would be better. Specially after the review by Phillip Wood [2], who\n> has a good argument for it:\n> \n> \"\"\"\n>   As this is a plumbing command I think it would be clearer if the caller \n>   was required to specify the output format and the information that they \n>   require with an \"--all\" option for \"show me everything\" as Junio \n>   suggested. If we were to set defaults for the format and keys now we \n>   would be stuck with them forever.\n> \"\"\"\n\nI don't really have much experience writing scripts, but ... if one is \nscripting to get a certain value, would they not specify that ? like \nwhy would they excecute a \"git repo info\" without any fields?\n\nAlso ... mayeb this does not make much sense, but the\n'git repo info --all' has only 4 fields now, so showing all 4, should be okay ?\nOr maybe not.\n\n\n[1] : https://public-inbox.org/git/20250610152117.14826-1-lucasseikioshiro@gmail.com/t/#m04cb1fc694f334cc861f6ab146f50b45ae277874\n[2] : https://lore.kernel.org/git/af27af92-73d5-4f0a-84f4-9c91de6ab6e6@gmail.com/\n---\nPreviously, git repo info would print nothing,\nwhen invoked without arguements. Change the default\nbehaviour to display all available fields, to make\nit a little more user friendly.\n\nSigned-off-by: SoutrikDas <valusoutrik@gmail.com>\n---\n builtin/repo.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex 0ea045abc1..4d7efcd833 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -193,6 +193,8 @@ static int cmd_repo_info(int argc, const char **argv, const char *prefix,\n \n \tif (all_keys)\n \t\treturn print_all_fields(repo, format);\n+\telse if(!argc)\n+\t\treturn print_fields(argc, argv, repo, format);\n \telse\n \t\treturn print_fields(argc, argv, repo, format);\n }\n-- \n2.52.0\n\n"},{"id":"537017","messageId":"20260224210318.16547-1-valusoutrik@gmail.com","threadId":"65070","inReplyTo":"20260224204047.8452-1-valusoutrik@gmail.com","subject":"[PATCH v2] builtin/repo.c: change info default behavior to show all fields","fromName":"SoutrikDas","fromEmail":"valusoutrik@gmail.com","sentAt":"2026-02-24T21:03:18Z","receivedAt":"2026-02-24T21:03:34Z","isPatch":true,"sender":{"key":"valusoutrik@gmail.com","avatar":"https://avatars.githubusercontent.com/u/56778179?v=4"},"body":">  \tif (all_keys)\n>  \t\treturn print_all_fields(repo, format);\n> +\telse if(!argc)\n> +\t\treturn print_fields(argc, argv, repo, format);\nI did not mean to send the above patch. It was a mistake.\n---\n\nPreviously, git repo info would print nothing,\nwhen invoked without arguements. Change the default\nbehaviour to display all available fields, to make\nit a little more user friendly.\n\nSigned-off-by: SoutrikDas <valusoutrik@gmail.com>\n---\n builtin/repo.c | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/builtin/repo.c b/builtin/repo.c\nindex 0ea045abc1..d044d83b14 100644\n--- a/builtin/repo.c\n+++ b/builtin/repo.c\n@@ -191,7 +191,7 @@ static int cmd_repo_info(int argc, const char **argv, const char *prefix,\n \tif (all_keys && argc)\n \t\tdie(_(\"--all and <key> cannot be used together\"));\n \n-\tif (all_keys)\n+\tif (all_keys || !argc)\n \t\treturn print_all_fields(repo, format);\n \telse\n \t\treturn print_fields(argc, argv, repo, format);\n-- \n2.52.0\n\n"},{"id":"537019","messageId":"xmqq5x7lg7ip.fsf@gitster.g","threadId":"65070","inReplyTo":"20260224204047.8452-1-valusoutrik@gmail.com","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-24T21:23:58Z","receivedAt":"2026-02-24T21:24:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"SoutrikDas <valusoutrik@gmail.com> writes:\n\n>> After this review, I'm starting to think that leaving it empty by default\n>> would be better. Specially after the review by Phillip Wood [2], who\n>> has a good argument for it:\n>> \n>> \"\"\"\n>>   As this is a plumbing command I think it would be clearer if the caller \n>>   was required to specify the output format and the information that they \n>>   require with an \"--all\" option for \"show me everything\" as Junio \n>>   suggested. If we were to set defaults for the format and keys now we \n>>   would be stuck with them forever.\n>> \"\"\"\n>\n> I don't really have much experience writing scripts, but ... if one is \n> scripting to get a certain value, would they not specify that ? like \n> why would they excecute a \"git repo info\" without any fields?\n>\n> Also ... mayeb this does not make much sense, but the\n> 'git repo info --all' has only 4 fields now, so showing all 4, should be okay ?\n> Or maybe not.\n>\n>\n> [1] : https://public-inbox.org/git/20250610152117.14826-1-lucasseikioshiro@gmail.com/t/#m04cb1fc694f334cc861f6ab146f50b45ae277874\n> [2] : https://lore.kernel.org/git/af27af92-73d5-4f0a-84f4-9c91de6ab6e6@gmail.com/\n> ---\n> Previously, git repo info would print nothing,\n> when invoked without arguements. Change the default\n> behaviour to display all available fields, to make\n> it a little more user friendly.\n\nThe number of things do not matter.  \"user friendly\" does not\nmatter.\n\nThey do not matter plumbing commands intended to be used in scripts.\nWhat matters more is being predictable.\n\nThe silly example you saw in the discussion thread can be solved\neven if by default we showed everything.  The UI can count the\ncheckboxes it is going to turn into command's arguments (i.e., \"I\nwant to ask you about these pieces of information\"), and if that is\nempty, just can refrain from invoking the command.  But that is\narguably _more_ work on the script.  A simpler rule \"we give only\nwhat you ask, always, no exceptions that depends on the number of\nthings you ask (like when you ask for zero things)\" would end up\nbeing easier to use.\n\nAnd it is more predictable.  If you ask for two things, you get two\nthings.  If you ask for one thing, you get one thing.  If you ask\nfor zero things?  You get none.\n\nSo...?\n"},{"id":"537027","messageId":"20260224220833.17730-1-valusoutrik@gmail.com","threadId":"65070","inReplyTo":"xmqq5x7lg7ip.fsf@gitster.g","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"SoutrikDas","fromEmail":"valusoutrik@gmail.com","sentAt":"2026-02-24T22:08:33Z","receivedAt":"2026-02-24T22:08:42Z","isPatch":true,"sender":{"key":"valusoutrik@gmail.com","avatar":"https://avatars.githubusercontent.com/u/56778179?v=4"},"body":"> They do not matter plumbing commands intended to be used in scripts.\n> What matters more is being predictable.\n\nMy bad for this ... I did not know about plumbing commands.\n\n> And it is more predictable.  If you ask for two things, you get two\n> things.  If you ask for one thing, you get one thing.  If you ask\n> for zero things?  You get none.\n\nGot it.\nThanks for the clarification.\n"},{"id":"537042","messageId":"20260225001439.54954-1-jayatheerthkulkarni2005@gmail.com","threadId":"65070","inReplyTo":"20260224220833.17730-1-valusoutrik@gmail.com","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"K Jayatheerth","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2026-02-25T00:14:39Z","receivedAt":"2026-02-25T00:14:51Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":">> They do not matter plumbing commands intended to be used in scripts.\n>> What matters more is being predictable.\n\n> My bad for this ... I did not know about plumbing commands.\n\nIn the Pro Git book there is a chapter which has a very good description of\nplumbing vs porcelain [1]. It might help.\n\n>> And it is more predictable.  If you ask for two things, you get two\n>> things.  If you ask for one thing, you get one thing.  If you ask\n>> for zero things?  You get none.\n\n> Got it.\n> Thanks for the clarification.\n\n[1] https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain\n\nRegards,\nJayatheerth\n"},{"id":"537064","messageId":"xmqqjyw1cziy.fsf@gitster.g","threadId":"65070","inReplyTo":"20260225001439.54954-1-jayatheerthkulkarni2005@gmail.com","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-25T02:44:53Z","receivedAt":"2026-02-25T02:44:56Z","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>>> They do not matter plumbing commands intended to be used in scripts.\n>>> What matters more is being predictable.\n>\n>> My bad for this ... I did not know about plumbing commands.\n>\n> In the Pro Git book there is a chapter which has a very good description of\n> plumbing vs porcelain [1]. It might help.\n>\n>>> And it is more predictable.  If you ask for two things, you get two\n>>> things.  If you ask for one thing, you get one thing.  If you ask\n>>> for zero things?  You get none.\n>\n>> Got it.\n>> Thanks for the clarification.\n>\n> [1] https://git-scm.com/book/en/v2/Git-Internals-Plumbing-and-Porcelain\n>\n> Regards,\n> Jayatheerth\n\nThanks for clarifying what I left unsaid.  Very much appreciated.\n"},{"id":"537088","messageId":"4463000C-DB1D-4DBD-A474-95BF1003D36E@gmail.com","threadId":"65070","inReplyTo":"20260225001439.54954-1-jayatheerthkulkarni2005@gmail.com","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T15:11:02Z","receivedAt":"2026-02-25T15:11:19Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"\n> In the Pro Git book there is a chapter which has a very good description of\n> plumbing vs porcelain [1]. It might help.\n\nIndeed, I also think that the entire \"What is Git\" and \"Git Internals\"\nchapters are worth reading by those who want to contribute to Git.\n"},{"id":"537089","messageId":"20260225153132.7387-1-valusoutrik@gmail.com","threadId":"65070","inReplyTo":"20260225001439.54954-1-jayatheerthkulkarni2005@gmail.com","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"SoutrikDas","fromEmail":"valusoutrik@gmail.com","sentAt":"2026-02-25T15:31:32Z","receivedAt":"2026-02-25T15:31:42Z","isPatch":true,"sender":{"key":"valusoutrik@gmail.com","avatar":"https://avatars.githubusercontent.com/u/56778179?v=4"},"body":"> In the Pro Git book there is a chapter which has a very good description of\n> plumbing vs porcelain [1]. It might help.\n\nYup, after reading it I did realise how pointless my suggestion was.\n"},{"id":"537090","messageId":"20260225153414.7461-1-valusoutrik@gmail.com","threadId":"65070","inReplyTo":"xmqqjyw1cziy.fsf@gitster.g","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"SoutrikDas","fromEmail":"valusoutrik@gmail.com","sentAt":"2026-02-25T15:34:14Z","receivedAt":"2026-02-25T15:34:25Z","isPatch":true,"sender":{"key":"valusoutrik@gmail.com","avatar":"https://avatars.githubusercontent.com/u/56778179?v=4"},"body":"> Thanks for clarifying what I left unsaid.  Very much appreciated.\n\nHi, after reading that part I realised how pointless my mail was,\nso sorry about that.\n"},{"id":"537092","messageId":"20260225153850.9124-1-valusoutrik@gmail.com","threadId":"65070","inReplyTo":"4463000C-DB1D-4DBD-A474-95BF1003D36E@gmail.com","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"SoutrikDas","fromEmail":"valusoutrik@gmail.com","sentAt":"2026-02-25T15:38:50Z","receivedAt":"2026-02-25T15:38:58Z","isPatch":true,"sender":{"key":"valusoutrik@gmail.com","avatar":"https://avatars.githubusercontent.com/u/56778179?v=4"},"body":"> Indeed, I also think that the entire \"What is Git\" and \"Git Internals\"\n> chapters are worth reading by those who want to contribute to Git.\n\nYeah, that was my bad ... I should have read that before doing anything.\n"},{"id":"537094","messageId":"xmqqv7fkbzci.fsf@gitster.g","threadId":"65070","inReplyTo":"20260225153414.7461-1-valusoutrik@gmail.com","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2026-02-25T15:46:21Z","receivedAt":"2026-02-25T15:46:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"SoutrikDas <valusoutrik@gmail.com> writes:\n\n>> Thanks for clarifying what I left unsaid.  Very much appreciated.\n>\n> Hi, after reading that part I realised how pointless my mail was,\n> so sorry about that.\n\nNo, it wasn't pointless.  It merely was a bit too late.\n\nThanks for participating.\n"},{"id":"537095","messageId":"24b2c512-2ea5-485f-b286-ed79aafa9d5c@app.fastmail.com","threadId":"65070","inReplyTo":"20260225153414.7461-1-valusoutrik@gmail.com","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"Kristoffer Haugsbakk","fromEmail":"kristofferhaugsbakk@fastmail.com","sentAt":"2026-02-25T15:48:47Z","receivedAt":"2026-02-25T15:49:09Z","isPatch":true,"sender":{"key":"kristofferhaugsbakk@fastmail.com","avatar":null},"body":"On Wed, Feb 25, 2026, at 16:34, SoutrikDas wrote:\n>> Thanks for clarifying what I left unsaid.  Very much appreciated.\n>\n> Hi, after reading that part I realised how pointless my mail was,\n> so sorry about that.\n\nI didn’t read it as pointless at the time (and not now either). Just\nperfectly normal back and forth on a patch.\n"},{"id":"537098","messageId":"E0F6937A-7B0D-4162-9752-4AF5C6A88531@gmail.com","threadId":"65070","inReplyTo":"20260225153132.7387-1-valusoutrik@gmail.com","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"Lucas Seiki Oshiro","fromEmail":"lucasseikioshiro@gmail.com","sentAt":"2026-02-25T16:08:50Z","receivedAt":"2026-02-25T16:09:12Z","isPatch":true,"sender":{"key":"lucasseikioshiro@gmail.com","avatar":"https://avatars.githubusercontent.com/u/12701580?v=4"},"body":"Hi!\n\n> Yup, after reading it I did realise how pointless my suggestion was.\n\nI wouldn't say it was pointless, since you identified something that\nyou thought that could be improved, found the code to be changed and\nsent a patch proposing your change.\n\nThe default behaviour of git-repo-info with no arguments was not a\ncomplete consensus at the first place, some people thought it needed\nto return all the values, and some thought that no value should be\nreturned.\n\nAlthough in this case I was on the \"winner\" side (I'm using quotes\nbecause I don't think this is a competition), many changes that I\ndid were rejected at first place, and I couldn't see at first what\nwere the problems with them, which I couldn't see only after the\nreviewing process. The reviewing process is very strict, and it\ncouldn't be different, since Git is used by more than 90% of the\ndevelopers [2].\n\nFinally, I must say that most things that I think that should do\nfalls under three situations:\n\n1. Git already does that, and I didn't know\n2. It was already discussed, and people agreed that Git shouldn't\n   do it\n3. It's not possible to do that\n\nIn your case, it falls in the situation 2 and the discussion, being\nalready discussed [3]. But I understand that it can be frustrating\nsometimes, and hope you don't feel discouraged in contributing to\nGit.\n\n[1] 20250610152117.14826-1-lucasseikioshiro@gmail.com\n[2] https://survey.stackoverflow.co/2022/#version-control-version-control-system-prof\n[3] 20250915223618.13093-1-lucasseikioshiro@gmail.com\n\n"},{"id":"537102","messageId":"CA+rGoLd90PQ3TWTM8CE_jeWakJgeY_iuqoVWFm1DHOf8GBZHWw@mail.gmail.com","threadId":"65070","inReplyTo":"20260225153414.7461-1-valusoutrik@gmail.com","subject":"Re: [RFC RFC PATCH] builtin/repo.c: change info default behavior to show all fields","fromName":"JAYATHEERTH K","fromEmail":"jayatheerthkulkarni2005@gmail.com","sentAt":"2026-02-25T17:02:13Z","receivedAt":"2026-02-25T17:02:25Z","isPatch":true,"sender":{"key":"jayatheerthkulkarni2005@gmail.com","avatar":"https://avatars.githubusercontent.com/u/148841023?v=4"},"body":"On Wed, Feb 25, 2026 at 9:04 PM SoutrikDas <valusoutrik@gmail.com> wrote:\n>\n> > Thanks for clarifying what I left unsaid.  Very much appreciated.\n>\n> Hi, after reading that part I realised how pointless my mail was,\n> so sorry about that.\n\n\nTo be honest there is nothing to apologize for\nIn fact that is something I love about the Git community\nIt was a cultural shock for me calling people by their name instead of\nputting \"sir\" at the end like they do in India.\nNo one will ask you to say sorry for sending a patch that's for sure.\n\nThe list is super active and this will be gone under so many mails\nthat you will forget this existed.\n\nRegards\n- Jayatheerth\n"}]}