Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/firebase/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
自动Xcode Git提交提示_Xcode_Git_Terminal_Applescript - Fatal编程技术网

自动Xcode Git提交提示

自动Xcode Git提交提示,xcode,git,terminal,applescript,Xcode,Git,Terminal,Applescript,我很容易忘记定期进行本地git提交,因此我养成了一个坏习惯,即进行一些非常大的提交。我真的很想做很多小的承诺。在很大程度上,这些信息更加明确 我很了解自己,知道这不仅仅是我记忆中的奇迹。如果我实施一个推动我这样做的系统,我更有可能成功 下面是我想要的,或者是一个Xcode插件,一个Applescript,或者是一个Xcode行为触发器,它可以在Xcode中系统地启动commit命令(cmd选项c)(或者我想我会探索其他方法,但最好还是留在Xcode中)。它可以根据更改的文件数量或经过的时间量,也

我很容易忘记定期进行本地git提交,因此我养成了一个坏习惯,即进行一些非常大的提交。我真的很想做很多小的承诺。在很大程度上,这些信息更加明确

我很了解自己,知道这不仅仅是我记忆中的奇迹。如果我实施一个推动我这样做的系统,我更有可能成功

下面是我想要的,或者是一个Xcode插件,一个Applescript,或者是一个Xcode行为触发器,它可以在Xcode中系统地启动commit命令(cmd选项c)(或者我想我会探索其他方法,但最好还是留在Xcode中)。它可以根据更改的文件数量或经过的时间量,也可以根据“构建并运行”或任何其他合理行为来执行此操作。无论如何,我希望它是可配置的,并且可以很容易地启用和禁用


那么有什么东西已经存在了吗?如果没有,您对我如何开始寻找可能的解决方案有何指导。

有趣的问题

您可能希望根据在该服务器上找到的以下代码进行推断。您可以生成一条唯一但标准化的文本消息,并结合文件夹名称/日期组合作为自动提交消息,或者使用脚本并使其能够以消息作为参数接受参数作为输入。我想这可能和在终端中键入git commit一样多。相反,您可能希望将此脚本与文件夹操作结合使用,以监视使用脚本作为服务的文件夹上的活动

(*版权所有(C)2012柯林·唐纳

特此向获得本软件及相关文档文件(“软件”)副本的任何人免费授予许可,不受限制地经营本软件,包括但不限于使用、复制、修改、合并、发布、分发、再许可和/或出售本软件副本的权利,并允许向其提供本软件的人员这样做,但须符合以下条件:

上述版权声明和本许可声明应包含在软件的所有副本或实质部分中

软件按“原样”提供,无任何形式的明示或暗示保证,包括但不限于适销性、特定用途适用性和非侵权性保证。在任何情况下,作者或版权持有人均不对因以下原因引起的任何索赔、损害赔偿或其他责任负责,无论是合同诉讼、侵权诉讼还是其他诉讼:R与软件或软件的使用或其他交易有关。*)

tell application "Finder"
    set current_path to (POSIX path of (target of front window as alias))
    set commit_message to text returned of (display dialog "Commit message: " buttons {"Cancel", "Commit"} with title "Commit All" cancel button "Cancel" default button "Commit" default answer "")
    try
        do shell script ("cd \"" & current_path & "\"; git commit -am" & quoted form of commit_message)
    on error the_error
        display dialog the_error buttons {"OK"} with icon caution with title "Error"
    end try
end tell