Re: [PATCH 1/3] Move git_version_string to help.c before diff changes
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 10, 2012, 17:58 UTC
- Message-ID
- <7vty2yr2of.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <1328891972-23695-2-git-send-email-zbyszek@in.waw.pl>
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> writes:
> git_version_string lives in git.c. When diff.c starts to use functions > from help.c, which in turn use git_version_string, linking against > libgit.a will fail. This is because git_version_string is physically > located in git.o, and this object file is not part of libgit.a.
But what is wrong about that?
If you are making the termio related code reusable and sharable by turning the static "term_columns()" in help.o into an external symbol, there is no reason that termio related function, which is now useful outside the context of giving help, must stay in help.c where its life happened to have started. In fact, "tell me how wide the terminal is" does not belong to something called "help subsystem", no?
Wouldn't a new file, term.c or something, be a lot more suitable home for the function you will be reusing from diff and other parts of the system?