Re: [PATCHv5 3/3] status: don't suggest "git rm" or "git add" if not appropriate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 31, 2012 at 11:15 AM, Kong Lucien
<Lucien.Kong@xxxxxxxxxxxxxxx> wrote:
> The display of the advice '(use git add/rm [...])' (when there are
> unmerged files) after running 'git status' is now depending of the
> mark, whether it's 'both deleted', 'deleted by us/them' or others. For
> instance, when there is just one file that's marked as 'both deleted',
> 'git status' shows '(use git rm [...])' and if there are two files,
> one as 'both deleted' and the other as 'added by them', the advice is
> '(use git add/rm [...])'.
>
...
diff --git a/wt-status.c b/wt-status.c
...
> @@ -142,7 +167,17 @@ static void wt_status_print_unmerged_header(struct wt_status *s)
>                status_printf_ln(s, c, _("  (use \"git reset %s <file>...\" to unstage)"), s->reference);
>        else
>                status_printf_ln(s, c, _("  (use \"git rm --cached <file>...\" to unstage)"));
> -       status_printf_ln(s, c, _("  (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
> +
> +       if (!both_deleted) {
> +               if (!del_mod_conflict)
> +                       status_printf_ln(s, c, _("  (use \"git add <file>...\" to mark resolution)"));
> +               else
> +                       status_printf_ln(s, c, _("  (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
> +       } else if (!del_mod_conflict && !not_deleted) {
> +               status_printf_ln(s, c, _("  (use \"git rm <file>...\" to mark resolution)"));
> +       } else {
> +               status_printf_ln(s, c, _("  (use \"git add/rm <file>...\" as appropriate to mark resolution)"));
> +       }
>        status_printf_ln(s, c, "");
>  }


This brings a frequent frustration to the front.  It is not the fault
of this commit, so please don't think I am blaming you, Lucien.  Thank
you for highlighting it.

> +       } else if (!del_mod_conflict && !not_deleted) {
> +               status_printf_ln(s, c, _("  (use \"git rm <file>...\" to mark resolution)"));

Why should I be bothered when both sides delete the same file?  Does
this case only occur when each side has made different changes to the
file prior to deleting it, or does it occur any time each commit has
deleted the same exact file?

As this patch highlights, the only expected resolution is to 'git rm'
the file; why can't git figure this out for me and continue on?

Is there a config option to alter this behavior?

Phil
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]