Re: [PATCH 1/2] Update git to use "git diff-index" instead of "git status"



Patches! that look good! and have commit messages! You're my hero for the day.

On 1 March 2010 06:42, Peter Tyser <ptyser gmail com> wrote:
<snip>
> @@ -39,12 +39,12 @@ class Vc(_vc.CachedVc):
>     PATCH_STRIP_NUM = 1
>     PATCH_INDEX_RE = "^diff --git a/(.*) b/.*$"
>     state_map = {
> -        "unknown":    _vc.STATE_NONE,
> -        "new file":   _vc.STATE_NEW,
> -        "deleted":    _vc.STATE_REMOVED,
> -        "modified":   _vc.STATE_MODIFIED,
> -        "typechange": _vc.STATE_MODIFIED,
> -        "unmerged":   _vc.STATE_CONFLICT,
> +        "X": _vc.STATE_NONE,     # Unknown
> +        "A": _vc.STATE_NEW,      # New
> +        "D": _vc.STATE_REMOVED,  # Deleted
> +        "M": _vc.STATE_MODIFIED, # Modified
> +        "T": _vc.STATE_MODIFIED, # Type-changed
> +        "U": _vc.STATE_CONFLICT, # Unmerged
>     }

So this won't handle renames or copies. The old code treated rename as
new/deleted, and a copy as a straight new. I guess adding --no-renames
to the command line would give us the same result for the rename case?
I couldn't find an equivalent for no copies, but I'm sure it's around
somewhere.

cheers,
Kai


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]