Skip to content

FileStatus names #527

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

Merged
merged 1 commit into from
May 27, 2015
Merged

FileStatus names #527

merged 1 commit into from
May 27, 2015

Conversation

nulltoken
Copy link
Member

Current FileStatus names are missleading. To get know what they actually stands for, you have to read the doco. I like names that apear in ligbit2. When I see such name I know that state describes change made to INDEX or WorkingTree.
We can drop GIT_STATUS_ prefix as they are members of FileStatus.
I would only use Unmodified instead of Current


    GIT_STATUS_CURRENT = 0,

    GIT_STATUS_INDEX_NEW        = (1u << 0),
    GIT_STATUS_INDEX_MODIFIED   = (1u << 1),
    GIT_STATUS_INDEX_DELETED    = (1u << 2),
    GIT_STATUS_INDEX_RENAMED    = (1u << 3),
    GIT_STATUS_INDEX_TYPECHANGE = (1u << 4),

    GIT_STATUS_WT_NEW           = (1u << 7),
    GIT_STATUS_WT_MODIFIED      = (1u << 8),
    GIT_STATUS_WT_DELETED       = (1u << 9),
    GIT_STATUS_WT_TYPECHANGE    = (1u << 10),
    GIT_STATUS_WT_RENAMED       = (1u << 11),

    GIT_STATUS_IGNORED          = (1u << 14), 

jbialobr referenced this pull request in gitextensions/libgit2sharp Oct 8, 2013
@nulltoken
Copy link
Member

The more I think about this, the more it makes sense to me.
The difference between Removed vs Missing and Added vs Staged isn't immediately clear.

👍 to reuse CamelCased version of libgit2 enum (which also more or less match with git documentation)

@jamill
Copy link
Member

jamill commented Apr 15, 2015

Seems like an improvement to me

@nulltoken
Copy link
Member

Labeled as up-for-grabs

@nulltoken
Copy link
Member

Ready for review

@nulltoken
Copy link
Member

@Therzok Very strange Mono failure in this build log

Native stacktrace:
    mono() [0x4accac]
    /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7f5ec8d7fcb0]
    /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x35) [0x7f5ec89e6445]
    /lib/x86_64-linux-gnu/libc.so.6(abort+0x17b) [0x7f5ec89e9bab]
    /lib/x86_64-linux-gnu/libc.so.6(+0x73e2e) [0x7f5ec8a23e2e]
    /lib/x86_64-linux-gnu/libc.so.6(+0x7e626) [0x7f5ec8a2e626]
    mono() [0x53c411]
    mono() [0x61b4d8]
    mono() [0x61bc87]
    mono() [0x5dfffe]
    mono(mono_array_new_full+0x1e2) [0x5a6342]
    mono() [0x5a72f5]
    [0x40bfb8cb]
Debug info from gdb:
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries 
used by your application.
=================================================================
./build.libgit2sharp.sh: line 34:  7743 Aborted                 mono Lib/NuGet/NuGet.exe restore LibGit2Sharp.sln

@Therzok
Copy link
Member

Therzok commented May 9, 2015

Not sure what caused it. Seems to be mono 4. I think something got fixed regarding this in 4.1.

/// </summary>
TypeChangeInWorkdir = (1 << 10), /* GIT_STATUS_WT_TYPECHANGE */

/// <summary>
/// The file has been renamed in the working directory. The previous version at the previous name exists in the Index.
/// </summary>
RenamedInWorkDir = (1 << 11), /* GIT_STATUS_WT_RENAMED */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a minor issue, but the all other names have 'dir' (lowercase d) while here is uppercased 'Dir'.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbialobr Good catch! Fixed

@nulltoken nulltoken added this to the v0.22 milestone May 27, 2015
nulltoken added a commit that referenced this pull request May 27, 2015
@nulltoken nulltoken merged commit cc04c43 into vNext May 27, 2015
@nulltoken nulltoken deleted the ntk/filestatus branch May 27, 2015 09:03
@nulltoken
Copy link
Member

Published as NuGet pre-release package LibGit2Sharp.0.22.0-pre20150527180327

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

Successfully merging this pull request may close these issues.

4 participants