severity 671181 important
tags 671181 + upstream patch
forwarded 671181 http://thread.gmane.org/gmane.comp.version-control.git/196502
quit

Hi Enrico,

Enrico Zini wrote:

> While setting up a new repository, I stumbled into a sequence of commands 
> that,
> although it has an obvious mistake in it, surprisingly causes data loss.
[...]
>   rep1$ git pull rep2 master
>   remote: Counting objects: 3, done.
>   remote: Total 3 (delta 0), reused 0 (delta 0)
>   Unpacking objects: 100% (3/3), done.
>   From ../rep2
>    * branch            master     -> FETCH_HEAD
>
> # Let's have a look and panic
>
>   rep1$ ls -la
>   total 12
>   drwxr-xr-x 3 enrico enrico 4096 May  2 12:42 .
>   drwxr-xr-x 4 enrico enrico 4096 May  2 12:41 ..
>   drwxr-xr-x 8 enrico enrico 4096 May  2 12:42 .git
>   -rw-r--r-- 1 enrico enrico    0 May  2 12:42 silly-file
>   rep1$ git st
>   # On branch master
>   nothing to commit (working directory clean)
>   # HELP! Where has important-file gone?

Yep, that's no good.

There's a patch at [1], if you have time to try it.  It can be used
without rebuilding git from source by patching the git-pull file under
/usr/lib/git-core.

Thanks,
Jonathan

[1] http://thread.gmane.org/gmane.comp.version-control.git/196502/focus=196503



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to