{"thread":{"id":"53051","subject":"[RFC]rev-parse: rev-parse.h does not exist for rev-parse.c","startedAt":"2020-03-21T18:35:55Z","lastAt":"2020-03-21T19:42:00Z","messageCount":2,"participants":["Shourya Shukla","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"393650","messageId":"20200321183545.GA17453@konoha","threadId":"53051","inReplyTo":null,"subject":"[RFC]rev-parse: rev-parse.h does not exist for rev-parse.c","fromName":"Shourya Shukla","fromEmail":"shouryashukla.oo@gmail.com","sentAt":"2020-03-21T18:35:45Z","receivedAt":"2020-03-21T18:35:55Z","isPatch":false,"sender":{"key":"shouryashukla.oo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43680618?v=4"},"body":"Hello all,\n\nI was writing the C code for the summary subcommand of 'git submodule'\nwhen I came across this:\n\nI need to use 'git rev-parse' in the main frontend module_status()\nfunction. Now, instead of creating a string for the 'git rev-parse'\nusing 'argv_array_pushl()', I thought maybe I could call 'rev-parse.h'\nand use the 'cmd_rev_parse()' function directly.\n\nThe 'rev-parse.h' file does not exist, only its .c counterpart does. Is\nthere any reason for this? Would you advise creating a 'rev-parse.h'\nfile?\n\nThank you so much in advance for the help and comments :)\n\nRegards,\nShourya Shukla\n"},{"id":"393657","messageId":"xmqqy2rt8ph7.fsf@gitster.c.googlers.com","threadId":"53051","inReplyTo":"20200321183545.GA17453@konoha","subject":"Re: [RFC]rev-parse: rev-parse.h does not exist for rev-parse.c","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2020-03-21T19:41:56Z","receivedAt":"2020-03-21T19:42:00Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Shourya Shukla <shouryashukla.oo@gmail.com> writes:\n\n> using 'argv_array_pushl()', I thought maybe I could call 'rev-parse.h'\n> and use the 'cmd_rev_parse()' function directly.\n\nNever call cmd_foo() from within your program for any value of\nfoo(), as it is not part of the approved API.  cmd_foo() is meant to\nbe the entry point of \"run once and exit\" function, it is not just\nallowed but is expected to exit, and it also will do the in-core\nrepository setup etc.\n"}]}