{"thread":{"id":"63488","subject":"Proposal: Add tip to use git update-git-for-windows when running git help or git version on Windows","startedAt":"2025-05-20T19:31:28Z","lastAt":"2025-05-22T03:18:27Z","messageCount":6,"participants":["Aditya Garg","brian m. carlson","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"518525","messageId":"PN3PR01MB9597FDF30B7CE529985DE546B89FA@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM","threadId":"63488","inReplyTo":null,"subject":"Proposal: Add tip to use git update-git-for-windows when running git help or git version on Windows","fromName":"Aditya Garg","fromEmail":"gargaditya08@live.com","sentAt":"2025-05-20T19:31:24Z","receivedAt":"2025-05-20T19:31:28Z","isPatch":false,"sender":{"key":"gargaditya08@live.com","avatar":"https://avatars.githubusercontent.com/u/85610623?v=4"},"body":"I've recently started exploring git for windows, and one thing I noticed was, there was no sign of updates! I googled a bit and found the git update-git-for-windows command. I think it would be nice if we could add a line like:\n\n\"Tip: Run `git update-git-for-windows` to update git\"\n\nAt the last of the output when we run git help, git version or both.\n\nLooking at the code, adding a compiler flag to check for windows in help.c and print it seems to be a possible solution."},{"id":"518577","messageId":"PN3PR01MB9597AFD63B750703E90AD18BB89EA@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM","threadId":"63488","inReplyTo":"PN3PR01MB9597FDF30B7CE529985DE546B89FA@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM","subject":"[PATCH] help: inform about 'git update-git-for-windows' on Windows","fromName":"Aditya Garg","fromEmail":"gargaditya08@live.com","sentAt":"2025-05-21T14:22:29Z","receivedAt":"2025-05-21T14:22:51Z","isPatch":true,"sender":{"key":"gargaditya08@live.com","avatar":"https://avatars.githubusercontent.com/u/85610623?v=4"},"body":"Not only there is a nice installer to install git on Windows, there\nis also a very nice command, git update-git-for-windows that makes\nupdating git easy. But what I have noticed is that many people,\nwhich also included me, are not aware of this command.\n\nLinux (and to some extend macOS) have awesome package managers, that\ncan handle updates very well, but on Windows, the preferred way of\ninstallation remains using an installer.\n\nAdding a little line indicating its existance and use while running\ngit help should be nice way to inform users of the same. This commit\nexactly does that. git help should output the following on windows\nafter this patch:\n\nusage: git [-v | --version] [-h | --help] [-C <path>] [-c <name>=<value>]\n           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]\n           [-p | --paginate | -P | --no-pager] [--no-replace-objects] [--no-lazy-fetch]\n           [--no-optional-locks] [--no-advice] [--bare] [--git-dir=<path>]\n           [--work-tree=<path>] [--namespace=<name>] [--config-env=<name>=<envvar>]\n           <command> [<args>]\n\nThese are common Git commands used in various situations:\n\nstart a working area (see also: git help tutorial)\n   clone      Clone a repository into a new directory\n   init       Create an empty Git repository or reinitialize an existing one\n\nwork on the current change (see also: git help everyday)\n   add        Add file contents to the index\n   mv         Move or rename a file, a directory, or a symlink\n   restore    Restore working tree files\n   rm         Remove files from the working tree and from the index\n\nexamine the history and state (see also: git help revisions)\n   bisect     Use binary search to find the commit that introduced a bug\n   diff       Show changes between commits, commit and working tree, etc\n   grep       Print lines matching a pattern\n   log        Show commit logs\n   show       Show various types of objects\n   status     Show the working tree status\n\ngrow, mark and tweak your common history\n   backfill   Download missing objects in a partial clone\n   branch     List, create, or delete branches\n   commit     Record changes to the repository\n   merge      Join two or more development histories together\n   rebase     Reapply commits on top of another base tip\n   reset      Reset current HEAD to the specified state\n   switch     Switch branches\n   tag        Create, list, delete or verify a tag object signed with GPG\n\ncollaborate (see also: git help workflows)\n   fetch      Download objects and refs from another repository\n   pull       Fetch from and integrate with another repository or a local branch\n   push       Update remote refs along with associated objects\n\n'git update-git-for-windows' can be used to update git.\n\n'git help -a' and 'git help -g' list available subcommands and some\nconcept guides. See 'git help <command>' or 'git help <concept>'\nto read about a specific subcommand or concept.\nSee 'git help git' for an overview of the system.\n\nSigned-off-by: Aditya Garg <gargaditya08@live.com>\n---\n help.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/help.c b/help.c\nindex 6ef90838f1..238ed1913c 100644\n--- a/help.c\n+++ b/help.c\n@@ -355,6 +355,9 @@ void list_common_cmds_help(void)\n \tputs(_(\"These are common Git commands used in various situations:\"));\n \tputchar('\\n');\n \tprint_cmd_by_category(common_categories, NULL);\n+#ifdef _WIN32\n+\tprintf(\"\\n'git update-git-for-windows' can be used to update git.\\n\");\n+#endif\n }\n \n void list_all_main_cmds(struct string_list *list)\n-- \n2.43.0\n\n"},{"id":"518624","messageId":"aC5MOl66YuIK1eyU@tapette.crustytoothpaste.net","threadId":"63488","inReplyTo":"PN3PR01MB9597AFD63B750703E90AD18BB89EA@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM","subject":"Re: [PATCH] help: inform about 'git update-git-for-windows' on Windows","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2025-05-21T21:57:14Z","receivedAt":"2025-05-21T21:57:17Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2025-05-21 at 14:22:29, Aditya Garg wrote:\n> diff --git a/help.c b/help.c\n> index 6ef90838f1..238ed1913c 100644\n> --- a/help.c\n> +++ b/help.c\n> @@ -355,6 +355,9 @@ void list_common_cmds_help(void)\n>  \tputs(_(\"These are common Git commands used in various situations:\"));\n>  \tputchar('\\n');\n>  \tprint_cmd_by_category(common_categories, NULL);\n> +#ifdef _WIN32\n> +\tprintf(\"\\n'git update-git-for-windows' can be used to update git.\\n\");\n> +#endif\n\nI don't think this belongs in our codebase.  It should instead be\ncarried as a patch in Git for Windows.  The reason is that there are a\nvariety of possible projects that compile for Windows—Git for Windows,\nCygwin, MINGW, etc.—and only one of them ships this binary.  It is even\npossible for users to compile their own Windows binaries, which I know\nis at least done by Microsoft as well as some Git contributors on\nWindows.\n\nThis change might be misleading or incorrect as it might tell users to\ninvoke a binary which is not present or to update software in a way\nwhich is not via the normal package mechanism.  For instance, telling a\nMINGW or Cygwin user to run that command would not result in anything\nuseful or desired happening.\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"},{"id":"518625","messageId":"xmqq5xht8uxm.fsf@gitster.g","threadId":"63488","inReplyTo":"aC5MOl66YuIK1eyU@tapette.crustytoothpaste.net","subject":"Re: [PATCH] help: inform about 'git update-git-for-windows' on Windows","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-05-21T22:23:33Z","receivedAt":"2025-05-21T22:23:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n\n> On 2025-05-21 at 14:22:29, Aditya Garg wrote:\n>> diff --git a/help.c b/help.c\n>> index 6ef90838f1..238ed1913c 100644\n>> --- a/help.c\n>> +++ b/help.c\n>> @@ -355,6 +355,9 @@ void list_common_cmds_help(void)\n>>  \tputs(_(\"These are common Git commands used in various situations:\"));\n>>  \tputchar('\\n');\n>>  \tprint_cmd_by_category(common_categories, NULL);\n>> +#ifdef _WIN32\n>> +\tprintf(\"\\n'git update-git-for-windows' can be used to update git.\\n\");\n>> +#endif\n>\n> I don't think this belongs in our codebase.  It should instead be\n> carried as a patch in Git for Windows.  The reason is that there are a\n> variety of possible projects that compile for Windows—Git for Windows,\n> Cygwin, MINGW, etc.—and only one of them ships this binary.  It is even\n> possible for users to compile their own Windows binaries, which I know\n> is at least done by Microsoft as well as some Git contributors on\n> Windows.\n>\n> This change might be misleading or incorrect as it might tell users to\n> invoke a binary which is not present or to update software in a way\n> which is not via the normal package mechanism.  For instance, telling a\n> MINGW or Cygwin user to run that command would not result in anything\n> useful or desired happening.\n\nDo you mean that this is OK if the #ifdef were more specific to\nGit-for-Windows?  Just being curious.\n"},{"id":"518626","messageId":"aC5bI_Y9-ZQPXJ4t@tapette.crustytoothpaste.net","threadId":"63488","inReplyTo":"xmqq5xht8uxm.fsf@gitster.g","subject":"Re: [PATCH] help: inform about 'git update-git-for-windows' on Windows","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2025-05-21T23:00:51Z","receivedAt":"2025-05-21T23:00:54Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2025-05-21 at 22:23:33, Junio C Hamano wrote:\n> \"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n> > I don't think this belongs in our codebase.  It should instead be\n> > carried as a patch in Git for Windows.  The reason is that there are a\n> > variety of possible projects that compile for Windows—Git for Windows,\n> > Cygwin, MINGW, etc.—and only one of them ships this binary.  It is even\n> > possible for users to compile their own Windows binaries, which I know\n> > is at least done by Microsoft as well as some Git contributors on\n> > Windows.\n> >\n> > This change might be misleading or incorrect as it might tell users to\n> > invoke a binary which is not present or to update software in a way\n> > which is not via the normal package mechanism.  For instance, telling a\n> > MINGW or Cygwin user to run that command would not result in anything\n> > useful or desired happening.\n> \n> Do you mean that this is OK if the #ifdef were more specific to\n> Git-for-Windows?  Just being curious.\n\nI don't think that would be a good idea, either.  There's no such #ifdef\nto my knowledge and we have lots of ways for people to update software.\nWe don't tell people to run commands to update to a newer version of\ntheir Debian package because that's a responsibility of the packager or\ndistributor, and so the same policy applies here.  If Debian wants that\nmessage to be included, then they can apply a patch and receive any bug\nreports or other feedback related to that message; same goes for Git for\nWindows.\n\nI also happen to know that in some corporate environments proxy problems\ncause the updater to break (which is not in any way a surprise) and\nthere are also cases where antivirus false positives flag the updater or\nother tools.  We do not in any way want to receive reports about those\nproblems or the updater and if we avoid recommending it, then we aren't\nresponsible for it.  Otherwise, we'll inevitably get a request to allow\npeople to configure that message because it doesn't work in their very\nspecial corporate environment and they don't want to confuse their\nusers.\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"},{"id":"518639","messageId":"PN3PR01MB9597B771CBDF19569B89AD1DB899A@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM","threadId":"63488","inReplyTo":"aC5bI_Y9-ZQPXJ4t@tapette.crustytoothpaste.net","subject":"Re: [PATCH] help: inform about 'git update-git-for-windows' on Windows","fromName":"Aditya Garg","fromEmail":"gargaditya08@live.com","sentAt":"2025-05-22T03:18:23Z","receivedAt":"2025-05-22T03:18:27Z","isPatch":true,"sender":{"key":"gargaditya08@live.com","avatar":"https://avatars.githubusercontent.com/u/85610623?v=4"},"body":"\n\n> On 22 May 2025, at 4:31 AM, brian m. carlson <sandals@crustytoothpaste.net> wrote:\n> \n> ﻿On 2025-05-21 at 22:23:33, Junio C Hamano wrote:\n>> \"brian m. carlson\" <sandals@crustytoothpaste.net> writes:\n>>> I don't think this belongs in our codebase.  It should instead be\n>>> carried as a patch in Git for Windows.  The reason is that there are a\n>>> variety of possible projects that compile for Windows—Git for Windows,\n>>> Cygwin, MINGW, etc.—and only one of them ships this binary.  It is even\n>>> possible for users to compile their own Windows binaries, which I know\n>>> is at least done by Microsoft as well as some Git contributors on\n>>> Windows.\n>>> \n>>> This change might be misleading or incorrect as it might tell users to\n>>> invoke a binary which is not present or to update software in a way\n>>> which is not via the normal package mechanism.  For instance, telling a\n>>> MINGW or Cygwin user to run that command would not result in anything\n>>> useful or desired happening.\n>> \n>> Do you mean that this is OK if the #ifdef were more specific to\n>> Git-for-Windows?  Just being curious.\n> \n> I don't think that would be a good idea, either.  There's no such #ifdef\n> to my knowledge and we have lots of ways for people to update software.\n> We don't tell people to run commands to update to a newer version of\n> their Debian package because that's a responsibility of the packager or\n> distributor, and so the same policy applies here.  If Debian wants that\n> message to be included, then they can apply a patch and receive any bug\n> reports or other feedback related to that message; same goes for Git for\n> Windows.\n> \n> I also happen to know that in some corporate environments proxy problems\n> cause the updater to break (which is not in any way a surprise) and\n> there are also cases where antivirus false positives flag the updater or\n> other tools.  We do not in any way want to receive reports about those\n> problems or the updater and if we avoid recommending it, then we aren't\n> responsible for it.  Otherwise, we'll inevitably get a request to allow\n> people to configure that message because it doesn't work in their very\n> special corporate environment and they don't want to confuse their\n> users.\n\nMakes sense, let's just drop this patch then.\n"}]}