git hashes don't fit in eventum_issue_checkin columns

Bug #1078454 reported by RJ Roos
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Eventum
Fix Released
Undecided
Elan Ruusamäe

Bug Description

I'd like to write a git scm hook for eventum. It seems doable when linking to viewgit. My problem is the columns isc_old_version and isc_new_version are only 32 characters wide while git hashes are 40 characters.

This query solves that problem:

alter table eventum_issue_checkin
 modify column isc_old_version varchar(40) default null,
 modify column isc_new_version varchar(40) default null;

Is it possible to include it in a feature update as a database patch?

Thanks,
Robbert-Jan

PS: If there is any progress on my scm hook I'll let you know.

Revision history for this message
Elan Ruusamäe (glen666) wrote :
Changed in eventum:
assignee: nobody → Elan Ruusamäe (glen666)
milestone: none → 2.3.4
status: New → Fix Committed
Elan Ruusamäe (glen666)
Changed in eventum:
status: Fix Committed → Fix Released
Revision history for this message
Elan Ruusamäe (glen666) wrote :

do you have eventum git hook script available somewhere?

Revision history for this message
RJ Roos (i-rj-0) wrote : Re: [Bug 1078454] Re: git hashes don't fit in eventum_issue_checkin columns

Hi,

Unfortunately not. I did hack something together in bash but can't
find that code anywhere :-(

Regards,
Robbert-Jan

On 26/10/2014 10:16, Elan Ruusamäe wrote:
> do you have eventum git hook script available somewhere?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1078454
>
> Title:
> git hashes don't fit in eventum_issue_checkin columns
>
> Status in Eventum:
> Fix Released
>
> Bug description:
> I'd like to write a git scm hook for eventum. It seems doable when
> linking to viewgit. My problem is the columns isc_old_version and
> isc_new_version are only 32 characters wide while git hashes are 40
> characters.
>
> This query solves that problem:
>
> alter table eventum_issue_checkin
> modify column isc_old_version varchar(40) default null,
> modify column isc_new_version varchar(40) default null;
>
> Is it possible to include it in a feature update as a database patch?
>
> Thanks,
> Robbert-Jan
>
> PS: If there is any progress on my scm hook I'll let you know.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/eventum/+bug/1078454/+subscriptions

Revision history for this message
RJ Roos (i-rj-0) wrote :

Hi,

Look what I found.

Hasn't been in production for over 3 years so results may vary.

Regards,
Robbert-Jan

On 28/10/2014 15:04, Robbert-Jan Roos wrote:
> Hi,
>
> Unfortunately not. I did hack something together in bash but can't
> find that code anywhere :-(
>
> Regards,
> Robbert-Jan
>
> On 26/10/2014 10:16, Elan Ruusamäe wrote:
> > do you have eventum git hook script available somewhere?
> >
> > --
> > You received this bug notification because you are subscribed to the bug
> > report.
> > https://bugs.launchpad.net/bugs/1078454
> >
> > Title:
> > git hashes don't fit in eventum_issue_checkin columns
> >
> > Status in Eventum:
> > Fix Released
> >
> > Bug description:
> > I'd like to write a git scm hook for eventum. It seems doable when
> > linking to viewgit. My problem is the columns isc_old_version and
> > isc_new_version are only 32 characters wide while git hashes are 40
> > characters.
> >
> > This query solves that problem:
> >
> > alter table eventum_issue_checkin
> > modify column isc_old_version varchar(40) default null,
> > modify column isc_new_version varchar(40) default null;
> >
> > Is it possible to include it in a feature update as a database patch?
> >
> > Thanks,
> > Robbert-Jan
> >
> > PS: If there is any progress on my scm hook I'll let you know.
> >
> > To manage notifications about this bug go to:
> > https://bugs.launchpad.net/eventum/+bug/1078454/+subscriptions

Revision history for this message
Elan Ruusamäe (glen666) wrote :

neat. nothing changed too in git or eventum last 3 years :)

i'll probably port to php and adjust for recent eventum changes (i've added multiple scm support there)

Revision history for this message
Elan Ruusamäe (glen666) wrote :

yeah. git is more difficult than cvs, because of the merges

if svn integration was more or less convertible to cvs model (but it's not perfect and i don't really use it), then git is total horror comparing to that.

for example this history containing 1 merge created 4 checkins to issue:

* 00fabd1 - (HEAD, origin/merge-tip, merge-tip) add setup. issue 1 (16 minutes ago) <Elan Ruusamäe>
* 4d06d21 - Merge branch 'newroot' (23 hours ago) <Elan Ruusamäe>
|\
| * af4d053 - (origin/newroot, newroot) added (23 hours ago) <Elan Ruusamäe>
* 484ff0a - added (23 hours ago) <Elan Ruusamäe>
* 31de9fd - add some files. issue 1 (4 weeks ago) <Elan Ruusamäe>

Revision history for this message
Elan Ruusamäe (glen666) wrote :

(i was pushing merge-tip named new branch)

Revision history for this message
Elan Ruusamäe (glen666) wrote :

hooks/post-receive is configured to be that file

Revision history for this message
RJ Roos (i-rj-0) wrote :

Thank you Elan!

I'm going to try to get the hook in my production next week and let
you know how things work out.

When I wrote the shell script the deal was rebase everyting on master.
No branches pushed, no merges. I wonder what happens now with eventum
and merges at my end happening all the time.

Maybe the 'module' column should contain the branchname being pushed.
So people watching a bugreport can see work happening on a branch. And
somehow there should also be a notification when work is merged from a
dev branch to a production branch.

Cool that it is in. Thanks again!

Regards,
Robbert-Jan

On 30/11/2014 12:40, Elan Ruusamäe wrote:
> yeah. git is more difficult than cvs, because of the merges
>
> if svn integration was more or less convertible to cvs model (but it's
> not perfect and i don't really use it), then git is total horror
> comparing to that.
>
> for example this history containing 1 merge created 4 checkins to issue:
>
> * 00fabd1 - (HEAD, origin/merge-tip, merge-tip) add setup. issue 1 (16 minutes ago) <Elan Ruusamäe>
> * 4d06d21 - Merge branch 'newroot' (23 hours ago) <Elan Ruusamäe>
> |\
> | * af4d053 - (origin/newroot, newroot) added (23 hours ago) <Elan Ruusamäe>
> * 484ff0a - added (23 hours ago) <Elan Ruusamäe>
> * 31de9fd - add some files. issue 1 (4 weeks ago) <Elan Ruusamäe>
>
>
>
> ** Attachment added: "Screenshot-1.png"
> https://bugs.launchpad.net/eventum/+bug/1078454/+attachment/4271136/+files/Screenshot-1.png
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1078454
>
> Title:
> git hashes don't fit in eventum_issue_checkin columns
>
> Status in Eventum:
> Fix Released
>
> Bug description:
> I'd like to write a git scm hook for eventum. It seems doable when
> linking to viewgit. My problem is the columns isc_old_version and
> isc_new_version are only 32 characters wide while git hashes are 40
> characters.
>
> This query solves that problem:
>
> alter table eventum_issue_checkin
> modify column isc_old_version varchar(40) default null,
> modify column isc_new_version varchar(40) default null;
>
> Is it possible to include it in a feature update as a database patch?
>
> Thanks,
> Robbert-Jan
>
> PS: If there is any progress on my scm hook I'll let you know.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/eventum/+bug/1078454/+subscriptions

Revision history for this message
RJ Roos (i-rj-0) wrote :

Thank you Elan!

I'm going to try to get the hook in my production next week and let
you know how things work out.

When I wrote the shell script the deal was rebase everyting on master.
No branches pushed, no merges. I wonder what happens now with eventum
and merges at my end happening all the time.

Maybe the 'module' column should contain the branchname being pushed.
So people watching a bugreport can see work happening on a branch. And
somehow there should also be a notification when work is merged from a
dev branch to a production branch. Completely incompatible with
svn/cvs.

Cool that it is in. Thanks!

Regards,
Robbert-Jan

On 30/11/2014 12:40, Elan Ruusamäe wrote:
> yeah. git is more difficult than cvs, because of the merges
>
> if svn integration was more or less convertible to cvs model (but it's
> not perfect and i don't really use it), then git is total horror
> comparing to that.
>
> for example this history containing 1 merge created 4 checkins to issue:
>
> * 00fabd1 - (HEAD, origin/merge-tip, merge-tip) add setup. issue 1 (16 minutes ago) <Elan Ruusamäe>
> * 4d06d21 - Merge branch 'newroot' (23 hours ago) <Elan Ruusamäe>
> |\
> | * af4d053 - (origin/newroot, newroot) added (23 hours ago) <Elan Ruusamäe>
> * 484ff0a - added (23 hours ago) <Elan Ruusamäe>
> * 31de9fd - add some files. issue 1 (4 weeks ago) <Elan Ruusamäe>
>
>
>
> ** Attachment added: "Screenshot-1.png"
> https://bugs.launchpad.net/eventum/+bug/1078454/+attachment/4271136/+files/Screenshot-1.png
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1078454
>
> Title:
> git hashes don't fit in eventum_issue_checkin columns
>
> Status in Eventum:
> Fix Released
>
> Bug description:
> I'd like to write a git scm hook for eventum. It seems doable when
> linking to viewgit. My problem is the columns isc_old_version and
> isc_new_version are only 32 characters wide while git hashes are 40
> characters.
>
> This query solves that problem:
>
> alter table eventum_issue_checkin
> modify column isc_old_version varchar(40) default null,
> modify column isc_new_version varchar(40) default null;
>
> Is it possible to include it in a feature update as a database patch?
>
> Thanks,
> Robbert-Jan
>
> PS: If there is any progress on my scm hook I'll let you know.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/eventum/+bug/1078454/+subscriptions

Revision history for this message
Elan Ruusamäe (glen666) wrote :

well. that hook script is not production ready. it requires unreleased eventum supporting multiple scm, i have not tested (nor intended to) with old 2.3 version. the script itself is unfinished, it just copies your logic, with some fixes, but imho that is not correct. it should at least try not to push commits from same action twice. also commit parents may be wrong (just ordering by rev-list seems in correct), and looking at commit parent is also wrong, i.e if there are multiple parents (merges, octopus merges). also i couldn't get rev-list to work for pushing new branches, so i substituted 00000-sha with empty-sha. i have not confirmed is that accurate action to do.

so, you've been warned :) but i don't mind if you test it and give some feedback!

Revision history for this message
Elan Ruusamäe (glen666) wrote :

just an idea: maybe the hook must be configured to handle pushes on specific branch only to avoid such issues. but then again, it doesn't solve merges. you can still have merge commits when you push to master :)

Revision history for this message
Elan Ruusamäe (glen666) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.