标签: commit

在推送的代码中编辑提交消息

我意外地将我的源代码提交给带有不完整提交消息的git存储库并推送代码.现在我想编辑我推送的提交消息.我知道我们可以在推送之前编辑提交消息.但我也推了代码.有没有办法编辑消息???

git commit

2
推荐指数
1
解决办法
270
查看次数

提交SharedPreferences时发生StackOverFlowException

public class SettingsActivity extends SherlockPreferenceActivity implements OnSharedPreferenceChangeListener, OnPreferenceChangeListener {
    @SuppressWarnings("deprecation")
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        addPreferencesFromResource(R.xml.settings);

        getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);

        ListPreference theme = (ListPreference) getPreferenceScreen().findPreference("theme");
        theme.setSummary(theme.getValue().toString());
        theme.setOnPreferenceChangeListener(this);

        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
        getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_STANDARD);
        getSupportActionBar().setTitle(R.string.menu_preferences);
    }

    @SuppressWarnings("deprecation")
    public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,
        String key) {
        if (key.equals("theme")) {
            SharedPreferences.Editor editor = sharedPreferences.edit();
            ListPreference theme = (ListPreference) getPreferenceScreen().findPreference("theme");
            theme.setSummary(theme.getEntry());
            editor.putString("theme", theme.getEntry().toString());
            editor.commit();
        }
    }

    public boolean onPreferenceChange(Preference preference, Object newValue) {
        ListPreference theme = (ListPreference) preference;
        theme.setSummary(theme.getEntry());
        return true;
    }
}
Run Code Online (Sandbox Code Playgroud)

我明白了:

07-03 09:46:22.563: E/AndroidRuntime(421): java.lang.StackOverflowError
07-03 09:46:22.563: …
Run Code Online (Sandbox Code Playgroud)

stack-overflow android commit sharedpreferences

2
推荐指数
1
解决办法
1039
查看次数

使用scm-maven-plugin时如何在pom中指定提交消息?

我正在尝试使用maven SCM插件在自动构建期间将一些文件提交到git repo,插件需要将提交消息设置为系统属性,我不想在命令上传递此信息line(我也使用release插件,这会导致问题).

我已经尝试了所有我想通过pom添加消息系统属性但没有运气,这是我的pom的精简版本:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.monkeys.coding</groupId>
    <artifactId>project</artifactId>
    <packaging>js</packaging>
    <version>1.0.4-SNAPSHOT</version>

    <name>Some Project</name>
    <description>Some Project where I want to add files to git during build</description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <projectVersion>${project.version}</projectVersion>
    </properties>

    <scm>
        <connection>scm:git:http://some.git.repo:9080/git/module.git</connection>
        <developerConnection>scm:git:http://some.git.repo:9080/git/module.git</developerConnection>
        <url>http://some.git.repo:9080/git/module.git</url>
    </scm>

    <build>
        <finalName>${project.artifactId}</finalName>
        <!-- Package as js -->
        <extensions>
            <extension>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>javascript-maven-plugin</artifactId>
                <version>2.0.0-alpha-1</version>
            </extension>
        </extensions>
    ...
    </build>

    <profiles>
        <!-- run this profile when releasing the library -->
        <profile>
            <id>release</id>
            <properties>
                <message>Add version files to git</message>
            </properties>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId> …
Run Code Online (Sandbox Code Playgroud)

git commit system-properties maven-3 maven-scm

2
推荐指数
1
解决办法
6330
查看次数

在类旁边的Eclipse中大于符号

在下图中,类旁边的符号大于什么Ladder意思?此符号不会出现在此处.

比课程旁边的标志更大

eclipse commit repository eclipse-kepler

2
推荐指数
1
解决办法
2198
查看次数

Spring @Transactional rollback不工作

我有一个如下代码

   public abstract class AffltTransactionService implements IAffltTransactionService {
    ....

        @Override
        @Transactional
        public void processTransactions(List<? extends AffltTransaction> transactions) {
            for (AffltTransaction transaction : transactions) {
                if (transaction != null) {
                    processTransaction(transaction);
                }
            }
        }

        private void processTransaction(AffltTransaction transaction) {
            try {
                processTransactionInternal(transaction);

            } catch (Exception exception) {
                affltTransactionError = new AffltTransactionError(null, null, "error", new Date());
                saveAffltTransactionError(affltTransactionError);
                log.error(exception.getLocalizedMessage());
            }
        }

        @Transactional(readOnly=false, rollbackFor = Exception.class, propagation = Propagation.REQUIRES_NEW)
        public void processTransactionInternal(AffltTransaction transaction) {
Run Code Online (Sandbox Code Playgroud)

processTransactionInternal抛出ServiceUnAvailableException,它扩展了RuntimeException

但是,尽管有rollbackFor = Exception.class,事务仍未回滚.你能帮忙吗?

spring transactions commit transactional rollback

2
推荐指数
1
解决办法
9356
查看次数

为什么该PostgreSQL事务给出“警告:没有正在进行的事务”

我正在像这样的代码(简化)中运行事务查询:

try {
    runQuery("begin");
    runQuery("some query ...");
    runQuery("some other query ...");
    runQuery("some more query ...");
    runQuery("some extra query ...");
    runQuery("commit");
} catch (e){
    runQuery("rollback");
}
Run Code Online (Sandbox Code Playgroud)

这是来自postgres日志文件的语句列表。
请注意,第一次开始/提交工作正常,第二次提交给出了主题中提到的错误:

2015-02-18 20:19:17 UTC [6459-7] vdsr@sails LOG:  statement: begin
2015-02-18 20:19:17 UTC [6459-8] vdsr@sails LOG:  execute <unnamed>: INSERT INTO "groups" ("name", "parentGroupRef", "isCompany", "companyRef", "createdAt", "updatedAt") values ($1, $2, $3, $4, $5, $6) RETURNING *
2015-02-18 20:19:17 UTC [6459-9] vdsr@sails DETAIL:  parameters: $1 = 'testclient', $2 = '5', $3 = 't', $4 = '1', …
Run Code Online (Sandbox Code Playgroud)

postgresql logging transactions commit postgresql-9.3

2
推荐指数
2
解决办法
1万
查看次数

如何制作git rebase并保留提交时间戳?

我想做一个rebase来从我的历史中删除某个提交.我知道该怎么做.但是,如果我这样做,则提交时间戳设置为我完成rebase的那一刻.我希望提交保持时间戳.

我在这里看到了最后一个答案:https: //stackoverflow.com/a/19522951/3995351,但它没有用.

最后一个重要的命令只显示了一个新行

>
Run Code Online (Sandbox Code Playgroud)

所以我开了一个新问题.

git timestamp commit git-rebase

2
推荐指数
2
解决办法
3396
查看次数

如何编写好的Git提交消息?

我知道这不是自以为是,但我的问题是,编写简明提交消息的好方法是什么?

我已经使用Git(SmartGit,SourceTree)几个月了,随着我越来越习惯,我开始意识到我的提交信息不够清晰或不够详细,无法查看历史记录,即我我落在自己的轨道上.

到目前为止,我一直在写我的解决方案,如"正在进行/完成工作:yadayada .."但即便如此,我觉得我可以做得更好.欢迎任何事情:)

PS我做了很多前端(html,css,js).

/ P

git message commit github git-commit

2
推荐指数
1
解决办法
1658
查看次数

如何更改默认git提交消息

我在prepare-commit-msg文件中添加了对提交消息的一些更改,然后我执行了这个命令

git config --global commit.template .git/hooks/prepare-commit-msg

在那之后当我做git commit我收到这样的东西

我改变了40行然后

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.   
# Explicit paths specified without -i nor -o; assuming --only paths... 
# On branch master
# Changes to be committed:
#
#       modified:   test
#    
Run Code Online (Sandbox Code Playgroud)

问题是否有机会在顶部显示此默认消息?或者更好地永久删除此消息?

git commit

2
推荐指数
1
解决办法
2199
查看次数

如何创建一个镜像另一个(发散)分支状态的提交?

我想进行提交并将其复制到我的存储库中的其他位置.

现在的情况:

A--B--C--D (branch1)
    \
     E--F (branch2)
Run Code Online (Sandbox Code Playgroud)

期望的情况:

A--B--C--D--F'(branch1)
    \
     E--F (branch2)
Run Code Online (Sandbox Code Playgroud)

F保留在存储库中非常重要.我不想重写历史,因为F可能是公开的.

表示F和F'的存储库(源代码)的状态应该完全相同.是的,引入的C和D可能会丢失.

希望重播E和F在D的顶部我已经调查cherry-pickrebase,但似乎他们删除原提交或干脆重播目标的顶部的变化.

git branch commit

2
推荐指数
1
解决办法
65
查看次数