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

Keep ".git" file in in --cleanDestinationDir #6261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

g-a-c
Copy link

@g-a-c g-a-c commented Aug 24, 2019

Ignore files specifically called ".git" in order to preserve submodule information for Git post-1.7.8 (which seems to be the point things changed from having an entire “.git” directory inside the submodule to having a “.git” file pointing to a gitdir outside of the submodule)

This should restore what I believe was the intended behaviour of #3202 and fix the issue for pojebunny in #4546

See #3202 and #4546

Ignore files specifically called ".git" in order to preserve submodule information for Git post-1.7.8 (which seems to be the point things changed from having an entire “.git” directory inside the submodule to having a “.git” _file_ pointing to a gitdir outside of the submodule)

This should reproduce what I believe is the intended behaviour from gohugoio#3202 and fix the issue for pojebunny in gohugoio#4546

See gohugoio#3202 and gohugoio#4546
@stale
Copy link

@stale stale bot commented Dec 22, 2019

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Dec 22, 2019
@g-a-c
Copy link
Author

@g-a-c g-a-c commented Dec 31, 2019

If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

I don't currently use Hugo but I believe this PR still adds value for other users attempting to use submodules with recent versions of Git.

@stale stale bot removed the Stale label Dec 31, 2019
@stale
Copy link

@stale stale bot commented Apr 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. The resources of the Hugo team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

@stale stale bot added the Stale label Apr 29, 2020
@stale stale bot closed this May 30, 2020
@Jonathan-Ironman
Copy link

@Jonathan-Ironman Jonathan-Ironman commented May 5, 2021

Same issue here. The .git file should be preserved imo

@g-a-c
Copy link
Author

@g-a-c g-a-c commented May 5, 2021

I don't remember any of the context around why I opened this. However...

edit - I see. This refers to a .git file, not a directory, which would not be covered by the existing behaviour so may still be a valid PR.

@Jonathan-Ironman
Copy link

@Jonathan-Ironman Jonathan-Ironman commented May 5, 2021

Exactly, it leaves the dirs intact but clears .git, .gitignore, etc.
I'm having the public folder as a git submodule and it for instance also has a README.md file which would be nice to keep.
Custom regex filter settings would be ideal here I suppose, but ignoring dot-files is already a big help.

@bep bep added this to the v0.84 milestone May 5, 2021
@bep bep changed the title Ignore ".git" file in output directory Keep ".git" file in in --cleanDestinationDir May 5, 2021
@bep bep reopened this May 5, 2021
@bep
Copy link
Member

@bep bep commented May 5, 2021

I didn't know .git could be a file -- we can check for that, but we're not making this more complicated than that.

@Jonathan-Ironman
Copy link

@Jonathan-Ironman Jonathan-Ironman commented May 5, 2021

spf13/fsync#10
This seems related, might it already be possible?

All . files right? There's a bunch of them (i.e. .gitignore, .firebaserc)

@g-a-c
Copy link
Author

@g-a-c g-a-c commented May 5, 2021

I didn't know .git could be a file -- we can check for that, but we're not making this more complicated than that.

Honestly, I don't remember all the details of this. But I think it was related to me wanting to pull in a remote theme without committing it in its entirety to my Hugo repo.

That seemed (at the time at least) like a sensible thing to do because it meant updating the theme was just a change of reference, and I think the way I achieved that was by having a theme subdirectory or something similar in my output directory, which was a submodule reference (this somehow turned into a .git file inside the theme subdir, though I don't fully understand/remember why). So when the output directory was being cleared, I actually wanted that submodule reference to remain so that once the output step was finished I could pull the theme from its remote reference into my output directory and then rsync --delete the whole thing up to a webserver.

It was a very, very early exploration into rudimentary CI/CD for me at the time. It may no longer make sense, and I don't use Hugo anymore, which is why I just let the PR expire at the second time of asking instead of being an ass and trying to force a change through that I didn't need anymore.

@bep bep removed this from the v0.84 milestone Jun 18, 2021
@bep bep added this to the v0.85 milestone Jun 18, 2021
@bep bep removed this from the v0.85 milestone Jul 5, 2021
@bep bep added this to the v0.86 milestone Jul 5, 2021
@bep bep removed this from the v0.86 milestone Jul 26, 2021
@bep bep added this to the v0.87 milestone Jul 26, 2021
@bep bep removed this from the v0.87 milestone Jul 30, 2021
@bep bep added this to the v0.88 milestone Jul 30, 2021
@bep bep removed this from the v0.88 milestone Sep 2, 2021
@bep bep added this to the v0.89 milestone Sep 2, 2021
@bep bep removed this from the v0.89 milestone Nov 2, 2021
@bep bep added this to the v0.90 milestone Nov 2, 2021
@bep bep removed this from the v0.90 milestone Dec 13, 2021
@bep bep added this to the v0.91.0 milestone Dec 13, 2021
@bep bep removed this from the v0.91.0 milestone Dec 22, 2021
@bep bep added this to the v0.92.0 milestone Dec 22, 2021
@bep bep removed this from the v0.92.0 milestone Jan 12, 2022
@bep bep added this to the v0.93.0 milestone Jan 12, 2022
@bep bep removed this from the v0.93.0 milestone Mar 1, 2022
@bep bep added this to the v0.94.0 milestone Mar 1, 2022
@bep bep removed this from the v0.94.0 milestone Mar 9, 2022
@bep bep added this to the v0.95.0 milestone Mar 9, 2022
@bep bep removed this from the v0.95.0 milestone Mar 15, 2022
@bep bep added this to the v0.96.0 milestone Mar 15, 2022
@bep bep removed this from the v0.96.0 milestone Mar 24, 2022
@bep bep added this to the v0.97.0 milestone Mar 24, 2022
@bep bep removed this from the v0.97.0 milestone Apr 13, 2022
@bep bep added this to the v0.98.0 milestone Apr 13, 2022
@bep bep removed this from the v0.98.0 milestone Apr 28, 2022
@bep bep added this to the v0.99.0 milestone Apr 28, 2022
@bep bep removed this from the v0.99.0 milestone May 24, 2022
@bep bep added this to the v0.100.0 milestone May 24, 2022
@bep bep removed this from the v0.100.0 milestone May 31, 2022
@bep bep added this to the v0.101.0 milestone May 31, 2022
@bep bep removed this from the v0.101.0 milestone Jun 16, 2022
@bep bep added this to the v0.102.0 milestone Jun 16, 2022
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.

None yet

3 participants