including a checksum of the diff in uname

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

including a checksum of the diff in uname

Eitan Adler-4
Hi all,

I often have several variants of the same revision that I'm testing or
working on at any given time.

What do you y'all think of something like this:

Index: sys/conf/newvers.sh
===================================================================
--- sys/conf/newvers.sh (revision 333575)
+++ sys/conf/newvers.sh (working copy)
@@ -203,6 +203,8 @@ if [ -n "$svnversion" ] ; then
  [0-9]*[MSP]|*:*)
  svn=" r${svn}"
  modified=true
+ ck="$(svn diff | cksum | cut -w -f 1)"
+ svn="$svn-$ck"
  ;;
  [0-9]*)
  svn=" r${svn}"

to help differentiate.

You end up with a version that looks like: r333575M-4294967295?




--
Eitan Adler
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: including a checksum of the diff in uname

Mateusz Guzik
On Sun, May 13, 2018 at 4:41 AM, Eitan Adler <[hidden email]> wrote:

> Hi all,
>
> I often have several variants of the same revision that I'm testing or
> working on at any given time.
>
> What do you y'all think of something like this:
>
> Index: sys/conf/newvers.sh
> ===================================================================
> --- sys/conf/newvers.sh (revision 333575)
> +++ sys/conf/newvers.sh (working copy)
> @@ -203,6 +203,8 @@ if [ -n "$svnversion" ] ; then
>   [0-9]*[MSP]|*:*)
>   svn=" r${svn}"
>   modified=true
> + ck="$(svn diff | cksum | cut -w -f 1)"
> + svn="$svn-$ck"
>   ;;
>   [0-9]*)
>   svn=" r${svn}"
>
> to help differentiate.
>
> You end up with a version that looks like: r333575M-4294967295?
>
>
Don't develop with svn. get yourself a git or hg setup and a tmp branch.
The branch name is always included along with the commit hash.

The benefit is that not only know you know what the change is, you can
always refer back to it later and diff against something else.

--
Mateusz Guzik <mjguzik gmail.com>
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: including a checksum of the diff in uname

David Wolfskill
In reply to this post by Eitan Adler-4
On Sat, May 12, 2018 at 07:41:31PM -0700, Eitan Adler wrote:
> Hi all,
>
> I often have several variants of the same revision that I'm testing or
> working on at any given time.
>
> What do you y'all think of something like this:
> ....

Well....

The variant of newvers.sh that I use addresses this (among other
things) by sourcing a file (through a symlink) that defines a shell
function named "get_version_from_vcs()," and invokes that function
in order to obtain a suitable "version string."

The primary rationale for this is that I don't believe the various
quirks of VCSen or installations ought to be in newvers.sh proper: it
adds a fair amount of complexity that is difficult to test completely to
code that has a fairly critical (and fundamentally simple) function.

I created a few sample such functions, though I don't use all of the
VCSen currently supported by base newvers.sh, so I haven't been able to
test them all.

(Sorry about the name.  I'm lousy at naming things, and have no
"investment" in the names used.  I'd be pleased if someone would take
the idea and get something based on it implemented, though.)

Anyway, using such a mechanism, you could easily extend to version
string to include just about anything you wanted -- with minimal
risk of breaking newvers.sh (either for yourslef or others).

Peace,
david
--
David H. Wolfskill [hidden email]
Mr. Trump: Just how does reneging on the Iran nuclear deal make the US "safer?"

See http://www.catwhisker.org/~david/publickey.gpg for my public key.

signature.asc (631 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: including a checksum of the diff in uname

Eitan Adler-4
In reply to this post by Mateusz Guzik
On 12 May 2018 at 19:50, Mateusz Guzik <[hidden email]> wrote:

> On Sun, May 13, 2018 at 4:41 AM, Eitan Adler <[hidden email]> wrote:
>>
>> Hi all,
>>
>> I often have several variants of the same revision that I'm testing or
>> working on at any given time.
>>
>> What do you y'all think of something like this:
>>
>> Index: sys/conf/newvers.sh
>> ===================================================================
>> --- sys/conf/newvers.sh (revision 333575)
>> +++ sys/conf/newvers.sh (working copy)
>> @@ -203,6 +203,8 @@ if [ -n "$svnversion" ] ; then
>>   [0-9]*[MSP]|*:*)
>>   svn=" r${svn}"
>>   modified=true
>> + ck="$(svn diff | cksum | cut -w -f 1)"
>> + svn="$svn-$ck"
>>   ;;
>>   [0-9]*)
>>   svn=" r${svn}"
>>
>> to help differentiate.
>>
>> You end up with a version that looks like: r333575M-4294967295?
>>
>
> Don't develop with svn. get yourself a git or hg setup and a tmp branch.
> The branch name is always included along with the commit hash.

That makes sense, and I might do that in the future. In the past
adding files was more painful with git, though I'm told this is no
longer the case.

In any case, is there any reason not to add the above patch?



--
Eitan Adler
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"
Reply | Threaded
Open this post in threaded view
|

Re: including a checksum of the diff in uname

Mateusz Guzik
On Thu, May 17, 2018 at 8:37 AM, Eitan Adler <[hidden email]> wrote:

> On 12 May 2018 at 19:50, Mateusz Guzik <[hidden email]> wrote:
> > On Sun, May 13, 2018 at 4:41 AM, Eitan Adler <[hidden email]>
> wrote:
> >>
> >> Hi all,
> >>
> >> I often have several variants of the same revision that I'm testing or
> >> working on at any given time.
> >>
> >> What do you y'all think of something like this:
> >>
> >> Index: sys/conf/newvers.sh
> >> ===================================================================
> >> --- sys/conf/newvers.sh (revision 333575)
> >> +++ sys/conf/newvers.sh (working copy)
> >> @@ -203,6 +203,8 @@ if [ -n "$svnversion" ] ; then
> >>   [0-9]*[MSP]|*:*)
> >>   svn=" r${svn}"
> >>   modified=true
> >> + ck="$(svn diff | cksum | cut -w -f 1)"
> >> + svn="$svn-$ck"
> >>   ;;
> >>   [0-9]*)
> >>   svn=" r${svn}"
> >>
> >> to help differentiate.
> >>
> >> You end up with a version that looks like: r333575M-4294967295?
> >>
> >
> > Don't develop with svn. get yourself a git or hg setup and a tmp branch.
> > The branch name is always included along with the commit hash.
>
> That makes sense, and I might do that in the future. In the past
> adding files was more painful with git, though I'm told this is no
> longer the case.
>
> In any case, is there any reason not to add the above patch?
>
>
I don't see any added value of doing so. So far it just looks like
patching up a deficient development process.

--
Mateusz Guzik <mjguzik gmail.com>
_______________________________________________
[hidden email] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[hidden email]"