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

Re: [PATCH] completion: complete modified files for checkout with '--'

From
CWCornelius Weig <cornelius.weig@tngtech.com>
Date
Feb 14, 2017, 21:13 UTC
Message-ID
<4f8a0aaa-4ce1-d4a6-d2e1-28aac7209c90@tngtech.com>
In-Reply-To
<CAM0VKj=d+hAiF6_8TLuJfccNiPtHyg9F6zESA8SuTEeaLsrw4Q@mail.gmail.com>
On 02/14/2017 01:50 AM, SZEDER Gábor wrote:
Show 9 quoted lines
> On Tue, Feb 14, 2017 at 12:33 AM,  <cornelius.weig@tngtech.com> wrote:
>> From: Cornelius Weig <cornelius.weig@tngtech.com>
>>
>> The command line completion for git-checkout bails out when seeing '--'
>> as an isolated argument. For git-checkout this signifies the start of a
>> list of files which are to be checked out. Checkout of files makes only
>> sense for modified files,
> 
> No, there is e.g. 'git checkout that-branch this-path', too.
Very true. Thanks for prodding me to this palpable oversight.

My error was to aim for a small improvement. I think the correct approach is to improve the overall completion of git-checkout. IMHO it is a completion bug that after giving a ref, completion will still offer refs, e.g. $ git checkout HEAD <TAB><TAB> --> list of refs

As far as I can see, giving two refs to checkout is always an error. The correct behavior in the example above would be to offer paths instead.

I'll follow up with an improved version which considers these cases.
Previous: SZEDER GáborNext: cornelius.weig@tngtech.com
Message 3 of 12 in “completion: complete modified files for checkout with '--'”
  1. completion: complete modified files for checkout with '--'cornelius.weig@tngtech.com, Feb 13, 2017
  2. SZEDER GáborFeb 14, 2017
  3. Cornelius WeigFeb 14, 2017
  4. 1/2 completion: extract utility to complete paths from tree-ishcornelius.weig@tngtech.com, Feb 14, 2017
  5. 2/2 completion: checkout: complete paths when ref givencornelius.weig@tngtech.com, Feb 14, 2017
  6. Junio C HamanoFeb 14, 2017
  7. Cornelius WeigFeb 14, 2017
  8. Junio C HamanoFeb 14, 2017
  9. SZEDER GáborFeb 15, 2017
  10. Cornelius WeigFeb 15, 2017
  11. SZEDER GáborFeb 15, 2017
  12. Cornelius WeigFeb 15, 2017

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.