Skip to content
  • Christian Couder's avatar
    git: add --no-replace-objects option to disable replacing · b0fa7ab5
    Christian Couder authored and Junio C Hamano's avatar Junio C Hamano committed
    Commit dae556bd
    
     (environment: add global variable to disable replacement)
    adds a variable to enable/disable replacement, and it is enabled by
    default for most commands.
    
    So there is no way to disable it for some commands, which is annoying
    when we want to get information about a commit that has been replaced.
    
    For example:
    
    $ git cat-file -p N
    
    would output information about the replacement commit if commit N is
    replaced.
    
    With the "--no-replace-objects" option that this patch adds it is
    possible to get information about the original commit using:
    
    $ git --no-replace-objects cat-file -p N
    
    While at it, let's add some documentation about this new option in the
    "git replace" man page too.
    
    Signed-off-by: default avatarChristian Couder <chriscool@tuxfamily.org>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    b0fa7ab5