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

Re: [PATCH v3] use delete_refs when deleting tags or branches

From
Phil Hord <phil.hord@gmail.com>
Date
Jan 22, 2021, 20:29 UTC
Message-ID
<CABURp0rvK=53L6UsSirZ0bs-FhK+s_3s7VNvwhR4ky-Pf7HEog@mail.gmail.com>
In-Reply-To
<xmqqlfclaf6b.fsf@gitster.c.googlers.com>
On Thu, Jan 21, 2021 at 6:17 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 25 quoted lines
>
> Phil Hord <phil.hord@gmail.com> writes:
>
> > Oof.  Sorry.  I forgot I have diff.noprefix=true in my local config.
> > It is a huge timesaver for me when looking at diffs on a console since
> > I can quickly highlight the filename with a mouse to paste into an
> > editor.
> >
> > Sometimes it bites me, though.  Usually I notice in the diff, but this
> > one I was sending with format-patch / send-email.
> >
> > I guess I'll turn that off in git.git so I don't misfire at you again someday.
>
> I think per-repository configuration might be sufficient for this
> particular case (after all, it is project's preference), I wonder if
> a more command-specific variant of diff.noprefix so that "log -p"
> and "format-patch" can be configured separately would make sense,
> something like...
>
>     [diff]
>         noprefix = true
>     [diff "format-patch"]
>         noprefix = false
>     [diff "show"]
>         noprefix = false

That seems reasonable. I was trying to think of something clever like a setting like "auto" that means "noprefix when output is to a tty". But I still sometimes send a patch to a coworker that I copied from my console and I then have to remember to add back in the prefixes. So there is no perfect solution from Git, I think. The correct solution is to teach my console to skip the prefixes when I double-click the filename; or to add symlinks at `a` and `b` in my project; or something else. But these are all more painful than noprefix = true, so far.

Fwiw - I know this issue has been discussed on the list before; there are others who feel this itch.

Having config diff.<command>.noprefix seems reasonable as a fix for format-patch. At first glance it seems like this could get confused with diff.<driver>.*, but I suppose those settings are all specific to a driver section, so it would be easy enough to keep them separate.

Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “use delete_refs when deleting tags or branches”
  1. use delete_refs when deleting tags or branchesPhil Hord, Jan 21, 2021
  2. Junio C HamanoJan 22, 2021
  3. Phil HordJan 22, 2021
  4. Junio C HamanoJan 22, 2021
  5. Phil HordJan 22, 2021
  6. Junio C HamanoJan 22, 2021

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.