-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Could you please package the 'rev' command with Git for Windows #2497
Comments
Git for Windows is open source, if you so wish that |
Thanks for your fast reply. I currently commit and report on other Open Source projects. I understand why as a maintainer you tell people to join in (and that's a good thing), but the time and complexity of joining a new project, learning architecture/integration/tests/policies/best practices and norms is costly. If the task is easy, and several users want the feature, simply asking is often more efficient. If the task of adding 'rev' is easy, I'd be really glad if someone with good knowledge of the project could do it. If it is not, I'd understand that you refuse the feature request. |
As long as there is little in the way of documentation what it is, where to find it, what needs to be included to make it work, how much it adds to the payload of the Git for Windows installer, it won't be easy for anybody else. |
Let me shine some light on this: Here's the man page for rev.
It's part of On the other hand I dont' feel that |
Silly question: what does Sounds more like a task for a full MSYS2 to me. |
Your question helps me understand that I might be asking the feature to the wrong project. Here's what I see in a typical Git for Windows installation:
But I don't know how MINGW64 dependencies are managed in Git for Windows. My goal is to get the |
Git for Windows is essentially a subset of MSYS2, with a couple customized (or added) components. See https://github.com/git-for-windows/git/wiki/Package-management for more on this. See also https://github.com/git-for-windows/git/wiki/Technical-overview and https://github.com/git-for-windows/git/wiki/Making-an-installer. |
@NBardelot I had another look, and it seems that the load would not be too much: $ ls -lh /usr/bin/rev.exe
-rwxr-xr-x 1 EUROPE+johasc 4096 13K Jul 9 2019 /usr/bin/rev.exe*
$ ldd /usr/bin/rev.exe
ntdll.dll => /c/windows/SYSTEM32/ntdll.dll (0x7ff99fc20000)
KERNEL32.DLL => /c/windows/System32/KERNEL32.DLL (0x7ff99eba0000)
KERNELBASE.dll => /c/windows/System32/KERNELBASE.dll (0x7ff99ced0000)
msys-2.0.dll => /usr/bin/msys-2.0.dll (0x180040000)
msys-intl-8.dll => /usr/bin/msys-intl-8.dll (0x17cc50000)
msys-iconv-2.dll => /usr/bin/msys-iconv-2.dll (0x5603f0000) (Those As @rimrul pointed out, $ pacman -Qo /usr/bin/rev.exe
/usr/bin/rev.exe is owned by util-linux 2.34-1 If you look through the output of @NBardelot If you imitate the To get this include in Git for Windows, all you need is a convincing commit message. Convincing as in: mentioning how small the tool is, and then also trying to make a case for how useful it is (you will have to have a strong argument there, as indicated by my lack of familiarity with that tool, and I am a shell script power user). Then open a PR, see it merged, and celebrate. 🍰 🍾 |
I have never really had the need for rev in a linux environment so I don't exactly know what your use case here is. So how about using this: chrisbra@hostname ~/git-bash $ cat rev.awk
#!/usr/bin/awk -f
BEGIN {FS="";}
{
rev="";
for (i=1; i<=NF; i++)
rev = $i rev;
print rev
}
chrisbra@hostname ~/git-bash $ echo -e "123\n456\n789" | ./rev.awk
321
654
987 |
@chrisbra yes I use this kind of workaround for the moment. But using A typical use of |
Shipping
Repeat after me: Git for Windows is not a replacement for Linux. Git for Windows is not a replacement for Linux. Git for Windows is not a replacement for Linux. Git for Windows is not a replacement for Linux. The closest you have if you want to run scripts on Windows that run on Linux software, as unmodified as possible, is Cygwin. It is rather complete, the only downside is that you pay for that unwillingness to adjust your scripts to Windows by suffering the speed penalty of the POSIX emulation layer. Granted, there are a lot of shell scripts that work out of the box with Git for Windows. That does not mean that I have to support those use cases, though. And given that users like you are happy to ask yet shy to deliver, the support burden would really stick with me, and I'll just not do that.
So you spawn a whopping three processes instead of a single one, wasting time by reversing characters twice? This sounds quite a bit like "taking the scenic route" (or, if you want, "going around your elbow to get to your ear"). Wouldn't you rather need something more along the lines of I am coming more and more to the conclusion that this wish is not worth the effort already expended in this ticket, and given that you, @NBardelot, did not exactly jump on my earlier comment outlining what needs to be done, I start to realize that you came to the same conclusion. In the least, I have not seen anything remotely resembling that convincing argument I would require to accept a change to include that tool: to the contrary, so far, it would seem rather pointless to include it. |
Okay, so I spent 15 minutes of my life learning me some echo 1/2/3/4 |
awk '{split($1, x, "/"); if (length(x) > 1) print x[length(x) - 1] "/" x[length(x)]}' So yes, it can be done in $ echo 1/2/3/4 | perl -ne '/([^\/]*\/[^\/]*)$/ && print $1' |
If being right matters so much to you, great, be right on the Internet. I was asking politely for a feature I think is useful for git users in a git context, but if that means to interact with some obnoxious maintainer, it wasn't even worth each others time. Let's close this ticket. |
Sorry, I thought you would appreciate learning something new, and yes, I pulled your leg a little because you stated your opinion as if it were fact, and it was in fact untrue. You said that there is no simple I apologize if I mistook your bold statement for an invitation to be taught a new trick.
As I stated multiple times, I am not convinced that the
It surprises me that you think that my behavior was obnoxious. I asked you multiple times to come up with a convincing use case. That is, a use case where The work I reported in this comment was actually work I would have expected of a contributor such as yourself. Yet it looks like you were very happy to just ask and leave all the doing to me. So yes, I am a bit disappointed here. This is not a sustainable way to do open source, for millions of users to merely mention their wishes and then expect the single maintainer to implement those wishes. Therefore, I am respectfully okay with this:
|
My mistake: I meant to say "to chomp off and display the last two path components" |
Being obnoxious is not about technical knowledge, even though your notion of ”simple“ is not mine at all (3 chars command, very small binary, that's why it exists for this job, Unix-style, even if git is not Unix). Thanks to your technical skills the project exists, works, and I use it. For that you deserve to be thanked without doubt. Being obnoxious is about bashing me while I try to interact with the project in a constructive manner; setting an ultimatum (I have a job, and no I won't respond to your multiple questions in the timely manner you want to impose); reinterpreting my answer to someone else the less charitable way, to drive your point and your point only; and being condescending. If you choose to be that way, good for you. But if you don't see that it is the way you behave, let this be my feedback. I was coming, as a user not familiar with the inner parts of the project, just asking for a feature. You could have stopped at the part where you said ”if you want it, here's a starting point, and you'll have to argue for your PR”. I was OK with that, in fact I had 👍 that, and I was ready to take a look. Then, you're the main commiter, and maintainer of the project. You deal with your users how you see fit. |
FWIW it was totally unclear to me that you were ready to take a look. To me, what you wrote sounded totally the opposite: that you would never ever take a look. In the end, it seems like that happens anyway, even if you blame me for it. |
All in the title. It's a common and useful command.
The text was updated successfully, but these errors were encountered: