Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Anyone want to help make zsh/db/gdbm work?



23.01.2015, 22:48, "Peter Stephenson" <p.w.stephenson@xxxxxxxxxxxx>:
> On Fri, 23 Jan 2015 18:49:14 +0300
> ZyX <kp-pav@xxxxxxxxx> wrote:
>>  23.01.2015, 09:00, "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>:
>>>  On Jan 23,  8:37am, ZyX wrote:
>>>  } It looks like if you forgot to `git add` Doc/Zsh/mod_db_gdbm.yo. I do
>>>  } not see it in the patch, only a small reference here.
>>>
>>>  Actually what I didn't realize was that one has to diff against
>>>  origin/master for new files, rather than against the local master.
>>  I have run into this problem a few times: by default git diffs against
>>  index (not the current revision) and when you do `git add` then file
>>  is added to the index as a whole making just `git diff` not present
>>  it.
>
> The standard fix for this is "git diff --staged" (or --cached) but you
> have to remember --- it's particular confusing if you've got some stuff
> staged and some not as you only get to see diffs for one or other.  I'm
> not sure it's quite what Bart is talking about as that seems to be
> about committed files.

No. Consider you do two things:

1. Modify file foo that is present in HEAD.
2. `git add` file bar which was not present in HEAD.

Possible results of `git diff` after these actions:

1. If you do `git diff` it will show you only modifications made to `foo`.
2. If you do `git diff --cached` you will only see bar contents in a diff. 
3. If you do `git diff HEAD` you will see both.

Whether you need to do one or the other depends on how you are going to commit and your workflow in general.

To diff committed files you need to use `git diff 'revspec^..revspec'` (yet another point I don’t like git for: even subversion is only asking you to specify refspec once. Do not tell me about aliases (shell and git), shell functions and other stuff, it is not fun to set them up everywhere I need git).

>
> pws



Messages sorted by: Reverse Date, Date, Thread, Author