{"thread":{"id":"34154","subject":"[PATCH 1/2] show-ref.c: Add missing call to git_config()","startedAt":"2013-06-15T20:29:12Z","lastAt":"2013-07-04T18:25:44Z","messageCount":5,"participants":["Ramsay Jones","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"220962","messageId":"51BCCE98.3070201@ramsay1.demon.co.uk","threadId":"34154","inReplyTo":null,"subject":"[PATCH 1/2] show-ref.c: Add missing call to git_config()","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-06-15T20:29:12Z","receivedAt":"2013-06-15T20:29:12Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nAt present, 'git show-ref' ignores any attempt to set config\nvariables (e.g. core.checkstat) from the command line using\nthe -c option to git. In order to enable such usage, add the\nmissing call to git_config() from cmd_show_ref().\n\nSigned-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>\n---\n builtin/show-ref.c | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/builtin/show-ref.c b/builtin/show-ref.c\nindex 8d9b76a..95f5ca9 100644\n--- a/builtin/show-ref.c\n+++ b/builtin/show-ref.c\n@@ -191,6 +191,8 @@ int cmd_show_ref(int argc, const char **argv, const char *prefix)\n \tif (argc == 2 && !strcmp(argv[1], \"-h\"))\n \t\tusage_with_options(show_ref_usage, show_ref_options);\n \n+\tgit_config(git_default_config, NULL);\n+\n \targc = parse_options(argc, argv, prefix, show_ref_options,\n \t\t\t     show_ref_usage, PARSE_OPT_NO_INTERNAL_HELP);\n \n-- \n1.8.3\n"},{"id":"221027","messageId":"7vppvlighf.fsf@alter.siamese.dyndns.org","threadId":"34154","inReplyTo":"51BCCE98.3070201@ramsay1.demon.co.uk","subject":"Re: [PATCH 1/2] show-ref.c: Add missing call to git_config()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-17T03:05:48Z","receivedAt":"2013-06-17T03:05:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> At present, 'git show-ref' ignores any attempt to set config\n> variables (e.g. core.checkstat) from the command line using\n> the -c option to git.\n\nI think what you really want to see is not giving \"-c\" and have it\nhonored.\n\n\t\"git show-ref\" does not honor configuration variables at\n\tall, but at least core configuration variables read by\n\tgit_default_config (most importantly core.checkstat) should\n\tbe read and honored, because ...\n\nwould be more appropriate.  What are the variables that matter to\nshow-ref, and what are the reasons why they should be honored?  I\nthought show-ref was just a way to enumerate refs, and does not read\nthe index nor checks if there are modifications in the working tree,\nso I do not see any reason offhand for it to honor core.checkstat\n(and I think that is the reason why we don't have the call there in\nthe current code).\n\nExactly the same comment applies to 2/2.\n\nNote that I am _not_ opposing these changes.  You brought them up\nbecause you saw some reason why these should honor some core\nvariables.  I just want that reason to be explained in the log for\nthe future developers.\n"},{"id":"221282","messageId":"51C0A939.8030200@ramsay1.demon.co.uk","threadId":"34154","inReplyTo":"7vppvlighf.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/2] show-ref.c: Add missing call to git_config()","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-06-18T18:38:49Z","receivedAt":"2013-06-18T18:38:49Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n> \n>> At present, 'git show-ref' ignores any attempt to set config\n>> variables (e.g. core.checkstat) from the command line using\n>> the -c option to git.\n> \n> I think what you really want to see is not giving \"-c\" and have it\n> honored.\n> \n> \t\"git show-ref\" does not honor configuration variables at\n> \tall, but at least core configuration variables read by\n> \tgit_default_config (most importantly core.checkstat) should\n> \tbe read and honored, because ...\n> \n> would be more appropriate.  What are the variables that matter to\n> show-ref, and what are the reasons why they should be honored?  I\n> thought show-ref was just a way to enumerate refs, and does not read\n> the index nor checks if there are modifications in the working tree,\n> so I do not see any reason offhand for it to honor core.checkstat\n> (and I think that is the reason why we don't have the call there in\n> the current code).\n\n:-D Yes, you caught me!\n\nThese patches *may* not be necessary, prior to Michael's\n\"reference related races\" series. Specifically, the introduction\nof the stat_validity_check() function to the reference handling API.\n\nThis means that the behaviour 'git show-ref' is now affected by\nseveral config variables, including core.checkstat. I haven't\nspent any time auditing the code, but the list would include\n(at least) core.trustctime, core.filemode, core.checkstat,\ncore.ignorecygwinfstricks, ...\n\n> \n> Exactly the same comment applies to 2/2.\n\nditto\n\n> Note that I am _not_ opposing these changes.  You brought them up\n> because you saw some reason why these should honor some core\n> variables.  I just want that reason to be explained in the log for\n> the future developers.\n\nYes, I will send a v2 (soon-ish, I hope).\n\nATB,\nRamsay Jones\n"},{"id":"222308","messageId":"7vtxkeaq06.fsf@alter.siamese.dyndns.org","threadId":"34154","inReplyTo":"51C0A939.8030200@ramsay1.demon.co.uk","subject":"Re: [PATCH 1/2] show-ref.c: Add missing call to git_config()","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-01T21:56:00Z","receivedAt":"2013-07-01T21:56:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n\n> Yes, I will send a v2 (soon-ish, I hope).\n\nPing?\n\nNo need to hurry, but just to make sure this didn't disappear from\neverybody's radar.\n\nThanks.\n"},{"id":"222580","messageId":"51D5BE28.9040703@ramsay1.demon.co.uk","threadId":"34154","inReplyTo":"7vtxkeaq06.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/2] show-ref.c: Add missing call to git_config()","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsay1.demon.co.uk","sentAt":"2013-07-04T18:25:44Z","receivedAt":"2013-07-04T18:25:44Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"Junio C Hamano wrote:\n> Ramsay Jones <ramsay@ramsay1.demon.co.uk> writes:\n> \n>> Yes, I will send a v2 (soon-ish, I hope).\n> \n> Ping?\n> \n> No need to hurry, but just to make sure this didn't disappear from\n> everybody's radar.\n\nYep, this is still on my TODO list.\n\nSorry for being tardy on these patches. :(\n\nATB,\nRamsay Jones\n"}]}