-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Added git alias to list only conflicted files #1733
Conversation
@tbhaxor I like to think of these as building off each other, like chords, similar to @NoahGorny this file is getting a lot of activity. I think we need to clean it up and make a pattern clear - probably alphabetizing would be a good start. |
aliases/available/git.aliases.bash
Outdated
@@ -45,6 +45,7 @@ alias gds='git diff --staged' | |||
alias gdt='git difftool' | |||
alias gdv='git diff -w "$@" | vim -R -' | |||
alias gc='git commit -v' | |||
alias gcf='git diff --name-only --diff-filter=U' # lists only conflicted files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greetings - Always great to see new git aliases.
Not thrilled with the gc
prefix used here as its rather exclusively used for commit
aliases.
This is a version of a 'list files'
action.
Although there aren't currently any aliases based on 'git ls-files'
, I think this action would live among them.
Q: Would 'git ls-files --unmerged' give the same (or similar-enough) results?
Although 'conflicted'
is technically correct, it seems 'unmerged'
is the official term.
I'm thinking 'glsu'
is the most appropriate alias for this action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@davidpfarrell I totally agree with you. I have new proposal. I would be cool to show the lines / blocks of the files that have conflicts
Basically we can use grep to show files starting with <<<<
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically we can use grep to show files starting with <<<<
I don't know about that - I think listing the files that are unmerged is a good idea - I will definitely use the alias.
I just think that glsu
is the best name for the alias.
Additionally, I think the alias could execute git ls-file --unmerged
vs git diff ...
(assuming they return similar results)
hey @tbhaxor |
Hey @NoahGorny, yes ofcourse. I got busy with job. Will it be ok if work from this weekend? |
Sure thing! No need to feel rushed, I just wanted to know if you plan on continuing this 😄 |
@davidpfarrell Here is a difference between ls-files and diff Also it has been taken from stackoverflow, https://stackoverflow.com/questions/3065650/whats-the-simplest-way-to-list-conflicted-files-in-git My bad, at time I couldn't read the stackoverflow question completely. Also i don't think ls-files would be needed here, because the purpose of this command is to "list the conflicted files" |
@tbhaxor Thank for pointing out the differences. The relevant portion of the
So Soo, for this use case, the HOWEVER I still stand by my opinion that the name of the alias should be The Additionally, |
hey @tbhaxor, wanna follow up on this? 😄 |
Yes, actually there is nothing to change. @davidpfarrell 's feature is another and mine is different. Please see the comment. The edit is ready to be merged. Later on we can refactor the code |
I agree with what @davidpfarrell said here:
|
gentle ping @tbhaxor |
This is complete on my end. Please ask @davidpfarrell to approve it so that it can be merged 😄 |
Please rename the alias to |
Done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok I think this is ready !
I rebased to improve the location after #1743 was merged, lemme know what you think @davidpfarrell |
Well now that the file is so nicely organized, I was able to discover this existing section:
Which leads me to 2 problems:
I believe users will want to see How to clean up this mess I created? Here's what comes to mind:
I'm happy to spend the time to make whatever change(s) we agree upon since I lead us here ... |
Hey @davidpfarrell, I agree that the location is better, and I added glsut alias. Take a look now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know @davidpfarrell, you really need maintainer status by now.. @nwinkler do you agree?
@tbhaxor thanks for your contribution! |
No description provided.