Re: What's cooking in git.git (Apr 2013, #05; Mon, 15)

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

 



Jeff King <peff@xxxxxxxx> writes:

> +static const char *add_would_remove_warning = N_(
> +/* indent for "warning: " */
> +         "In Git 2.0, 'git add <pathspec>...' will also update the\n"
> +"index for paths removed from the working tree that match the given\n"
> +"pathspec. If you want to 'add' only changed or newly created paths,\n"
> +"say 'git add --no-all <pathspec>...' instead.\n");
> +
>  static void warn_add_would_remove(const char *path)
>  {
> -	warning(_("In Git 2.0, 'git add <pathspec>...' will also update the\n"
> -		  "index for paths removed from the working tree that match\n"
> -		  "the given pathspec. If you want to 'add' only changed\n"
> -		  "or newly created paths, say 'git add --no-all <pathspec>...'"
> -		  " instead.\n\n"
> -		  "'%s' would be removed from the index without --no-all."),
> -		path);
> +	static int warned_once;
> +	if (!warned_once++)
> +		warning(_(add_would_remove_warning));
> +	warning("did not stage removal of '%s'", path);
>  }

Would "add --dry-run" say this, too?

>  static void update_callback(struct diff_queue_struct *q,
> @@ -84,10 +88,8 @@ static void update_callback(struct diff_queue_struct *q,
>  			}
>  			break;
>  		case DIFF_STATUS_DELETED:
> -			if (data->warn_add_would_remove) {
> +			if (data->warn_add_would_remove)
>  				warn_add_would_remove(path);
> -				data->warn_add_would_remove = 0;
> -			}
>  			if (data->flags & ADD_CACHE_IGNORE_REMOVAL)
>  				break;
>  			if (!(data->flags & ADD_CACHE_PRETEND))
--
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]