New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ask for confirmation before staging unmerged file containing markers #464

Closed
albertdev opened this Issue Jun 12, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@albertdev

A feature request: everyone has it happen every few times that they're dealing with some Unmerged changes.

Sometimes I do make the mistake of double-clicking such a file in git-cola, which will automatically stage it with these markers:

<<<< HEAD
====
>>>> Updated / Stashed

Unstaging won't put it back in the "Unmerged" state though, meaning that I can no longer call git mergetool through the CLI or git-cola and I need to undo all those markers by hand.

Since I don't think git allows to put a file back to the Unmerged state, could git-cola detect that a file still has markers and ask the user for confirmation or even give the third option of opening the mergetool?

@albertdev

This comment has been minimized.

Show comment
Hide comment
@albertdev

albertdev Jul 1, 2015

Ping! No comments on whether this is a good idea or at all possible?

Ping! No comments on whether this is a good idea or at all possible?

@davvid

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Jul 1, 2015

Member

This is a great idea. It's totally possible. When implementing, please make sure to also consider the "diff3"-style conflict markers, which are enabled by git config merge.conflictstyle diff3.

http://psung.blogspot.com/2011/02/reducing-merge-headaches-git-meets.html

Member

davvid commented Jul 1, 2015

This is a great idea. It's totally possible. When implementing, please make sure to also consider the "diff3"-style conflict markers, which are enabled by git config merge.conflictstyle diff3.

http://psung.blogspot.com/2011/02/reducing-merge-headaches-git-meets.html

davvid added a commit that referenced this issue Jul 17, 2015

prefs: add check_conflicts() helper
Related-to: #464
Signed-off-by: David Aguilar <davvid@gmail.com>

davvid added a commit that referenced this issue Jul 17, 2015

cmds: guard against blindly adding unmerged files
The "stage modified" and "stage untracked" actions can trigger a blind
"git add -u", which will happily add all unmerged files.

Guard against it.

Related-to: #464
Signed-off-by: David Aguilar <davvid@gmail.com>

davvid added a commit that referenced this issue Jul 17, 2015

cmds: check for conflict markers in unstaged files
Teach git-cola to inspect unmerged files for conflict markers.
This feature helps prevent accidental staging of unresolved conflicts.

Related-to: #464
Suggested-by: Bert Jacobs <albert.devs@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>

@davvid davvid closed this in 9b2d394 Jul 17, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment