git reset -- path weirdness

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <Johannes.Schindelin@...>
Cc: <git@...>, <jasampler@...>, <gitster@...>
Date: Saturday, November 3, 2007 - 7:17 am

Hi,

I noticed some weirdness with git reset when a path is given. Basically
it seems to cycle the file through 3 states: unstaged, unmerged,
deleted(!) which is IMHO weird at best. A bisection showed that the
behaviour was introduced with the shell -> conversion of git-reset.

Extra annoyance is caused by the fact that "git status" tells you to add
the file when it is in the unmerged state, but that doesn't do anything.

Log of "git reset" switching through the states:

doener@atjola:git (master) $ git status
# On branch master
nothing to commit (working directory clean)

doener@atjola:git (master) $ git reset -- builtin-reset.c
builtin-reset.c: needs merge

doener@atjola:git (master) $ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
#       unmerged:   builtin-reset.c
#
no changes added to commit (use "git add" and/or "git commit -a")

doener@atjola:git (master) $ git reset -- builtin-reset.c

doener@atjola:git (master) $ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       deleted:    builtin-reset.c
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       builtin-reset.c

doener@atjola:git (master) $ git reset -- builtin-reset.c

doener@atjola:git (master) $ git status
# On branch master
nothing to commit (working directory clean)


Thanks,
Björn
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git reset -- path weirdness, Björn, (Sat Nov 3, 7:17 am)
[PATCH] git-reset: do not be confused if there is nothing to..., Johannes Schindelin, (Sat Nov 3, 9:12 am)
Re: git reset -- path weirdness, Johannes Schindelin, (Sat Nov 3, 8:03 am)