Based on the parts of the script with the additions for tracking source using git(1) I set out to add support for mercurial hg(1) and ended up cleaning some of the script while making some of those additions. This works exactly as before but a little more correct and with the additions to be able to track kernel sources or whole source tree with a local revision system. Example output follows (uname -v) from my system being tracked locally with mercurial. FreeBSD 8.1-STABLE #0 r211092M 55:65408c40b051 Mon Aug 9 07:03:32 EDT 2010 jhell@ujump.dataix.net:/usr/obj/usr/src/sys/MITHOP Inspiration for making these changes came from mercurial, OpenSolaris and finally http://wiki.freebsd.org/LocalMercurial Following is a list of changes that I have made that I believe people that are involved with the source may find useful. 1 file changed, 55 insertions(+), 35 deletions(-) This allows a user: * That is using csup(1) or cvsup(1) to locally keep track of the whole source tree or just the kernel part of the tree using svn(1), hg(1) or git(1). * That is using svn(1) to checkout their source tree to use hg(1) or git(1) to keep track of the whole tree or the kernel part of the tree. http://svn.freebsd.org/base/ * That is using git(1) to checkout their source tree to use hg(1) to keep track of the whole tree or the kernel part of the tree. http://spoerlein.net/gitweb/ This checks for: * SCM roots in src/ or src/sys for .svn, .hg, & .git and acts accordingly if they exist while prioritizing using an SCM root in src/ before it uses src/sys/ * Then looks for acceptable binaries for svn(1), hg(1) git(1) within the select paths /usr/local/bin & then /usr/bin. The paths may change for svn(1) or git(1) & maybe mercurial if it ever becomes part of world. Currently I have set these to only look in /usr/local/bin. Cleanups: * Instead of using variables that shared the same name as their counterpart binaries to hold a revision number use more descriptive names like svnrev gitrev & hgrev for revisions. Use git svnversion & hg variables for their respective binaries. * Adjust the paths that are checked for binaries to be of only /usr/local/bin and /usr/bin. "/bin" is highly unlikely to hold svn(1), git(1) or hg(1). * Test for a SCM root in the source tree locations before we look for binaries. If these don't exist there is no need to know where svn or git are. * For git(1) always set work-tree and git-dir so there is no possibility to end up with a "-dirty" git(1) revision. * Remove extraneous "touch version" since the previous if statement already creates the file if its not found. * Inline the test for version file. Fix: Attached patch. Should apply cleanly to head and stable/8 but was developed on stable/8 r211092. Patch attached with submission follows:
Attached is the adjusted patch to relieve the use of head and grep for gitsvnid. -- jhell,v
Can you refresh the patch against r213077?
On 09/24/2010 09:13, Anonymous wrote: > Can you refresh the patch against r213077? Ill do this in about 4 - 5 hours from this email. -- jhell,v
The following are updated patches to what is already here for current and stable/8. Links are respective to where they should be applied. http://bit.ly/newvers-head-r213132-patch 1 file changed, 61 insertions(+), 38 deletions(-) http://bit.ly/newvers-stable8-r213132-patch 1 file changed, 55 insertions(+), 40 deletions(-) These are also both attached but linked to just to be sure in case they are somehow garbled. After these two patches are applied both stable/8 and head will be in sync with the changes that were made in r213077 & r213078 These were tested locally only with stable/8 and could use verification for those using git(1) locally in either /usr/src/.git or /usr/src/sys/.git on stable/8 & head. Included with these changes and attributed to "Anonymous" <- thanks for the heads-up, you also have the ability to use LOCALBASE. This could use some testing to whether it works or not so I will leave that to others for feedback. Regards & Happy Hacking, -- jhell,v
Beware the previous patches that were submitted are concatenated and should be separated at the "Index:" line otherwise they will both try to apply with one failing. The patch for head seems to be the first patch and the one for stable/8 is the second patch. Regards, -- jhell,v
Typo in git(1) search path: LOCALBASE vs. LOCALBASE/bin. - for dir in /usr/bin ${LOCALBASE:-/usr/local}; do + for dir in /usr/bin ${LOCALBASE:-/usr/local}/bin; do And thanks for including conf/146828.
On 09/26/2010 03:44, Anonymous wrote: > Typo in git(1) search path: LOCALBASE vs. LOCALBASE/bin. > > - for dir in /usr/bin ${LOCALBASE:-/usr/local}; do > + for dir in /usr/bin ${LOCALBASE:-/usr/local}/bin; do > > And thanks for including conf/146828. Yikes! thank you. Ill just edit the patch and put it back to where it was in 20 minutes. -- jhell,v
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Any word on when, if, maybe, feedback, etc... can this make it into 8.2-RELEASE furthermore -> HEAD... Still running this locally but would love to see this make it into src as its just adding support for another SCM and based on the original version that worked svn(1) and git(1) into the file. Simplistic as it is, here's the URLs again for the patches. http://jhell.googlecode.com/files/newvers.sh-stable8-r213132.patch http://jhell.googlecode.com/files/newvers.sh-head-r213132.patch Regards, - -- jhell,v -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJNDoGeAAoJEJBXh4mJ2FR+dsAH/00K7vp7ltBjBjqALXsZlaKt IDinWp8XmVqs757qnmk/9sbsSDo1pjuTJFKjYgjoHEgA+MkVNjRKArZ4727WApb3 ZgRKkdh5FcA1KbV8pJiC7Fk0g/b6EPI7QOCkNHKCzP4uDFrEhqNJ3H11tpzshdMg 96ZInZYfe07onakUd7gI9/LvZHnRs4LG6M2YIV+VAoE2kMd8C4BxpnLH+l1nT/KG ALAGpBTFy7+y04MYREhQOtPPDjEsGG1GWLHG2YXC6rx2dsiXNGsDrl/lXyHjEigX mSX+w2lIX+HVvQD0d1ggYID9uBGkuCVPIoltPuh6HBVOSQm7h3yIZ7ALJsLQ90E= =Wohc -----END PGP SIGNATURE-----
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>