<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2016-09-27 21:24 GMT+02:00 Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 20, 2016 at 10:39 PM, Tim Felgentreff <span dir="ltr">&lt;<a href="mailto:timfelgentreff@gmail.com" target="_blank">timfelgentreff@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><p dir="ltr">Hi Eliot, </p>
<p dir="ltr">When I did the migration I made a gitrevert script. It is in the scripts dir.</p></blockquote><div><br></div><div>Thanks Tim.  Just an FYI for Mac users, the script presumes an up-to-date git, but Mac OS X yosemite only ships with 2.4.9.  The upgrade is easy; I&#39;m currently using 2.10.0.</div></div></div></div></blockquote><div><br></div><div>Then apple unecessarily exposes its users to vulnerabilities, so they are urged to upgrade.<br><a href="http://www.theregister.co.uk/2016/03/16/git_server_client_patch_now/">http://www.theregister.co.uk/2016/03/16/git_server_client_patch_now/</a> (my son&#39;s discovery)<br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p dir="ltr"> </p>
<p dir="ltr">Best, <br>
Tim </p>
<div class="gmail_quote">Am 20.06.2016 23:12 schrieb &quot;Damien Pollet&quot; &lt;<a href="mailto:damien.pollet@gmail.com" target="_blank">damien.pollet@gmail.com</a>&gt;:<br type="attribution"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr">To complete Tobias&#39;s answer, git checkout HEAD -- &lt;files&gt; will restore files from the most recent commit even if changes were staged.<br><div><br></div>In what situation do you use that script?<div><br></div><div><div>People on stack overflow seem to have pretty polarized opinions about fiddling with timestamps… one of the answers has something close, but there might be a simpler way…</div><div><a href="http://stackoverflow.com/questions/1964470/whats-the-equivalent-of-use-commit-times-for-git" target="_blank">http://stackoverflow.com/quest<wbr>ions/1964470/whats-the-equival<wbr>ent-of-use-commit-times-for-<wbr>git</a><br></div><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 20 June 2016 at 22:40, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br><div dir="ltr"><div>Hi git mavens,</div><div><br></div><div>    I&#39;ve used a script called svnrevert in the svn version that reverts any changed file in its argument(s), which may be directories, /and/ sets the modification date to the date at which the file was last checked in. I&#39;d like the same functionality in git.  Her&#39;es the subversion version:</div><div><br></div><div><div>#!/bin/bash</div><div># Revert file(s) or all modified files in a directory</div><div># and touch them back to the checkin date</div><div>for f in &quot;$@&quot;</div><div>do</div><div><span style="white-space:pre-wrap">        </span>if [ -d &quot;$f&quot; ]; then</div><div><span style="white-space:pre-wrap">                </span>$0 `svn st &quot;$f&quot; | grep &quot;^M&quot; | sed &#39;s/^M *//&#39;`</div><div><span style="white-space:pre-wrap">        </span>else</div><div><span style="white-space:pre-wrap">                </span>if svn revert &quot;$f&quot;; then</div><div><span style="white-space:pre-wrap">                        </span>changed=&quot;`svn info \&quot;$f\&quot; | grep &#39;Last Changed Date:&#39; | sed &#39;s/ *(.*//&#39;`&quot;</div><div><span style="white-space:pre-wrap">                        </span>touch -t &quot;`date -j -f &#39;Last Changed Date: %Y-%m-%d %H:%M:%S %z&#39; \&quot;$changed\&quot; &#39;+%Y%m%d%H%M.%S&#39;`&quot; &quot;$f&quot;</div><div><span style="white-space:pre-wrap">                </span>fi</div><div><span style="white-space:pre-wrap">        </span>fi</div><div>done</div></div><div><br></div><div><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Damien Pollet<br>type less, do more [ | ] <a href="http://people.untyped.org/damien.pollet" target="_blank">http://people.untyped.org/dami<wbr>en.pollet</a><br></div>
</div>
<br></blockquote></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</div></div>
<br></blockquote></div><br></div></div>