Comments (13)
This is currently true. It would be nice to have Gollum detect repos with working directories and update those when edits are made via the web interface.
from gollum.
+1
Until this is addressed, a "git reset --hard" will update your working directory after edits via Gollum's web-based interface. "git clean -df" will remove any leftover files that aren't being tracked.
from gollum.
It seems like I'm forced /not/ to use a bare repo.
I'm using gollum 1.0.1 and when I do the following, I get a "application error
Grit::InvalidGitRepositoryError at /bare_wiki_server_repo"
mkdir bare_wiki_server_repo
cd bare_wiki_server_repo
git init --bare .
gollum
from gollum.
I found a workaround for my problem -- If I initialize a bare repository in
a directory called '.git', then everything's good.
mkdir -p bare_wiki_server_repo/.git
cd bare_wiki_server_repo/.git
git init --bare .
cd ..
gollum
I tried using the following at line 54 of wiki.rb:
@repo = Grit::Repo.new(path, { :is_bare => true })
But, it didn't work
from gollum.
So, this is my attempt to fix this. It doesn't actually do anything smarter than just run reset --hard and clean -df, though.
from gollum.
@paulbaumgart:
Hm, how about DRYing up the code?
http://guides.rubyonrails.org/getting_started.html#drying-up-the-code
Oh, I'm sorry, does gollum use Rails?
from gollum.
I guess you could put the check for whether the repo is bare in the sync_working_tree function, but then you'd incur the function call overhead unnecessarily for bare repos. It's more of a question of coding style than best practices, so I'll leave that up to the maintainers.
Gollum does not use Rails.
from gollum.
NathanNeff: the issue is that Grit expects bare repositories to end in .git. So bare_wiki_server_repo.git would work also.
from gollum.
So, you prefer performance over maintainability, I see.
from gollum.
Note that the git convention is to have a config variable controlling whether or not the repo is bare. You should be able to consult wiki.repo.config['core.bare'] to determine if the repo is bare or not.
Although really, this is a dangerous way of handling the situation as any attempt at concurrency of access to the repo between Gollum and anyone working on the working copy via other means becomes risky: A Gollum operation will blow away one's changes. This should probably be enabled explicitly via some configuration setting with a nice little warning about the risks.
This shouldn't be a particularly expensive operation since the config needs to be read by Grit in order to meaningfully operate on the repo anyway.
from gollum.
Yes, it should to have a warning if it will do hard reset. And it would be better to find a way to merge changes automatically between working copy and repository. I think, currently it is not possible, and it would be better to forbid working directories at all or to make it a risky option.
I think, Gollum should recommend to do not use it on the working copy at all. And it should recommend such a workflow that the user working on the working copy and the user working with gollum will be separate. Because otherwise it would confuse both users and will lead to conflicts which git wouldn't resolve automatically.
from gollum.
Maybe gollum can detect changes in a working directory and will ask the user to commit before editing...
from gollum.
Update working dir (if present) when edited via the API. Closed by 94f05b0.
from gollum.
Related Issues (20)
- Include tag not working with absolute paths HOT 1
- Redirects containing slash / become escaped, affecting relative links
- Docker image does not include an ssh client. HOT 2
- How to work with cloud hosted repositories? HOT 2
- Cancellation should prompt before data loss HOT 2
- Checkout System?
- Feature request: support for wikis in subdirectories HOT 1
- How to fast forward when possible? HOT 1
- Running Docker image results in error due to git security configuration HOT 2
- Running tests fails if git's `init.defaultbranch` is not set to `master` HOT 5
- Setting the gollum author environment variables doesn't make the Git commit use them. HOT 1
- Symlink page edit editing the symlink instead of target + leaves tree with unstaged changes HOT 1
- Investigate server error reporting on save HOT 2
- Failed to install on Ubuntu 22.04 HOT 3
- Failed to run `java gollum.war` resulting in thread error HOT 3
- Ask a question
- Problems caused by language HOT 4
- Navigation macro does not recognize explicit false for sub_path HOT 2
- YAML frontmatter cannot have a folded scalar HOT 1
- git creates 'main' as default branch HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gollum.