Git Product home page Git Product logo

Comments (14)

lld2001 avatar lld2001 commented on July 18, 2024

Oh, it's because I download this repo from browser in github. That will miss .git dir.

from emacs.g.

tarsius avatar tarsius commented on July 18, 2024

See https://emacsmirror.net/manual/borg/Bootstrapping-using-a-seed.html.

from emacs.g.

lld2001 avatar lld2001 commented on July 18, 2024

I use borg in windows. After run make bootstrap, there are many errors.

e:\emacs\.emacs.d>make bootstrap

=== Running 'git submodule init' ===


=== Running 'lib/borg/borg.sh' ===
lib/borg/borg.sh:行2: $'\r': 未找到命令 (Command not found)
lib/borg/borg.sh:行7: $'\r': 未找到命令  (Command not found)
lib/borg/borg.sh:行10: $'\r': 未找到命令 (Command not found)
lib/borg/borg.sh: 第 13 行:cd: $'e:/emacs/.emacs.d\r\r': No such file or directo
ry
lib/borg/borg.sh:行14: $'\r': 未找到命令(Command not found)
lib/borg/borg.sh:行15: $'\r': 未找到命令(Command not found)
lib/borg/borg.sh:行62: 未预期的符号 `elif' 附近有语法错误 (syntax error in `elif')
'ib/borg/borg.sh:行62: `                elif test "$remote" = "$push_remote"
make: *** [lib/borg/borg.mk:97:bootstrap] 错误 2

from emacs.g.

lld2001 avatar lld2001 commented on July 18, 2024

What's the task of this script? Can I do it by hand using command or using elisp?

from emacs.g.

tarsius avatar tarsius commented on July 18, 2024

This file, like all other files, are checked in with unix line terminators (\n) into the repository. On your machine they appear to be checked out with dos/windows line terminators (\r\n), which makes sense since you are on windows. It appears though that your shell expects \n.

You can tell Git what file endings to check a file out with to work around this. See core.eol and subsequent variables in man git-config. It's probably best you search the web for articles about those variables. I don't have any experience with them and since this is not a Borg-specific issue I would appreciate it if you could get help for this elsewhere.

What's the task of this script? Can I do it by hand using command or using elisp?

It clones all modules and compiles all elisp. You can use git submodule update --init instead, but that will forgo compilation. You can do that in a second step using make build.

You could also try to change the terminators once, using dos2unix borg.sh.

from emacs.g.

lld2001 avatar lld2001 commented on July 18, 2024

You can do that in a second step using make build.

This is what I want. Thank you for your patient answer!

I have used git submodule update --init --recursive to clone all modules before the previous error occured. Emacs can also start normaly after git submodule update --init --recursive . But I found .el files not automatic compiled.

auto-compile doc says:

Starting with Emacs version 24.4, setting load-prefer-newer to t prevents outdated byte code files from being loaded. However this does not cause re-compilation of the source file, to actually do that auto-compile-on-load-mode is still required.

So I set load-prefer-newer to nil in early-init.el, but it still cannot auto-compile.

from emacs.g.

lld2001 avatar lld2001 commented on July 18, 2024

There's a problem in below function

(defun borg--maybe-absorb-gitdir (pkg)
  (if nil;(version< (nth 2 (split-string (car (process-lines "git" "version")) " "))
           ;     "2.12.0")
      (let ((gitdir (borg-gitdir pkg))
            (topdir (borg-worktree pkg)))
        (unless (equal (let ((default-directory topdir))
                         (car (process-lines "git" "rev-parse" "--git-dir")))
                       (directory-file-name gitdir))
          (rename-file (expand-file-name ".git" topdir) gitdir)
          (borg--link-gitdir pkg)
          (let ((default-directory gitdir))
            (borg--call-git pkg "config" "core.worktree"
                            (concat "../../../lib/" pkg)))))
    (borg--call-git pkg "submodule" "absorbgitdirs" "--" (borg-worktree pkg))))

because git's version in windows is special (‘2.18.0.windows.1’):
version-to-list: Invalid version syntax: ‘2.18.0.windows.1’

So I comment that condition.

from emacs.g.

tarsius avatar tarsius commented on July 18, 2024

I've pushed a fix for borg--maybe-absorb-gitdir.

from emacs.g.

tarsius avatar tarsius commented on July 18, 2024

So I set load-prefer-newer to nil in early-init.el, but it still cannot auto-compile.

The Auto-Compile modes only **re-**compile libraries. If there isn't already a *.elc file, then they don't start compiling a library.

make build, magit lib/<package-name> and M-x borg-build is how you should build packages.

from emacs.g.

lld2001 avatar lld2001 commented on July 18, 2024

make build, magit lib/ and M-x borg-build is how you should build packages.

make is not always available in Windows. So is it possible I substitute the make script by emacs operation or elisp?

from emacs.g.

tarsius avatar tarsius commented on July 18, 2024

make is not always available in Windows.

Let's say "it's complicated" instead. The "Windows Subsystem for Linux" stuff is probably the way forward. But I have no experience with that and don't use Windows, so I cannot help you there.

So is it possible I substitute the make script by emacs operation or elisp?

Yes, the Makefile isn't that complicated. Well that is just a wrapper but lib/borg/bork.mk shouldn't be hard to translate. Not sure I would want to distribute this with borg (so far you seem to be the first person who wants to use this on a Windows that doesn't somehow has make available). But if you write such a script we could certainly add it to the wiki.

from emacs.g.

lld2001 avatar lld2001 commented on July 18, 2024

I have to use Windows 7. So it's complicated. I have to seek a method without dependent on make.

make build actually run the function borg-batch-rebuild. Could this function be modifed to Command? I evaluate it, but it seems to use as a batch scripte. So that I can run it in Emcas.

After these steps, I can start from this starter-kit without depent on make stuff. So maybe I can run borg-batch-rebuild within Emacs(all starter packages available, but can not auto-compile)

  1. git clone https://github.com/emacscollective/emacs.g.git .emacs.d
  2. change .gitmodules file. Modify all "git@" to "https://" and all "com:" to "com/". That use https instead of ssh
  3. git submodule sync
  4. git submodule update --init
  5. then Emacs start normaly.

from emacs.g.

lld2001 avatar lld2001 commented on July 18, 2024

I have migrated my conf to borg. Sorry to bother you. Thank you.

from emacs.g.

tarsius avatar tarsius commented on July 18, 2024

Congratulations 😁

from emacs.g.

Related Issues (17)

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.