Git Product home page Git Product logo

darkyenustimetracker's People

Contributors

darkyenus avatar realjohnsmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

darkyenustimetracker's Issues

Can you add support work with git worktree

When I add new git worktree then git create another folder and in this folder not have .git folder (and this is normal because this folder should be in a different folder where the master itself)

when I open this worktree in RubyMine I have notice:

Failed to enable git integration
'.git' directory not found

button 'Find manualy'

when you press the button named Find manualy I can not climb to a higher level than the current folder

I will be glad if you fix this flaw and I can either select the folder by going up one level or the plugin will find this folder by itself

I want to have ability to auto-inject work time in commit message

Do not modify empty commit messages

Empty commit messages (may contain # commands?) mean "do not commit". Do not add commit time to these, as it would make the commit happen.

Feature Request: Stop After Idle

Rather than pausing, it would be useful if there was an option to have the timer stop when it went idle, so that typing or manually activating it would be required to restart it.

This will prevent things like mouse movement in another IDE window from reactivating and keeping the time alive, which seems to happen now.

Thank you!

Small local history

Make small local of commit times. When reverting (amending) commit, information from history will be rolled back and used. This has to be done purely in bash scripts and hooks, because usually when you mess up commit and then fix it, you dont give your IDE chance to do anything else with commit message

Feature Request: Time Tracking by File

It would be useful when working on a project to track both the overall time, and per file time, which would help me gain insight into which areas are consuming the most time.

Feature Request: Calendar/Daily Time

It would be useful if time were tracked by day, as well as the current total time. This would give very insightful data if it could be views in a calendar or other timeline type view.

Write-access problem

Slipped through.

Assertion failed: Write access is allowed inside write-action only (see com.intellij.openapi.application.Application.runWriteAction())
java.lang.Throwable: Assertion failed: Write access is allowed inside write-action only (see com.intellij.openapi.application.Application.runWriteAction())
	at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:172)
	at com.intellij.openapi.application.impl.ApplicationImpl.assertWriteAccessAllowed(ApplicationImpl.java:1305)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.processEvent(PersistentFSImpl.java:680)
	at com.intellij.openapi.vfs.newvfs.persistent.PersistentFSImpl.createChildFile(PersistentFSImpl.java:441)
	at com.intellij.openapi.vfs.newvfs.impl.VirtualFileSystemEntry.createChildData(VirtualFileSystemEntry.java:216)
	at com.intellij.openapi.vfs.VirtualFile.findOrCreateChildData(VirtualFile.java:335)
	at com.darkyen.GitIntegration.lambda$updateVersionTimeFile$2(GitIntegration.java:47)
	at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:315)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
	at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Bug Report: Cannot open a project

java.lang.NullPointerException
	at java.base/java.util.concurrent.ConcurrentHashMap.putVal(ConcurrentHashMap.java:1011)
	at java.base/java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1006)
	at com.darkyen.InactivityService.initListening(InactivityService.java:50)
	at com.darkyen.TimeTrackerService.<init>(TimeTrackerService.java:174)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
	at com.intellij.serviceContainer.ConstructorInjectionKt.instantiateUsingPicoContainer(constructorInjection.kt:85)
	at com.intellij.serviceContainer.ComponentManagerImpl.instantiateClassWithConstructorInjection(ComponentManagerImpl.kt:1029)
	at com.intellij.serviceContainer.ServiceComponentAdapter.createAndInitialize(ServiceComponentAdapter.kt:43)
	at com.intellij.serviceContainer.ServiceComponentAdapter.doCreateInstance(ServiceComponentAdapter.kt:39)
	at com.intellij.serviceContainer.BaseComponentAdapter.doCreateInstance(BaseComponentAdapter.kt:154)
	at com.intellij.serviceContainer.BaseComponentAdapter.createInstance$lambda$1(BaseComponentAdapter.kt:133)
	at com.intellij.openapi.progress.Cancellation.computeInNonCancelableSection(Cancellation.java:99)
	at com.intellij.serviceContainer.BaseComponentAdapter.createInstance(BaseComponentAdapter.kt:132)
	at com.intellij.serviceContainer.BaseComponentAdapter.getInstance(BaseComponentAdapter.kt:92)
	at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:702)
	at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:658)
	at com.darkyen.TimeTrackerWidgetFactory.isAvailable(TimeTrackerWidgetFactory.java:28)
	at com.intellij.openapi.wm.impl.status.widget.StatusBarWidgetsManager.init$intellij_platform_ide_impl(StatusBarWidgetsManager.kt:193)
	at com.intellij.openapi.wm.impl.status.IdeStatusBarImpl.init$intellij_platform_ide_impl(IdeStatusBarImpl.kt:273)
	at com.intellij.openapi.wm.impl.status.IdeStatusBarImpl.init$intellij_platform_ide_impl$default(IdeStatusBarImpl.kt:270)
	at com.intellij.openapi.wm.impl.ProjectFrameHelper.installDefaultProjectStatusBarWidgets$suspendImpl(ProjectFrameHelper.kt:344)
	at com.intellij.openapi.wm.impl.ProjectFrameHelper.installDefaultProjectStatusBarWidgets(ProjectFrameHelper.kt)
	at com.intellij.openapi.project.impl.ProjectFrameAllocatorKt$initFrame$3.invokeSuspend(ProjectFrameAllocator.kt:383)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
	at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)

Time not injected when using commit-msg hook

I have some repos which use the commit-msg Git hook. When this is used, the time-tracker's hook doesn't add the tracked time, instead only displaying message "Not injecting time into cancelled commit". If I use --no-verify, or commit with a repo which doesn't have a commit-msg hook, it works fine

Track time individually by Change List

Enhancement request: With IntelliJ, often I am working on multiple change lists at the same time, where each change list is a user story or defect, which is being worked on. In this scenario, tracking the time globally across all change lists removes quite a bit of the accuracy of the time calculation. Would it be possible to track the time worked uniquely for each of the change lists?

Multiple timers

In PyCharm, if I open another project in the current window, the previous project timer is still on the screen, as well as current one.
Steps to reproduce:
Open project with timer enabled
Go to File->Open Recent-> Choose another project with enabled timer -> Open in current window
timers

Improve UX of pattern text fields

Since 1.4.6 removed the tooltip with the full time, here is what should be done to get that functionality (full time with default formatting) back and even better:

  1. When options popup is open, show the full time with default formatting in the widget
  2. When one of the pattern text fields has focus (widget or git), show the time formatted with that on the widget instead

Git time injection formatting

Time tracking software like Jira requires specific formatting. Would it be possible to add an enhancement to specify the format as well as the MBU (minimum billable unit, e.g. 1 minute, ect).

With Git Integration, reset time on commit

With the git integration, I have an enhancement request: when it automatically injects the time into the commit messages, can it reset the time automatically? It seems to me, the the intent of the feature is to log the amount of time it took to complete the commit. However, following this example:

  1. work on a something for 2 hours
  2. execute a commit
  3. inject the commit message: "Took 2 hours"
  4. work for 5 more minutes
  5. execute a commit
  6. inject the commit message: "Took 2 hours 5 minutes"

Again, to me it seems like the commit message in Step 6, should likely say "5 minutes", since that commit really took the difference between that commit, and the prior.

Reset After Commit

Thanks for a great plugin. The last thing I feel like it needs so you can set it up and just forget about it is an automatic reset after commit. When I commit and it adds the time to the commit message I would like it to automatically reset the time to 0. I know I'm going to forget to reset it to start timing my next commit and that's going to inflate the time.

Update time when time-tracking-file is changed externally

When I commit using terminal (externally, not using Idea commit dialog), commit message is being updated correctly, and time-tracking file (.git/.darkyenus_time_tracker_commit_time) is being reset correctly, but in IDE I still see time unchanged. So I have to reset it manually every time.
Am I missing some settings, or something?

Feature request: Add A Summary Export

I would like to be able to export a short summary of the time spent even if it is just a text file.

Something basic like this would be a good start:

Project name
Start date/time
End date/time
Time spent

I have different users for work and personal so maybe add the user if you can.

Bugs in 1.4 - wrong counter

After update, the plugin started to misbehave.

When I switch projects in Android Studio (File -> Open recent), the counter is not taken from loaded project, but remains from previous project. Also the green counter on bottom bar is then placed on left side, while it is on right-most position if loaded normally.

During project loading I even see 2 counters, the right being correct:
image
but later the right counter disappears.

Previous version (1.3.6?) worked correctly.

Version 1.4.3 fail on intelliJ 2017.1.6 at startup

After upgrade to the last plugin version, 1.4.3, my intellij 2017.1.6 fail to start with the following log:

Plugin

'com.darkyen.darkyenustimetracker' failed to initialize and will be disabled. Please restart IntelliJ IDEA.

java.lang.AbstractMethodError: Method com/darkyen/TimeTrackerDefaultSettingsComponent.initComponent()V is abstract
at com.darkyen.TimeTrackerDefaultSettingsComponent.initComponent(TimeTrackerDefaultSettingsComponent.java)
at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:491)
at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:120)
at com.intellij.openapi.application.impl.ApplicationImpl.a(ApplicationImpl.java:466)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:176)
at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:556)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:501)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:66)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:163)
at com.intellij.openapi.application.impl.ApplicationImpl.createComponents(ApplicationImpl.java:473)
at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:104)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:425)
at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:411)
at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.idea.MainImpl$1$1.a(MainImpl.java:63)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:343)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)`

Feature Request: Push to webhook

Hi there,

It would be a nice feature if the plugin could HTTP post to a webhook everytime the plugin pauses and stops. Is this possible?

Thanks in advance,
Ramon

Feature Request: Optional Pause on Loss of Focus

It would be useful if there were an option to pause when program focus is lost. Some may prefer to count time when they are doing other things, but I prefer not.

This would also cover issues when multiple timers in different open projects are going simultaneously.

branch based git integration

Keep information about time spent on HEADs of different branches -> when checking out branch, time spent also checks out and IDE will keep updating new time in new branch. Same thing for stack-ed commits.

Store time locally

I like to UI from DarkyenusTimeTracker and the automatic tracking.
But I do think that it is lacking in storing the data.

Usecase:

Tracking the time used on a file or a commit is useful to know. Thats why a user would use a time tracker.
But pushing that time to GitHub can be undesirable.

Proposal:

I am therefore proposing to add the time trackings to IntelliJ local history or lets use gtm see here which seems to handle the knowledge quite well.

Question: Traking project with multiple Modules

The case is I have project which bundles multiple repos in one. So there is bundle GIT repo which dowloads others repos to itself. When I commit, I'm commiting to concrete GIT repo, but this plugin only track time of Bundle GIT repo, but didn't recognize sub-repositories. Is there any way how to enable support for those type of composite project? What must to be changed to make this setup work properly?

For now only way it seems possible is to have IDE instace for each sub-repo. But in that case I lost advantage of using composite project. Like docker-compose, global env etc.

Error zeroing

in .darkyenus_time_tracker_commit_time file write 0, but when updating the recording time does not include the value and continues to count

Settings dialog is not accessible

Somehow I've managed to get the settings dialog shown once, but since then idea 2020 just shows it's popup with status bar settings every time I right click on timer

Feature request: optionally log all start/pause in workspace directory

Similar to #26, it would be nice if the plugin could record activity in the workspace directory. This log could be per jetbrains user account or machine id and include current branch so that these files can be commited to VCS.

This would require no internet connection and should be quite resilient to crashes if entries are logged as they happen.

This would allow for drilling into time worked using external apps, generation of analytics/charts and would be most useful for billing per time worked and reviewing activity.

example:

<?xml version="1.0" encoding="UTF-8"?>
<darkyen version="1">
    <times account="dimvic" machine_id="fb152ebd-a350-4a3d-a9f2-1a9c097bcec2">
        <time branch="feature/whatever" type="active" value="1549" logged_at="1592911080"/>
        <time branch="hotfix/whatever" type="counted-in" value="382" logged_at="1592915321"/>
    </times>
</darkyen>

Show time that would be added onto the commit

The widget only shows the time since last reset while the plugin appends a different time to the commit.

How about showing the total time on this project as rn but when the user opens the widget (aka clicks on the timer for more detail) show the time that would be added to the commit as time worked since last commit

Where is the file stored ?

Hello,
I just switched from Android Studio 3.2 to 3.3 and all my times from projects disappeared. Could you please tell me where the files are stored, so I can copy them to new Android Studio preferences folder ?

Get total time spend in git commit message

Hi !

First thanks for this great plugin.

I would like to know if there is any included way to add the total time spent in the project in the commit message. I've looked in the helper but it doesn't seem to have this possibility.

Deprecated use in version 1.5.3

Hello.
I am using the version 1.5.3 of the plugin in Intellij IDEA Community Edition 2024.1, and the following exception occurred:

com.intellij.diagnostic.PluginException: `ActionUpdateThread.OLD_EDT` is deprecated and going to be removed soon. 'com.darkyen.actions.ResetGitTimeAction' must override `getActionUpdateThread` and chose EDT or BGT. See ActionUpdateThread javadoc. [Plugin: com.darkyen.darkyenustimetracker]
	at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23)
	at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:90)
	at com.intellij.diagnostic.PluginException.reportDeprecatedUsage(PluginException.java:125)
	at com.intellij.openapi.actionSystem.ActionUpdateThreadAware.getActionUpdateThread(ActionUpdateThreadAware.java:21)
	at com.intellij.openapi.actionSystem.AnAction.getActionUpdateThread(AnAction.java:199)

Add to time taken on amend commit

Currently, amending a commit will skip inserting the time-taken line. I propose that, on commit amend, the value be parsed, added to with the current tracked time amount, then replaced with the new value

Initially, you may only want to accept common formats for parsing, and error out otherwise. Common formats could include:

  • the default time-taken format (currently Took {{lh "hour"s}} {{lm "minute"s}} {{ts "second"s}})
  • Colon-separated (eg Took {{lh}}:{{lm}}:{{ts}})

No timing data found (related to WSL ?)

Hello,
Unfortunately, for some reason that escapes me, the plugin does not work.

First of all, the script was not marked as execute, so I had to chmod it manually.

seraphinWeb on  feat/review-and-improve-sentry-config [!+?] via  v16.15.1 via  v3.0.3 on   (eu-central-1)
❯ git commit -m ":bug: ignore boring falsy error on vite.config.ts for svgLoader"
hint: The '.git/hooks/prepare-commit-msg' hook was ignored because it's not set as executable.
hint: You can disable this warning with `git config advice.ignoredHook false`.
[feat/review-and-improve-sentry-config f1210c0262] :bug: ignore boring falsy error on vite.config.ts for svgLoader
 1 file changed, 1 insertion(+)

Then, because nothing seemed to happen in the IDE, so I tried with the CLI directly :

seraphinWeb on  feat/review-and-improve-sentry-config [!+?] via  v16.15.1 via  v3.0.3 on   (eu-central-1) took 3s
(❌ ~ 128) ❯ git commit -m ":bug: ignore boring falsy error on vite.config.ts for svgLoader"
No timing data found
[feat/review-and-improve-sentry-config 0f047a7a34] :bug: ignore boring falsy error on vite.config.ts for svgLoader
 1 file changed, 1 insertion(+)

image


I'm on Windows 11, on WSL (Ubuntu), on the latest version of Ruby Mine (2023.1.1), latest version of the plugin

❯ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.2 LTS
Release:        22.04
Codename:       jammy

The content of the script hook (cat .git/hooks/prepare-commit-msg | clip.exe):

#!/bin/sh

# Darkyen's Time Tracker IntelliJ IDEA plugin time injection script
# Copyright 2020 Jan Polák
# You may modify this file, but the next version of the plugin may overwrite it.

# Auto-update version identifier, do not change if modifying:
#DarkyenusTimeTrackerHookScript00008

# When this substring appears in the commit message (placed there by a template),
# it will be replaced by the formatted duration.
# Otherwise, the duration will be placed on a new line at the end of the commit message.
# If you modify this string, DO NOT USE /SLASHES/ or other characters that "sed" command interprets!
TIME_PLACEHOLDER="<#DTT#>"

finish() {
	echo "$1"
	exit 0
}

fail() {
	echo "$1"
	exit 1
}

if [ "$2" = "merge" ] || [ "$2" = "squash" ]; then
	finish "Not injecting time into $2 commit"
fi

# Return whether or not is the message in file $1 empty or not (ignoring comments)
is_message_file_empty() {
	# (sed removes comments, grep fails on any non-space char)
	! sed -e '/^#.*$/ d' < "$1" | grep -q -e "[^[:space:]]"
}

# Do not append time if the commit message is empty, because such commit will not happen
# This assumes the default behavior - if you don't use that behavior, feel free to remove this check
if [ "$2" = "message" ] && is_message_file_empty "$1"; then
	finish "Not injecting time into cancelled commit"
fi

RELATIVE_DTT_TIME_PATH="..\.darkyenus_time_tracker_commit_time"
DTT_TIME="$(dirname "$0")/$RELATIVE_DTT_TIME_PATH" || fail "Failed to construct path to time file ($?)"

if [ ! -e "$DTT_TIME" ]; then
	finish "No timing data found"
fi

# Load the file into array by lines
read_time() {
	IFS="
"
	read -r TIME_TOTAL_SEC || fail "Corrupted time file (line 1, $?)"
	read -r TIME_FORMATTED || fail "Corrupted time file (line 2, $?)"
	read -r TIME_FORMATTED_ZERO || fail "Corrupted time file (line 3, $?)"
}

read_time < "$DTT_TIME" || fail "Failed to read time file ($?)"

# Do not append time to amend commits - those already may have the time appended.
# The only way to detect amend commit is the check whether or not the first line of commit message is empty.
FIRST_COMMIT_LINE=$(head -n 1 "$1")
if [ "$2" = "commit" ] && [ -n "$FIRST_COMMIT_LINE" ]; then
	if [ "$TIME_TOTAL_SEC" -gt 0 ]; then
		printf "\n# Commit time for manual adjustment:\n# %s" "$TIME_FORMATTED" >> "$1" || fail "Failed to append formatted time into amend commit ($?)"
		finish "Not injecting time into amend commit. If you have modified the time, reset it manually"
	else
		finish "Amend commit took no time, message unmodified"
	fi
fi

# Inject the time into the message
RESULT_MESSAGE=""
if grep -q "$TIME_PLACEHOLDER" "$1"; then
	# Replace the TIME_PLACEHOLDER with TIME_FORMATTED
	TIME_FORMATTED_ESCAPED="$(echo "$TIME_FORMATTED" | sed -e 's/[\/&]/\\&/g')" || fail "Failed to sed-escape formatted time ($?)"

	sed -e "s/${TIME_PLACEHOLDER}/${TIME_FORMATTED_ESCAPED}/" < "$1" > "$1.dtt" || fail "Failed to write substitute message file ($?)"
	cat "$1.dtt" > "$1" || fail "Failed to rewrite message ($?)"

	RESULT_MESSAGE="$TIME_FORMATTED (replaced)"
else
	# Append TIME_FORMATTED at the end of the file
	if [ "$TIME_TOTAL_SEC" -gt 0 ]; then
		printf "\n\n%s" "$TIME_FORMATTED" >> "$1" || fail "Failed to append formatted time ($?)"
		RESULT_MESSAGE="$TIME_FORMATTED (appended)"
	else
		RESULT_MESSAGE="Commit took no time, message unmodified"
	fi
fi

# Reset the time (atomically, in the case that the plugin is modifying it)
printf "0\n%s\n%s\n" "$TIME_FORMATTED_ZERO" "$TIME_FORMATTED_ZERO" > "$DTT_TIME.zero" || fail "Failed to create empty time file ($?)"
mv -f "$DTT_TIME.zero" "$DTT_TIME" || fail "Failed to reset time file"

finish "Time tracking: $RESULT_MESSAGE"
type -a echo
echo is a builtin
echo is /usr/bin/echo
echo is /bin/echo

I'm using fish shell, by the way.

Your plugin is really useful, I really want to make it works. If you need more information, do not hesitate.

Where is it?

I installed the plugin for IntelliJ and can't find it.
I tried typing as well. Nothing seems to be happening.

Simple Readme on the usage would be helpful.

Thanks.

Collaboration offer: Consume logs from website

Hi there! It'll be interesting if you could send a post request with logged times to a server so users could sign in and see their logged times on a website. Just like wakatime.

I can take care of the website if you want to work together with this!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.