* [RFC]rev-parse: rev-parse.h does not exist for rev-parse.c
@ 2020-03-21 18:35 Shourya Shukla
2020-03-21 19:41 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Shourya Shukla @ 2020-03-21 18:35 UTC (permalink / raw)
To: git; +Cc: gitster, peff, jnareb, christian.couder
Hello all,
I was writing the C code for the summary subcommand of 'git submodule'
when I came across this:
I need to use 'git rev-parse' in the main frontend module_status()
function. Now, instead of creating a string for the 'git rev-parse'
using 'argv_array_pushl()', I thought maybe I could call 'rev-parse.h'
and use the 'cmd_rev_parse()' function directly.
The 'rev-parse.h' file does not exist, only its .c counterpart does. Is
there any reason for this? Would you advise creating a 'rev-parse.h'
file?
Thank you so much in advance for the help and comments :)
Regards,
Shourya Shukla
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [RFC]rev-parse: rev-parse.h does not exist for rev-parse.c
2020-03-21 18:35 [RFC]rev-parse: rev-parse.h does not exist for rev-parse.c Shourya Shukla
@ 2020-03-21 19:41 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2020-03-21 19:41 UTC (permalink / raw)
To: Shourya Shukla; +Cc: git, peff, jnareb, christian.couder
Shourya Shukla <shouryashukla.oo@gmail.com> writes:
> using 'argv_array_pushl()', I thought maybe I could call 'rev-parse.h'
> and use the 'cmd_rev_parse()' function directly.
Never call cmd_foo() from within your program for any value of
foo(), as it is not part of the approved API. cmd_foo() is meant to
be the entry point of "run once and exit" function, it is not just
allowed but is expected to exit, and it also will do the in-core
repository setup etc.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-21 19:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-21 18:35 [RFC]rev-parse: rev-parse.h does not exist for rev-parse.c Shourya Shukla
2020-03-21 19:41 ` Junio C Hamano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.