Closed trygub closed 9 years ago
Hi @trygub!
I tried gtm report
and it seems to work for me. Do you call it with any specific arguments?
Also could you just try bar=2; foo=$((1 + $bar)); echo $foo
in your bash (should output 3
)?
bar=2; foo=$((1 + $bar)); echo $foo
the above does output 3, yes
Do you call it with any specific arguments?
no, just "gtm report", I'm affraid
Ok, try to run gtm report -t ' '
(there is a space between '
)
No luck, Sir.
The above produces
gtm: line 531: 7237 + 101
437 : syntax error in expression (error token is "437 ")
If you push up a branch with some more debug output around these lines of code maybe, I could run it and send the output to you...
Hey @trygub, sorry but right now I don't have much time for this. I'll try to take a look at it this weekend. Also it may help if you tell me whatever details about your system (actually I think only bash version matters, but you use something specific, tell me).
Latest Ubuntu 14.04 with default bash.
bash --version GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu) Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software; you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
I don't speak bash, but I can do some poking around if you give me some pointers as to where...
Hey @laughedelic , I've worked out what the problem is. It seems that gtm got somehow into a state where there are two timestamp notes attached to a single commit, e.g.
Notes (timetracker): Time-spent: 923
Time-spent: 47
This makes gtm fail on parse of notes for that commit. Not sure how this happened, but I've found 3-4 such commits and they are ordinary (non-merge) commits (with a single parent).
Hey @laughedelic , I've worked out how this happens. If gtm timer is running and a commit is made, a note is added to that commit and gtm timer is reset (but continues to run). If you then run "gtm commit --amend" (a command frequently used to tweak the commit message if something went wrong), after modification another note will be added to that commit (or more if you keep amending!).
Hi @trygub! Sorry, I completely forgot about this project..
Thank you for spending time to investigate this issue! :+1:
Look, this is from the git help notes
:
notes.rewrite.<command>
When rewriting commits with<command>
(currently amend or rebase), if this variable is false, git will not copy notes from the original to the rewritten commit. Defaults to true.
if notes.rewrite.amend
is not set to false, the following setting defines the behaviour:
notes.rewriteMode
When copying notes during a rewrite, what to do if the target commit already has a note. Must be one ofoverwrite
,concatenate
, andignore
. Defaults toconcatenate
.
So you can solve it by
git config --global notes.rewrite.amend false
this will overwrite notes when you do git commit --amend
. Otherwise you can set it to true and then change notes.rewriteMode
to something different than concatenate
.
Also, take a look at these two commands:
gtm amend
(for amending the timetracker notes)gtm undo
(I normally use it instead of git commit --amend
)"git config --global notes.rewrite.amend false"
worked for me --- thanks!
great! :+1:
gtm: line 531: 7237 + 101
437 : syntax error in expression (error token is "437 ")
Line 531 is the last line in this if block: