<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"><<a href="mailto:timfelgentreff@gmail.com" target="_blank">timfelgentreff@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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'm currently using 2.10.0.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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 "Damien Pollet" <<a href="mailto:damien.pollet@gmail.com" target="_blank">damien.pollet@gmail.com</a>>:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr">To complete Tobias's answer, git checkout HEAD -- <files> 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/<wbr>questions/1964470/whats-the-<wbr>equivalent-of-use-commit-<wbr>times-for-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"><<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr"><div>Hi git mavens,</div><div><br></div><div> I'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'd like the same functionality in git. Her'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 "$@"</div><div>do</div><div><span style="white-space:pre-wrap">        </span>if [ -d "$f" ]; then</div><div><span style="white-space:pre-wrap">                </span>$0 `svn st "$f" | grep "^M" | sed 's/^M *//'`</div><div><span style="white-space:pre-wrap">        </span>else</div><div><span style="white-space:pre-wrap">                </span>if svn revert "$f"; then</div><div><span style="white-space:pre-wrap">                        </span>changed="`svn info \"$f\" | grep 'Last Changed Date:' | sed 's/ *(.*//'`"</div><div><span style="white-space:pre-wrap">                        </span>touch -t "`date -j -f 'Last Changed Date: %Y-%m-%d %H:%M:%S %z' \"$changed\" '+%Y%m%d%H%M.%S'`" "$f"</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 data-smartmail="gmail_signature"><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 data-smartmail="gmail_signature">Damien Pollet<br>type less, do more [ | ] <a href="http://people.untyped.org/damien.pollet" target="_blank">http://people.untyped.org/<wbr>damien.pollet</a><br></div>
</div>
<br></blockquote></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><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>