git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] git add -u ignores --dry-run flag
@ 2008-05-15 16:08 Gustaf Hendeby
  2008-05-15 16:20 ` [PATCH] Make git add -u honor --dry-run Miklos Vajna
  0 siblings, 1 reply; 13+ messages in thread
From: Gustaf Hendeby @ 2008-05-15 16:08 UTC (permalink / raw)
  To: Git Mailing List

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

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2008-05-23  8:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-15 16:08 [BUG] git add -u ignores --dry-run flag Gustaf Hendeby
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

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).