Skip to content
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

Export difference between revisions #1361

Closed
tomasfejfar opened this issue Oct 24, 2012 · 12 comments
Closed

Export difference between revisions #1361

tomasfejfar opened this issue Oct 24, 2012 · 12 comments
Labels
type: feature request up-for-grabs Easy tasks for those looking to get involved. Refer to https://up-for-grabs.net/

Comments

@tomasfejfar
Copy link

Ref: #1221 (comment)

Use case:
You have a project still deployed using FTP or plainly too large to redeploy on every single change. You create couple of revisions and need to deploy them.

Current solition:

  • Hand-pick every changed file based on a diff between branch-base and branch-head
  • Use TortoiseGit and Show Changes between revisions > Export
  • create your own CLI script

Proposed solution:
Export changes with [ref]. That will create a summarised diff of files that were changed and export them into
a) selected folder
b) some concrete folder
c) folder, possibly relative to repo
d) some concrete folder + repo_name subfolder

C or D seems to be the best solution for the use case as it's mostly repetitive activity and predictable folder would allow better user-land automation for FTP, lint or practically any build procedure. I'm little against displaying a "select folder" dialog every time (A), even though it may be useful from time to time, because it's flustrating for the repetitive scenario.

@feinstaub
Copy link
Contributor

@tomasfejfar: What about files that were deleted from the old to the new revision?

@tomasfejfar
Copy link
Author

The deleted files should be somehow displayed (and are removed manually, or not cared for - they stay where they are). Generally - delting files is quite uncommon (at least in my case), and if some files are deleted it's not imperative, that they have to be removed from the server too (it's non-sensitive stuff like images, etc.)... works well for simple scenarios. And it's mostly used for such. Export diff and copy over FTP is not usually used for complex stuff - you have some deploy process for it.

@TheYves
Copy link

TheYves commented Sep 30, 2013

+1 This is something I really miss since TortoiseSVN

@drauch
Copy link

drauch commented Jul 10, 2023

This has been closed as completed, how to do that now? Do I need the git-ftp plugin to do so?

@pmiossec
Copy link
Member

This has been closed as completed, how to do that now? Do I need the git-ftp plugin to do so?

At the time the issue was closed, GitHub didn't had the "Close as not planned" feature that better describe the decision....

@pmiossec pmiossec closed this as not planned Won't fix, can't repro, duplicate, stale Jul 10, 2023
@drauch
Copy link

drauch commented Jul 10, 2023

Ah I see, unfortunate, this would be really nice. We sometimes have old spike branches that we want to "modernize" and would be nice to get the full diff and then file-by-file re-introduce changes into the current state of the solution. Rebasing or merging is oftentimes very cumbersome due to all files being moved, etc. and I like the manual approach in that situations.

@gerhardol
Copy link
Member

We sometimes have old spike branches that we want to "modernize" and would be nice to get the full diff and then file-by-file re-introduce changes into the current state of the solution. Rebasing or merging is oftentimes very cumbersome due to all files being moved, etc. and I like the manual approach in that situations.

But you can compare any commit with another commit (and use git-range-diff for common commits), then cherry pick.

For the original question, you can use worktree to get additional "export" directories (if you do not want to checkout in the current sorking tree).
Then use an external difftool to compare directories.

@Itori
Copy link
Contributor

Itori commented Jul 10, 2023

There is a feature to export in a zip all the files modified between two revisions :

  • Select the two commits you want (carefull I think order matter)
  • Right click => Archive this commit

That's it, all files created or modified will be in the archive. Obviously if there is files to delete, you'll have to do it yourself.

@vbjay
Copy link
Contributor

vbjay commented Jul 10, 2023

A long time ago I used a git deploy process. I wrote a hook that looked to see if x deploy branch had changea in a push. I set this repo up on a a AWS ec2 instance( before serverless stuff was learned). So I set up a remote that pointed to the AWS repo on ec2 and had it protected with an ssh push where I had the key. So if I merged work into the deploy branch and pushed to that remote, it would deploy the site. All it was a checkout of the branch so all was deployed all the time.

@pmiossec
Copy link
Member

There is a feature to export in a zip all the files modified between two revisions :

* Select the two commits you want (carefull I think order matter)

* Right click => Archive this commit

That's it, all files created or modified will be in the archive. Obviously if there is files to delete, you'll have to do it yourself.

Indeed, it seems possible...

image

@drauch
Copy link

drauch commented Jul 11, 2023

@Itori: Thank you, that works like a charm - great! 💯

Edit: doesn't work correctly though if you merged main into the branch in the meantime :-/

@Itori
Copy link
Contributor

Itori commented Jul 11, 2023

Surprising it didn't work with a merge as it's a commit, I don't see any reason why it shouldn't work.
Have you verify you select in the right order ? I don't remember if it needs to select the oldest commit then the newest commit or the opposite, but I'm pretty sure it matters.

I develop this feature a while back to deploy differences between 2 versions in a php website but it doesn't seems usefull now with all the CI/CD process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request up-for-grabs Easy tasks for those looking to get involved. Refer to https://up-for-grabs.net/
Projects
None yet
Development

No branches or pull requests

10 participants