Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 Jun 2022 08:49:49 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Chris <bsd-lists@bsdforge.com>
Cc:        freebsd-git <freebsd-git@freebsd.org>
Subject:   Re: date based checkouts in git possible?
Message-ID:  <CANCZdfo0Pr7e-zd2MkxzsoOPP2Eq=gEF8hHyDs23NE7_mXT1qw@mail.gmail.com>
In-Reply-To: <015e19843ec9a8fb8b72313f28ca131e@bsdforge.com>
References:  <015e19843ec9a8fb8b72313f28ca131e@bsdforge.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--00000000000071aab605e0a05aa6
Content-Type: text/plain; charset="UTF-8"

On Fri, Jun 3, 2022 at 11:17 PM Chris <bsd-lists@bsdforge.com> wrote:

> I'm in need of checking out the ports tree as it was
> at an earlier date. But for the life of me, I can't
> seem to cobble up an/the incantation.
>
> All the suggestions I've read indicate something to
> the effect of
> git checkout `git rev-list -n 1 --before=<previous-date>" freebsd/main`
> which returns
> Your branch is up to date with 'freebsd/main'.
>
> What must I do? Or will I need to convert/import it into svn?
>

git checkout main@{<date>}

You may need to protect the {} from csh/tcsh eating them. You can also add
a time.
See the git-rev-parse man page for all the details.

Note, due to the temporal anomalies that sometimes are present in git,
the commit date and the author date differ, which can cause confusion
if you do a git log and not a git log --prety=fuller.

Warner

--00000000000071aab605e0a05aa6
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"><br></div><br><div class=3D"gmail_quote">=
<div dir=3D"ltr" class=3D"gmail_attr">On Fri, Jun 3, 2022 at 11:17 PM Chris=
 &lt;<a href=3D"mailto:bsd-lists@bsdforge.com">bsd-lists@bsdforge.com</a>&g=
t; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0p=
x 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">I&#39;=
m in need of checking out the ports tree as it was<br>
at an earlier date. But for the life of me, I can&#39;t<br>
seem to cobble up an/the incantation.<br>
<br>
All the suggestions I&#39;ve read indicate something to<br>
the effect of<br>
git checkout `git rev-list -n 1 --before=3D&lt;previous-date&gt;&quot; free=
bsd/main`<br>
which returns<br>
Your branch is up to date with &#39;freebsd/main&#39;.<br>
<br>
What must I do? Or will I need to convert/import it into svn?<br></blockquo=
te><div><br></div><div>git checkout main@{&lt;date&gt;}</div><div><br></div=
><div>You may need to protect the {} from csh/tcsh eating them. You can als=
o add a time.</div><div>See the git-rev-parse man page for all the details.=
</div><div><br></div><div>Note, due to the temporal anomalies that sometime=
s are present in git,</div><div>the commit date and the author date differ,=
 which can cause confusion</div><div>if you do a git log and not a git log =
--prety=3Dfuller.</div><div><br></div><div>Warner=C2=A0</div></div></div>

--00000000000071aab605e0a05aa6--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfo0Pr7e-zd2MkxzsoOPP2Eq=gEF8hHyDs23NE7_mXT1qw>