GIT how does it work
#1
Hi,

I do not know if this is the best place to ask, but in the earlier days I used underneath command to get version (SVN). But now I changed to git. Unfortunately this does not work any more:

--prefix=$HOME/testing/$(svn info | grep -i revision | cut -d" " -f2)

Does anyone have a solution to this. I would like to see wether the update is an improvement/renewal of currect version and install besides a working version!
Reply
#2
uhm, e.g. git log --format=oneline --abbrev-commit|cut -d" " -f1|head -n1

note that these won't sort nicely, so you may consider prepending a timestamp.
Reply
#3
spiff Wrote:uhm, e.g. git log --format=oneline --abbrev-commit|cut -d" " -f1|head -n1

note that these won't sort nicely, so you may consider prepending a timestamp.

You mean from the result you cannot see if it is newer or older?
My current test gives me: 4bbdaa5

So it is different than SVN indeed. I will play around with the timestamp
Reply
#4
Yeah git does not use (counted) revisions from which you can say which one is newer (the higher revision in SVN). git uses SHA-1 hashes for every commit so there is no ordering possibility as every hash is independent of its position in history.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#5
I use

git rev-list --abbrev-commit --max-count=1 HEAD

Never gave me problems.

h.udo
EN/PT
f**k..... started editing without sudo | M.K.

Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#6
hudo Wrote:I use

git rev-list --abbrev-commit --max-count=1 HEAD

Never gave me problems.

h.udo
EN/PT

That works indeed, but how do you manage to distinguish the differences between dates or lets say improvements made to the code!
Reply
#7
For dates and commit I use the following after compiling

checkinstall -y --fstrans=no --install=yes --pkgname=hudo-xbmc --pkgversion=”git`date +%Y%m%d`.`git rev-list --abbrev-commit --max-count=1 HEAD`”

I never bothered about more info than that. I suppose that by "improvements made to the code!" you're talking about the commit title and/or message, right?

h.udo
EN/PT
f**k..... started editing without sudo | M.K.

Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#8
hudo Wrote:I never bothered about more info than that. I suppose that by "improvements made to the code!" you're talking about the commit title and/or message, right?

Uhm no i was looking for a revision change number. Thought you might found something for that as well. Like SVN revision is changing after a new submittance.
Reply
#9
Got it.
Since git doesn't use revisions like svn, best bet is to go with system date+system time+commit.

Or maybe extract date and time from git commit instead of system? Does git provide such functionality?

h.udo
EN/PT
f**k..... started editing without sudo | M.K.

Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#10
There's a pull request on github (xbmc/xbmc) that has the code we'll be using on the buildbot to do this.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#11
Thanks.
I actually had a sneak peak at it today, by chance. Looks good.
f**k..... started editing without sudo | M.K.

Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#12
Can you meay be clearify what it does. Did not understand so much of it yet!
Reply
#13
You can find that git commit here.

The command looks like this:

git log -1 --pretty=format:"%h %ci" HEAD | awk '{gsub("-", "");print $2"-"$1}'

and the output looks like this:

20110307-12e8785

The date appearing is the commit (aka 'revision') date.

h.udo
EN/PT
f**k..... started editing without sudo | M.K.

Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#14
I do something similar, except I prefer dots between my delimiters for date/versions.

ala 20110307-12e8785 becomes 2011.03.07.12e8785

I use a simple function: Pastied
Reply

Logout Mark Read Team Forum Stats Members Help
GIT how does it work0