zsh-workers
 help / color / mirror / code / Atom feed
From: ZyX <kp-pav@yandex.ru>
To: Peter Stephenson <p.w.stephenson@ntlworld.com>,
	"zsh-workers@zsh.org" <zsh-workers@zsh.org>
Subject: Re: Anyone want to help make zsh/db/gdbm work?
Date: Fri, 23 Jan 2015 23:00:48 +0300	[thread overview]
Message-ID: <7849891422043248@web3g.yandex.ru> (raw)
In-Reply-To: <20150123194719.229de1fb@ntlworld.com>

23.01.2015, 22:48, "Peter Stephenson" <p.w.stephenson@ntlworld.com>:
> On Fri, 23 Jan 2015 18:49:14 +0300
> ZyX <kp-pav@yandex.ru> wrote:
>>  23.01.2015, 09:00, "Bart Schaefer" <schaefer@brasslantern.com>:
>>>  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


  reply	other threads:[~2015-01-23 20:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23  5:19 Bart Schaefer
2015-01-23  5:37 ` ZyX
2015-01-23  5:59   ` Bart Schaefer
2015-01-23 15:49     ` ZyX
2015-01-23 19:47       ` Peter Stephenson
2015-01-23 20:00         ` ZyX [this message]
2015-01-23 20:16           ` Aaron Schrab
2015-01-23 20:33         ` Mikael Magnusson
2015-01-26 12:11 ` Peter Stephenson
2015-01-29 20:46   ` Peter Stephenson
2015-01-29 22:06     ` Bart Schaefer
2015-01-30  8:59       ` Peter Stephenson
2015-01-30 19:56         ` Peter Stephenson
2015-01-30 20:03           ` Bart Schaefer
2015-02-02  9:46             ` Peter Stephenson
2015-02-03 10:22               ` Peter Stephenson
2015-01-31  3:21         ` Bart Schaefer
2015-01-31  3:37           ` Bart Schaefer
2015-02-01 19:57             ` Bart Schaefer
2015-02-01 21:49             ` Bart Schaefer
2015-02-02  5:18 ` ZyX
2015-02-02 17:33   ` Peter Stephenson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7849891422043248@web3g.yandex.ru \
    --to=kp-pav@yandex.ru \
    --cc=p.w.stephenson@ntlworld.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).