-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Toggle execute permission #6135
Conversation
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.
RussKie will request tests too
Thanks @gerhardol - I can't see a file for tests for this menu. Having never created tests in this manner before I'm unsure where to begin - any guidance welcome on this! |
Codecov Report
@@ Coverage Diff @@
## master #6135 +/- ##
=========================================
- Coverage 45.23% 45.2% -0.04%
=========================================
Files 657 657
Lines 49607 49659 +52
Branches 6586 6607 +21
=========================================
+ Hits 22442 22448 +6
- Misses 25910 25958 +48
+ Partials 1255 1253 -2 |
There are some tests in UnitTests\GitUITests\CommandsDialogs\RevisionFileTreeControllerTests.cs |
Thanks @gerhardol, although I still am unsure of how/what I can add in this file to test the new context menu item or the underlying routines. I don't see any tests for the existing context menu items I am adding this near so I have nothing to base my new code on in order to experiment/learn. |
It is important to remember that the file tree isn't showing the content of
the working directory, but what was committed in a given commit. So the
proposal is only constrained to a very specifc edge case.
I have not looked at the proposed implementation, but it must be Linux specific
and the menu must be shown only for files that exist in the working
directory.
…On Sun, Jan 20, 2019, 11:47 AM tip2tail ***@***.*** wrote:
There are some tests in
UnitTests\GitUITests\CommandsDialogs\RevisionFileTreeControllerTests.cs
Thanks @gerhardol <https://github.com/gerhardol>, although I still am
unsure of how/what I can add in this file to test the new context menu item
or the underlying routines. I don't see any tests for the existing context
menu items I am adding this near so I have nothing to base my new code on
in order to experiment/learn.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#6135 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEMyXlNhAzJmSzFZnyRPVecW48VMsMeCks5vE7yngaJpZM4aJYzY>
.
|
Thanks @RussKie & @gerhardol. I will refine this further today and update this PR. Ref your comment about "Linux specific", if you mean the menu option should only be available if GitExtensions is running on Linux then I disagree. In Windows, I work daily on PHP projects that are subsequently released to a Linux server for production. These projects often contain *.sh bash script files which need to be executable when the repo is deployed on Linux. That is the use-case for this and for that reason I believe this option should be available regardless of running platform. |
Could you please describe your release process?
chmod must run on Linux...
…On Sun, Jan 20, 2019, 12:43 PM tip2tail ***@***.*** wrote:
It is important to remember that the file tree isn't showing the content
of the working directory, but what was committed in a given commit. So the
proposal is only constrained to a very specifc edge case. I have not looked
at the proposed implementation, but it must be Linux specific and the menu
must be shown only for files that exist in the working directory.
Thanks @RussKie <https://github.com/RussKie> & @gerhardol
<https://github.com/gerhardol>. I will refine this further today and
update this PR.
Ref your comment about "Linux specific", if you mean the menu option
should only be available if GitExtensions is running on Linux then I
disagree. In Windows, I work daily on PHP projects that are subsequently
released to a Linux server for production. These projects often contain
*.sh bash script files which need to be executable when the repo is
deployed on Linux. That is the use-case for this and for that reason I
believe this option should be available regardless of running platform.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6135 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEMyXkUN5-h7ti1PYhRJoeMq-nXhQmdJks5vE8nYgaJpZM4aJYzY>
.
|
@RussKie sure. Taking one project as an example - all are similar: In the repo are some shell scripts (e.g. cron.sh which carries out various tasks on the Linux crontab). These files are written on Windows but if I simply add and commit any new scripts to my repo with GitExtensions then they would not be executable on the server. Running chmod on the files on the server would then cause a change to the repo at that side, resulting in a messy (and un-automated) process to deploy future updates as these are done via git pull. The work around currently is to run My PR is intended to provide a menu option to prevent having to go to git bash each time. Noticing that this feature request was open would suggest I am not the only user with a similar need. Hope that helps you understand my thinking :) |
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.
This change is also applicable for Cygwin
The functionality is comparable to Edit working directory file
Hi @RussKie . I do think that your proposal is a good idea, i.e. to implement the "scripts" on files. However, I also think that the menu option I propose should be included. It would prevent a user from having to create a script in the first place - I didn't know about the functionality, I would suspect others wouldn't either, and for smaller simple projects I would think it is overkill to create a script etc. IMO, if that was the "solution" I would likely continue to do the actions I describe above in git bash. @gerhardol - thanks, I had forgot about Cygwin on Windows. That makes all the more reason to include the menu option IMO. I will change that wording again :) |
If we are going to extend scripts, I have an idea about that. Have a script visibility option to show the script or not. We could use linq to filter scripts so that if you right click a file in the unstaged area you get scripts that match All | Unstaged. Will need to apply this to the script variables too.
A great example. Could improve this to create a duplicate script like it but add selected files as a parameter to only stage the files that are selected. The menu could show on file lists and unstaged file list and the revision grid without the file parameter. |
Hi @vbjay I too agree with extending scripts etc. but would that not be a separate issue rather than a solution to this feature request? Thanks |
Of course. The idea was expressed. I tossed in my thoughts on it. Although, Russkie has a good point. This really should be a user script and not coded in the UI. |
The discussion is about the right approach and implementation. The current
proposal in my opinion introduces a tactical solution that covers a
relatively narrow use case, whereas I am interested in how we can address
the problem in a more generic manner.
We are planning to release next sometime in Mar-April timeframe, there is
plenty of time to get a proper design and an implementation.
…On Mon, 21 Jan 2019 at 22:15, Jay Asbury ***@***.***> wrote:
Of course. The idea was expressed. I tossed in my thoughts on it.
Although, Russkie has a good point. This really should be a user script and
not coded in the UI.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6135 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEMyXiBuYBB3M12UxyrjGpHZSVYgtofvks5vFaFGgaJpZM4aJYzY>
.
|
I understand, but I do feel the use-case is sufficient that a simple menu option would make more sense. See the following for others having the same problems in "Sourcetree": |
The menu would be created by the script. Right click a commit in the
revision grid. Look at the scripts that are available.
…On Mon, Jan 21, 2019, 4:43 PM tip2tail ***@***.***> wrote:
I understand, but I do feel the use-case is sufficient that a simple menu
option would make more sense.
See the following for others having the same problems in "Sourcetree":
https://stackoverflow.com/questions/49159181/in-sourcetree-for-windows-how-to-chmod-set-executable-permission-bit
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6135 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADdhsZP3Quav3SIRqYQQMDsth6kZIT9kks5vFjRzgaJpZM4aJYzY>
.
|
File updated as requested @sharwell :) |
Have you had a chance to try out scripts? |
Hi @RussKie I haveent trid out scripts. I will give them a look. It still doesnt change my thoughts that as this is a feture of Git that it should be included in the interface proper. The code is here now, but obviously I leave it to the maintainers to decide whether to accept this small change. Thanks |
d229793
to
e6b5b83
Compare
@illfated thanks for the heads up. I have now done that :) |
Thank you for the links. The problem with the context menu in the file tree on a random revision is that revision is a snapshot of what the repository looked like at the time of a commit, and not (necessarily) what it is now. |
As the issue 3176 originator I agree mostly with tip2tail that this feature should be exposed to the user via a menu option. Perhaps adding the option to context sensitive menus such as when right clicking on a file in the; commit window, tree view, diff view, etc. A lot of us don't need to automate this. We just need to make a file executable in a repo here and there. I have to go find my cheat sheet, open up the bash shell, find the dir/file, enter the command. Way more work that it should be. Should scripts be expanded? Probably. But as tip2tail has pointed out. That is a different matter. This feature should be implemented independent of scripts expansion. |
The scripts would create the menu.
…On Sat, Feb 23, 2019, 8:31 PM NOYB ***@***.***> wrote:
As the issue 3176 originator I agree mostly with tip2tail that this
feature should be exposed to the user via a menu option. Perhaps adding the
option to context sensitive menus such as when right clicking on a file in
the; commit window, tree view, diff view, etc. A lot of us don't need to
automate this. We just need to make a file executable in a repo here and
there. I have to go find my cheat sheet, open up the bash shell, find the
dir/file, enter the command. Way more work that it should be.
Should scripts be expanded? Probably. But as tip2tail has pointed out.
That is a different matter. This feature should be implemented independent
of scripts expansion.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#6135 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADdhsVlHzd3vCy3sDw7DNiReRrho0t1Aks5vQet5gaJpZM4aJYzY>
.
|
"This branch has conflicts that must be resolved" |
Re: @vbjay "The scripts would create the menu." If that is the case then why not just have the menu rather than making users use a lesser known "feature" to have to go and create/enable a script that ends up doing the sames thing. I kind of get what @RussKie is driving at regarding the tree being a snapshot of the directory at that commit, however as others have pointed out I'm pretty sure there are other options in that menu that act on the curent working directory as well - so its not really a difference in functionality there. Precaustions have been made in terms of the message to the user and the enabled status of the menu item itslef that this should be sufficiently clear. Thanks @NOYB for the support. If there is genuinely no appetite for this feature among the maintainers of the project then please let me know and I will close and move on. However I really do hope you can consider what I feel would be a helpfull addition to a great tool. If this is to proceed I will of course rebase again - thanks @illfated for pointing that out :) |
It is @RussKie that does the majority of the work and has the vision - he has the majority of "votes". |
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 30 days. It will be closed if no further activity occurs. |
This is an old PR and should be closed or set to a draft. @RussKie |
This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 30 days. It will be closed if no further activity occurs. |
Proposed fix for #3176 feature request.
First time contribution to this project. Happy to refine this subject to review/advice. Not convinced the wording for the dialog messages is perfect so any suggestions from maintainers will be very welcome for this.
I use GitExtensions every day, on projects which are released to Linux servers and I regularly need to set the executable flag on shell scripts etc. This functionality will save me quite a bit of time.
Proposed changes
Screenshots
Before
After
Test methodology
Test environment(s)