{"thread":{"id":"56521","subject":"[QUESTION] How to add new configuration variable","startedAt":"2021-09-17T10:44:47Z","lastAt":"2021-09-17T20:02:34Z","messageCount":5,"participants":["Bagas Sanjaya","Konstantin Ryabitsev","Đoàn Trần Công Danh","Carlo Arenas","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"436223","messageId":"9f3cc3f0-36db-f7e5-de1d-2c8c9f246884@gmail.com","threadId":"56521","inReplyTo":null,"subject":"[QUESTION] How to add new configuration variable","fromName":"Bagas Sanjaya","fromEmail":"bagasdotme@gmail.com","sentAt":"2021-09-17T10:44:42Z","receivedAt":"2021-09-17T10:44:47Z","isPatch":false,"sender":{"key":"bagasdotme@gmail.com","avatar":"https://avatars.githubusercontent.com/u/40219486?v=4"},"body":"Hi,\n\nSupposed that I'm writing git-foobar script (\"git-foobar.sh\"), which \ntakes configuration variable \"foobar.something\" (string type).\n\nHow can I add that configuration variable so that it can be used by the \nscript?\n\n-- \nAn old man doll... just what I always wanted! - Clara\n"},{"id":"436226","messageId":"20210917134318.scdqa6k4swzgo5k2@meerkat.local","threadId":"56521","inReplyTo":"9f3cc3f0-36db-f7e5-de1d-2c8c9f246884@gmail.com","subject":"Re: [QUESTION] How to add new configuration variable","fromName":"Konstantin Ryabitsev","fromEmail":"konstantin@linuxfoundation.org","sentAt":"2021-09-17T13:43:18Z","receivedAt":"2021-09-17T13:43:24Z","isPatch":false,"sender":{"key":"konstantin@linuxfoundation.org","avatar":"https://gravatar.com/avatar/7cb8827c6de56e1bd2dea16508c6708aa43feed3bf3813bcdacecdf96ceadd79?d=mp&s=160"},"body":"On Fri, Sep 17, 2021 at 05:44:42PM +0700, Bagas Sanjaya wrote:\n> Supposed that I'm writing git-foobar script (\"git-foobar.sh\"), which takes\n> configuration variable \"foobar.something\" (string type).\n> \n> How can I add that configuration variable so that it can be used by the\n> script?\n\nYou can just add it. :) Git doesn't complain when it finds configuration\nparameters it doesn't know anything about, it just ignores them.\n\nE.g. in your .gitconfig or individual repository .git/config:\n\n    [foobar]\n        something = yourvalue\n\n-K\n"},{"id":"436228","messageId":"YUSyNqd51euzvt8N@danh.dev","threadId":"56521","inReplyTo":"20210917134318.scdqa6k4swzgo5k2@meerkat.local","subject":"Re: [QUESTION] How to add new configuration variable","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2021-09-17T15:20:43Z","receivedAt":"2021-09-17T15:23:18Z","isPatch":false,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2021-09-17 09:43:18-0400, Konstantin Ryabitsev <konstantin@linuxfoundation.org> wrote:\n> On Fri, Sep 17, 2021 at 05:44:42PM +0700, Bagas Sanjaya wrote:\n> > Supposed that I'm writing git-foobar script (\"git-foobar.sh\"), which takes\n> > configuration variable \"foobar.something\" (string type).\n> > \n> > How can I add that configuration variable so that it can be used by the\n> > script?\n> \n> You can just add it. :) Git doesn't complain when it finds configuration\n> parameters it doesn't know anything about, it just ignores them.\n> \n> E.g. in your .gitconfig or individual repository .git/config:\n> \n>     [foobar]\n>         something = yourvalue\n\nOr just:\n\n\tgit config [--global] foobar.something yourvalue\n\n-- \nDanh\n"},{"id":"436229","messageId":"CAPUEspgv49ppMbwHMPjF6_4FBU1_tYk_DdXXOTDuWwAx74UL8Q@mail.gmail.com","threadId":"56521","inReplyTo":"9f3cc3f0-36db-f7e5-de1d-2c8c9f246884@gmail.com","subject":"Re: [QUESTION] How to add new configuration variable","fromName":"Carlo Arenas","fromEmail":"carenas@gmail.com","sentAt":"2021-09-17T16:21:20Z","receivedAt":"2021-09-17T16:21:35Z","isPatch":false,"sender":{"key":"carenas@gmail.com","avatar":"https://avatars.githubusercontent.com/u/76036?v=4"},"body":"you might want this in --global instead, but assuming it is ok to be\nrepository specific:\n\n$ git config foobar.something baz\n\nand in your script\n\n  baz=$(git config foobar.something)\n\nCarlo\n"},{"id":"436255","messageId":"xmqqilyzgecx.fsf@gitster.g","threadId":"56521","inReplyTo":"YUSyNqd51euzvt8N@danh.dev","subject":"Re: [QUESTION] How to add new configuration variable","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-09-17T20:02:22Z","receivedAt":"2021-09-17T20:02:34Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:\n\n> On 2021-09-17 09:43:18-0400, Konstantin Ryabitsev <konstantin@linuxfoundation.org> wrote:\n>> On Fri, Sep 17, 2021 at 05:44:42PM +0700, Bagas Sanjaya wrote:\n>> > Supposed that I'm writing git-foobar script (\"git-foobar.sh\"), which takes\n>> > configuration variable \"foobar.something\" (string type).\n>> > \n>> > How can I add that configuration variable so that it can be used by the\n>> > script?\n>> \n>> You can just add it. :) Git doesn't complain when it finds configuration\n>> parameters it doesn't know anything about, it just ignores them.\n>> \n>> E.g. in your .gitconfig or individual repository .git/config:\n>> \n>>     [foobar]\n>>         something = yourvalue\n>\n> Or just:\n>\n> \tgit config [--global] foobar.something yourvalue\n\nIn addition to that, unless it is a script for your throw-away use\nthat we do not have to worry about, consider if the users of \"git\nfoobar\" needs to override a configured value with --no-something or\n--something=anothervalue from the command line, and if so, make sure\nthese command line options are available to them.\n"}]}