Giter Club home page Giter Club logo

Comments (13)

mojombo avatar mojombo commented on May 17, 2024

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.

masnick avatar masnick commented on May 17, 2024

+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.

NathanNeff avatar NathanNeff commented on May 17, 2024

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.

NathanNeff avatar NathanNeff commented on May 17, 2024

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.

paulbaumgart avatar paulbaumgart commented on May 17, 2024

So, this is my attempt to fix this. It doesn't actually do anything smarter than just run reset --hard and clean -df, though.

paulbaumgart/gollum@c00e01a

from gollum.

Vanuan avatar Vanuan commented on May 17, 2024

@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.

paulbaumgart avatar paulbaumgart commented on May 17, 2024

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.

paulbaumgart avatar paulbaumgart commented on May 17, 2024

NathanNeff: the issue is that Grit expects bare repositories to end in .git. So bare_wiki_server_repo.git would work also.

from gollum.

Vanuan avatar Vanuan commented on May 17, 2024

So, you prefer performance over maintainability, I see.

from gollum.

MrJoy avatar MrJoy commented on May 17, 2024

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.

Vanuan avatar Vanuan commented on May 17, 2024

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.

Vanuan avatar Vanuan commented on May 17, 2024

Maybe gollum can detect changes in a working directory and will ask the user to commit before editing...

from gollum.

mojombo avatar mojombo commented on May 17, 2024

Update working dir (if present) when edited via the API. Closed by 94f05b0.

from gollum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.