我意外地将我的源代码提交给带有不完整提交消息的git存储库并推送代码.现在我想编辑我推送的提交消息.我知道我们可以在推送之前编辑提交消息.但我也推了代码.有没有办法编辑消息???
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) 我正在尝试使用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) 在下图中,类旁边的符号大于什么Ladder意思?此符号不会出现在此处.

我有一个如下代码
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,事务仍未回滚.你能帮忙吗?
我正在像这样的代码(简化)中运行事务查询:
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) 我想做一个rebase来从我的历史中删除某个提交.我知道该怎么做.但是,如果我这样做,则提交时间戳设置为我完成rebase的那一刻.我希望提交保持时间戳.
我在这里看到了最后一个答案:https: //stackoverflow.com/a/19522951/3995351,但它没有用.
最后一个重要的命令只显示了一个新行
>
Run Code Online (Sandbox Code Playgroud)
所以我开了一个新问题.
我知道这不是自以为是,但我的问题是,编写简明提交消息的好方法是什么?
我已经使用Git(SmartGit,SourceTree)几个月了,随着我越来越习惯,我开始意识到我的提交信息不够清晰或不够详细,无法查看历史记录,即我我落在自己的轨道上.
到目前为止,我一直在写我的解决方案,如"正在进行/完成工作:yadayada .."但即便如此,我觉得我可以做得更好.欢迎任何事情:)
PS我做了很多前端(html,css,js).
/ P
我在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)
问题是否有机会在顶部显示此默认消息?或者更好地永久删除此消息?
我想进行提交并将其复制到我的存储库中的其他位置.
现在的情况:
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-pick和rebase,但似乎他们删除原提交或干脆重播目标的顶部的变化.
commit ×10
git ×6
transactions ×2
android ×1
branch ×1
eclipse ×1
git-commit ×1
git-rebase ×1
github ×1
logging ×1
maven-3 ×1
maven-scm ×1
message ×1
postgresql ×1
repository ×1
rollback ×1
spring ×1
timestamp ×1