Subject: Re: [PATCH v3 3/6] Make the require_clean_work_tree() function reusable

From: Junio C Hamano <[email-masked]>
Date: Tue, 04 Oct 2016 11:52:36 -0700

Johannes Schindelin <[email-masked]> writes:

> 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 <[email-masked]>
> ---

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 <[email-masked]>
    Signed-off-by: Junio C Hamano <[email-masked]>

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.

> 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.