git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gustaf Hendeby <hendeby@isy.liu.se>
To: Git Mailing List <git@vger.kernel.org>
Subject: [BUG] git add -u ignores --dry-run flag
Date: Thu, 15 May 2008 18:08:24 +0200	[thread overview]
Message-ID: <482C5FF8.1060200@isy.liu.se> (raw)

Hi!

I think this is a bug in the built in implementation of git add -u

$ git --version
git version 1.5.5.1.373.ga3200
$ git init
Initialized empty Git repository in /home/hendeby/bar/.git/
$ echo foo > foo
$ git add foo && git commit -m "Test"
Created initial commit 7477e8b: Test
  1 files changed, 1 insertions(+), 0 deletions(-)
  create mode 100644 foo
$ echo foo >> foo
$ git add -u --dry-run
$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   foo
#

I was expecting to get foo listed, and not actually added to the index.

I've had a quick look in builtin-add.c, and the -u option is tested for 
before the --dry-run option, and in the process of handling the -u 
option the code makes a jump that bypasses the --dry-run handling. 
Unfortunately, I'm not familiar enough with the code to see how to best 
fix it.

/Gustaf

             reply	other threads:[~2008-05-15 16:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-15 16:08 Gustaf Hendeby [this message]
2008-05-15 16:20 ` [PATCH] Make git add -u honor --dry-run Miklos Vajna
2008-05-15 18:46   ` Gustaf Hendeby
2008-05-15 23:42   ` Re* " Junio C Hamano
2008-05-16  0:13     ` Miklos Vajna
2008-05-19 22:14     ` Gustaf Hendeby
2008-05-22 18:16       ` Junio C Hamano
2008-05-22 19:34         ` Gustaf Hendeby
2008-05-22 20:38           ` Junio C Hamano
2008-05-22 21:12             ` Gustaf Hendeby
2008-05-22 21:59               ` [PATCH] Make git add -n and git -u -n output consistent Gustaf Hendeby
2008-05-23  4:40                 ` Junio C Hamano
2008-05-23  8:14                   ` Gustaf Hendeby

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=482C5FF8.1060200@isy.liu.se \
    --to=hendeby@isy.liu.se \
    --cc=git@vger.kernel.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.
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).