3702: rbt patch fails with git version<1.7.12

azads******@gmai***** (Google Code) (Is this you? Claim this profile.)
Jan. 18, 2015
What version are you running?
rbtools - v0.7alpha0.dev
git - 1.7.9.5

What's the URL of the page containing the problem?
N/A

What steps will reproduce the problem?
run `rbt patch <request-id>`

What is the expected output? What do you see instead?
The patch should apply correctly, but because of old git version,
it fails with the following output:

    $ rbt patch 2
    Patch is being applied from request 2 with diff revision 1.

    error: unknown switch `3'
    usage: git apply [options] [<patch>...]

        ... (irrelevant lines omitted) ...

    ERROR: Unable to apply the patch. The patch may be invalid, or there may be conflicts that could not be resolved.

What operating system are you using? What browser?
Ubuntu 12.04

Please provide any additional information below.
N/A
david
#1 david
Can you include the output with --debug?

This is probably very low priority, but it might be easily fixable.
  • +NeedInfo
david
#2 david
  • -NeedInfo
    +Incomplete
#3 Alexande*********@gmai***** (Google Code) (Is this you? Claim this profile.)
I have the same problem.
==========================================
$ git --version
git version 1.7.1

==========================================
$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       .reviewboardrc
nothing added to commit but untracked files present (use "git add" to track)

==========================================

 $ rbt -v
RBTools 0.7.4

==========================================

$ rbt patch 1022
Patch is being applied from request 1022 with diff revision 2.

error: unknown switch `3'
usage: git apply [options] [<patch>...]

    --exclude <path>      don't apply changes matching the given path
    --include <path>      apply changes matching the given path
    -p <num>              remove <num> leading slashes from traditional diff paths
    --no-add              ignore additions made by the patch
    --stat                instead of applying the patch, output diffstat for the input
    --numstat             shows number of added and deleted lines in decimal notation
    --summary             instead of applying the patch, output a summary for the input
    --check               instead of applying the patch, see if the patch is applicable
    --index               make sure the patch is applicable to the current index
    --cached              apply a patch without touching the working tree
    --apply               also apply the patch (use with --stat/--summary/--check)
    --build-fake-ancestor <FILE>
                          build a temporary index based on embedded index information
    -z                    paths are separated with NUL character
    -C <n>                ensure at least <n> lines of context match
    --whitespace <action>
                          detect new or modified lines that have whitespace errors
    --ignore-space-change
                          ignore changes in whitespace when finding context
    --ignore-whitespace   ignore changes in whitespace when finding context
    -R, --reverse         apply the patch in reverse
    --unidiff-zero        don't expect at least one line of context
    --reject              leave the rejected hunks in corresponding *.rej files
    -v, --verbose         be verbose
    --inaccurate-eof      tolerate incorrectly detected missing new-line at the end of file
    --recount             do not trust the line counts in the hunk headers
    --directory <root>    prepend <root> to all filenames

ERROR: Unable to apply the patch. The patch may be invalid, or there may be conflicts that could not be resolved.

#4 Alexande*********@gmai***** (Google Code) (Is this you? Claim this profile.)
debug version:

$ rbt patch --debug 1022
>>> RBTools 0.7.4
>>> Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]
>>> Running on Linux-2.6.32-504.el6.x86_64-x86_64-with-redhat-6.6-Santiago
>>> Home = /home/XXX
>>> Current directory = /home/XXX/YYY
>>> Running: git version
>>> Checking for a Subversion repository...
>>> Unable to execute "svn help": skipping SVN
>>> Checking for a Git repository...
>>> Running: git rev-parse --git-dir
>>> Running: git config core.bare
>>> Running: git rev-parse --show-toplevel
>>> Running: git symbolic-ref -q HEAD
>>> Running: git config --get branch.master.merge
>>> Running: git config --get branch.master.remote
>>> Running: git config --get remote.origin.url
>>> repository info: Path: ssh://site.com/YYY.git, Base path: , Supports changesets: False
>>> Making HTTP GET request to http://rb/api/
>>> Making HTTP GET request to http://rb/api/info/
>>> Making HTTP GET request to http://rb/api/review-requests/1022/diffs/
>>> Making HTTP GET request to http://rb/api/review-requests/1022/diffs/2/
>>> Making HTTP GET request to http://rb/api/review-requests/1022/diffs/2/
>>> Running: git status --porcelain --untracked-files=no
Patch is being applied from request 1022 with diff revision 2.
>>> Running: git apply -3 /tmp/tmp0NDlNj
>>> Command exited with rc 129: ['git', 'apply', '-3', '/tmp/tmp0NDlNj']
error: unknown switch `3'