git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 1/2] rm: better error message on failure for multiple files

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jun 8, 2013, 13:51 UTC
Message-ID
<CALkWK0mqVCfrPgSLi1dnDv26YAyRrJJD_S179VYfEApmGkd4Uw@mail.gmail.com>
In-Reply-To
<1370680434-2709-1-git-send-email-Mathieu.Lienard--Mayor@ensimag.imag.fr>
Mathieu Lienard--Mayor wrote:
Show 10 quoted lines
> @@ -170,30 +175,47 @@ static int check_local_mod(unsigned char *head, int index_only)
>                  * "intent to add" entry.
>                  */
>                 if (local_changes && staged_changes) {
> -                       if (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD))
> -                               errs = error(_("'%s' has staged content different "
> -                                            "from both the file and the HEAD\n"
> -                                            "(use -f to force removal)"), name);
> +                       if (!index_only || !(ce->ce_flags & CE_INTENT_TO_ADD)) {
> +                               strbuf_addstr(&files_staged, "\n        ");
Ouch.  Wouldn't a string-list be more appropriate for this kind of thing?
Previous: Ramkumar RamachandraNext: Mathieu Liénard--Mayor
Message 8 of 10 in “rm: better error message on failure for multiple files”
  1. 1/2 rm: better error message on failure for multiple filesMathieu Lienard--Mayor, Jun 8, 2013
  2. 2/2 rm: introduce advice.rmHints to shorten messagesMathieu Lienard--Mayor, Jun 8, 2013
  3. Ramkumar RamachandraJun 8, 2013
  4. Mathieu Liénard--MayorJun 10, 2013
  5. Ramkumar RamachandraJun 10, 2013
  6. Matthieu MoyJun 10, 2013
  7. Ramkumar RamachandraJun 10, 2013
  8. Ramkumar RamachandraJun 8, 2013
  9. Mathieu Liénard--MayorJun 10, 2013
  10. Célestin MatteJun 10, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.