Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

git replace: should it check for object type, and can it replace merges?

From: Philip Oakley <hidden>
Date: 2016-06-15 22:58:18

A recent comment http://stackoverflow.com/a/18027030/717355 on a 
question I asked two years ago about 'grafts' and 'replace' indicates 
that users think that 'git replace' can't replace a merge commit. The 
documentation doesn't have any examples and gives the naive impression 
that one should only replace a simple commit with another simple commit.

Having looked at the code, I realised that anything can be replaced with 
anything, which is perhaps not what was intended. A simple thought is 
that the replace should be like-for-like with regard to object type, 
though that would not include replacing a sub-module for a tree (and 
vice versa).

Should 'git replace' check the object types to ensure they are sensible?

Would it be reasonable to add examples to indicate the range of 
replacements, and how to prepare alternative merge commits, or is that a 
hostage to fortune?


Philip Oakley
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help