Re: [PATCH v3 3/6] Make the require_clean_work_tree() function reusable
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 4, 2016, 18:52 UTC
- Message-ID
- <xmqqy424t097.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <3b4f46b761589d84b7713c869d00d3231ab346fd.1475586229.git.johannes.schindelin@gmx.de>
Johannes Schindelin <johannes.schindelin@gmx.de> writes:
Show 6 quoted lines
> It is remarkable that libgit.a did not sport this function yet... Let's > move it into a more prominent (and into an actually reusable) spot: > wt-status.[ch]. > > Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> > ---
Thanks.
I'd tweak the message while queuing, though.
wt-status: make the require_clean_work_tree() function reusable
The function "git pull" uses to stop the user when the working
tree has changes is useful in other places.
Let's move it into a more prominent (and into an actually reusable)
spot: wt-status.[ch].
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>Readers won't care whether you found something remarkable and even if they wanted to care, it is rather hard to sympathize with you unless they know what "this function" does well enough to understand why it is a good thing to make it available more widely. That is a more important point to address in the log message.
Show 9 quoted lines
> diff --git a/wt-status.c b/wt-status.c > index 9628c1d..b92c54d 100644 > --- a/wt-status.c > +++ b/wt-status.c > @@ -16,6 +16,7 @@ > #include "strbuf.h" > #include "utf8.h" > #include "worktree.h" > +#include "lockfile.h"
Makes sense. We'd be opportunistically refreshing the index.