Re: [PATCH v3 2/2] Reduce parse-options.o dependencies
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 11, 2011, 23:35 UTC
- Message-ID
- <7vr54ro72x.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20110811110441.GD5012@elie.gateway.2wire.net>
Jonathan Nieder <jrnieder@gmail.com> writes:
Show 13 quoted lines
>> diff --git a/parse-options-cb.c b/parse-options-cb.c >> new file mode 100644 >> index 0000000..c248f66 >> --- /dev/null >> +++ b/parse-options-cb.c >> @@ -0,0 +1,125 @@ >> +#include "git-compat-util.h" >> +#include "parse-options.h" >> +#include "cache.h" > > Style: Files in git tend to use only one of "git-compat-util.h", > "cache.h", or "builtin.h" and put it at the top. So in this case, it > should probably use just "cache.h".
This needs a bit of clarification.
The compatibility rule actually is to have git-compat-util.h at the very beginning. As cache.h is a very widely used header almost everybody that needs to access the internals include, it includes git-compat-util.h as its first thing to include.
So if this is an old file that existed before git-compat-util.h, then it is perfectly fine to start it with
#include "cache.h"
#include "parse-options.h"Otherwise the three-line include above is also just fine.