Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Updated _git completion (not attached)
- X-seq: zsh-workers 28818
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Nikolai Weibull <now@xxxxxxxx>
- Subject: Re: Updated _git completion (not attached)
- Date: Mon, 28 Feb 2011 18:21:56 +0100
- Cc: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>, Simon Ruderich <simon@xxxxxxxxxxxx>, Zsh Workers <zsh-workers@xxxxxxx>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=1+WFmnq45eDCGlaNo48tk010u3AZvH3BwKJP33W/RRI=; b=NkZJUenzE5d/p2mz6jwi9ZbyjnlFpTzCAgB8dNXDnVniwLF1d3P8duxYDr7L0L4n/a BGbbTyYmcW0DNDYBNyyEF0GhVo80uOY6tdeiP3d7xSvC41uwfUMxUkAubefp9Z6iWjHl xWrZXJ5N/PUumHxQuBVDkHXP7JdYYON1tNhAU=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=XYSHD+ygTg+GL3zDZaO882j+JBMhCP+0nM3X1qAHWqpg1pzxdb93Fme2mkuQJPMdXr CWEOonmBhxWYcIdwbuB2OHgcy9gxgHHJRq3fwCmjYcivpAh1Y9xWtpQtfkueTVRhl6Lv G4Zv8cJXOU5PmBTBpX1dxQv4pI0bVzqZhjcHQ=
- In-reply-to: <AANLkTikiXX-aurZ4YUGg+f8=cM=z=-Uj_w2nycEQFVSL@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <20110219133951.GA32368@ruderich.org> <AANLkTim_nZMNsvpCzF1Ezg0O_6xcuC5gGHrJzB0+4_Mm@mail.gmail.com> <20110228135851.GA23157@ruderich.org> <AANLkTinfE4x-qg=5BMX=OLTv53i2aFFAKSAZ-hcJTbY2@mail.gmail.com> <AANLkTikiXX-aurZ4YUGg+f8=cM=z=-Uj_w2nycEQFVSL@mail.gmail.com>
On 28 February 2011 18:07, Nikolai Weibull <now@xxxxxxxx> wrote:
> On Mon, Feb 28, 2011 at 17:33, Wayne Davison
> <wayned@xxxxxxxxxxxxxxxxxxxxx> wrote:
>>>
>>> On Sat, Feb 19, 2011 at 02:39:57PM +0100, Simon Ruderich wrote:
>>> - It seems like git checkout doesn't list only modified files but all
>>> files.
>
>> One thing to keep in mind is that it is right for it to list all
>> (known-to-git) files after a tag or hash, since the user may want to change
>> the file to a prior state. It is only the default "git checkout FILE" that
>> only really has meaning for changed files.
>
>> And, I had thought for sure that
>> git didn't allow filenames after git checkout -f (and indeed, the current
>> completion code doesn't complete files after it), but in my testing of git
>> 1.7.1, it accepted files to force w/o complaint.
>
> If no tree-ish is given it uses HEAD as the tree-ish to look for files
> in. Perhaps it should only list files modified between HEAD and the
> working tree when the tree-ish is HEAD.
Actually it looks in the index when no tree-ish is given, which is why
it restored the previously specified zsh-4.3.9 version of ChangeLog
when no tree-ish was given; that version was still in the index. If
you want to restore the current branch's version of a file when it has
changed staged, you have to explicitly say HEAD.
(This also applies when you have done changes to a file, git-added
them, and then do more changes. git checkout with no tree-ish and the
filename will then restore the version you last added.)
As far as I can tell, -f only affects behaviour when switching
branches or when specified files have unmerged changes (as in from a
merge or rebase conflict), and not otherwise when specifying explicit
files even when they have unstaged changes.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author