git replace woes: dirty stat with clean workdir

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there,

when cooking up a "warning example" for git replace (don't draw
premature conclusions when there are replaced objects) I came across the
following problem: git status seems to compare the work dir with the
tree of HEAD, not the replacing tree. Even deleting the index does not help.

[ The example also shows that we need a way to specify
--no-replace-objects for gitk. Would easier if gitk really where git
something. ]

Michael

#!/bin/sh
rm -Rf rtest &&
mkdir rtest &&
cd rtest &&
git init &&
echo > comment &&
git add comment &&
git commit -m "empty comment" &&
echo nice > "comment" &&
git commit -am "nice comment" &&
echo ugly > "comment" &&
git commit -am "to be discarded" &&
git replace HEAD^^{tree} HEAD^{tree} &&
git reset --hard HEAD^ &&
git log -p &&
git st
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]