* Re: [PATCH] Use core.sharedrepository consistently.
From: Linus Torvalds @ 2006-03-04 23:16 UTC (permalink / raw)
To: Fernando J. Pereda; +Cc: git
In-Reply-To: <20060304225125.GB8891@ferdyx.org>
On Sat, 4 Mar 2006, Fernando J. Pereda wrote:
>
> 'git init-db --shared' sets 'core.sharedRepository' but in
> setup.c 'core.sharedrepository' is checked instead.
It really shouldn't matter.
Case in a git config option name is always converted to lower case when
the config file is read, exactly so that you can use mixed case without
the actual readers caring. Lots of people prefer mixed-case for
human-readable info, ie
[Core]
Name=Linus Torvalds
will actually generate
core.name=Linus Torvalds
as the config variable.
So the code should have worked fine. Unless there is some bug somewhere.
Linus
^ permalink raw reply
* Re: [PATCH] AsciiDoc fix for tutorial
From: Francis Daly @ 2006-03-04 23:07 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
In-Reply-To: <7v4q2dri8c.fsf@assigned-by-dhcp.cox.net>
On Sat, Mar 04, 2006 at 01:51:47PM -0800, Junio C Hamano wrote:
> Francis Daly <francis@daoine.org> writes:
>
> > shows the difference between that previous state and the state two
> > -commits ago. Also, HEAD~5 can be used as a shorthand for HEAD^^^^^,
> > +commits ago. Also, HEAD~5 can be used as a shorthand for HEAD{caret}{caret}{caret}^^,
>
> Thanks. Why not 5 {caret}, not just three {caret} plus ^^?
No real reason; the asciidoc parser accepts two together so I left them
there. Anyone reading a transformed version should see the real ^s,
so the question is whether it's clearer for someone reading the .txt
file to see a mixture with a passing resemblance to a few lines earlier,
or just to see {caret} consistently.
5 {caret} is fine by me.
For more consistency, there are three other ^s in the file could which
could also be changed, but none of them cause breakage now.
f
--
Francis Daly francis@daoine.org
^ permalink raw reply
* [PATCH] Use core.sharedrepository consistently.
From: Fernando J. Pereda @ 2006-03-04 23:05 UTC (permalink / raw)
To: git; +Cc: Junio C Hamano
[-- Attachment #1: Type: text/plain, Size: 1521 bytes --]
'git init-db --shared' sets 'core.sharedRepository' but in
setup.c 'core.sharedrepository' is checked instead. This
trivial patch fixes both init-db.c and its documentation to
use 'core.sharedrepository'.
Signed-off-by: Fernando J. Pereda <ferdy@gentoo.org>
---
Documentation/git-init-db.txt | 2 +-
init-db.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
531df8e5c78ca67746b7a651ac4486eae8b114c6
diff --git a/Documentation/git-init-db.txt b/Documentation/git-init-db.txt
index ea4d849..2d818d6 100644
--- a/Documentation/git-init-db.txt
+++ b/Documentation/git-init-db.txt
@@ -34,7 +34,7 @@ environment variable then the sha1 direc
otherwise the default `$GIT_DIR/objects` directory is used.
A shared repository allows users belonging to the same group to push into that
-repository. When specifying `--shared` the config variable "core.sharedRepository"
+repository. When specifying `--shared` the config variable "core.sharedrepository"
is set to 'true' so that directories under `$GIT_DIR` are made group writable
(and g+sx, since the git group may be not the primary group of all users).
diff --git a/init-db.c b/init-db.c
index ff29496..e77a749 100644
--- a/init-db.c
+++ b/init-db.c
@@ -285,7 +285,7 @@ int main(int argc, char **argv)
safe_create_dir(path, 1);
if (shared_repository)
- git_config_set("core.sharedRepository", "true");
+ git_config_set("core.sharedrepository", "true");
return 0;
}
--
1.2.4
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply related
* Re: [PATCH] Use core.sharedrepository consistently.
From: Fernando J. Pereda @ 2006-03-04 23:02 UTC (permalink / raw)
To: git
In-Reply-To: <20060304225125.GB8891@ferdyx.org>
[-- Attachment #1: Type: text/plain, Size: 298 bytes --]
On Sat, Mar 04, 2006 at 11:51:25PM +0100, Fernando J. Pereda wrote:
> [snip]
Nevermind that one... I screwed almost every possible header in my mail.
Sorry.
--
Fernando J. Pereda Garcimartín
Gentoo Developer (Alpha,net-mail,mutt,git)
20BB BDC3 761A 4781 E6ED ED0B 0A48 5B0C 60BD 28D4
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* [PATCH] Use core.sharedrepository consistently.
From: Fernando J. Pereda @ 2006-03-04 22:51 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 1523 bytes --]
'git init-db --shared' sets 'core.sharedRepository' but in
setup.c 'core.sharedrepository' is checked instead. This
trivial patch makes both init-db.c and its documentation to
use 'core.sharedrepository'.
Signed-off-by: Fernando J. Pereda <ferdy@gentoo.org>
---
Documentation/git-init-db.txt | 2 +-
init-db.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
531df8e5c78ca67746b7a651ac4486eae8b114c6
diff --git a/Documentation/git-init-db.txt b/Documentation/git-init-db.txt
index ea4d849..2d818d6 100644
--- a/Documentation/git-init-db.txt
+++ b/Documentation/git-init-db.txt
@@ -34,7 +34,7 @@ environment variable then the sha1 direc
otherwise the default `$GIT_DIR/objects` directory is used.
A shared repository allows users belonging to the same group to push into that
-repository. When specifying `--shared` the config variable "core.sharedRepository"
+repository. When specifying `--shared` the config variable "core.sharedrepository"
is set to 'true' so that directories under `$GIT_DIR` are made group writable
(and g+sx, since the git group may be not the primary group of all users).
diff --git a/init-db.c b/init-db.c
index ff29496..e77a749 100644
--- a/init-db.c
+++ b/init-db.c
@@ -285,7 +285,7 @@ int main(int argc, char **argv)
safe_create_dir(path, 1);
if (shared_repository)
- git_config_set("core.sharedRepository", "true");
+ git_config_set("core.sharedrepository", "true");
return 0;
}
--
1.2.4
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply related
* Re: Problems with using git
From: Greg KH @ 2006-03-04 22:25 UTC (permalink / raw)
To: Mark Wooding; +Cc: git
In-Reply-To: <slrne0isi9.fr9.mdw@metalzone.distorted.org.uk>
On Sat, Mar 04, 2006 at 10:56:09AM +0000, Mark Wooding wrote:
> Greg KH <greg@kroah.com> wrote:
>
> > The latest development tree, and the latest public betas contain
> > 1.1.3. If you think this should be newer, I can easily go poke the
> > proper people...
>
> Given that there's a security issue which got fixed in 1.1.5, I think
> this is really a bit poor.
>
> I notice, by contrast, that Debian had managed to repackage and release
> a new GIT the day after Junio fixed the bug in the first place. That
> was more than a month ago.
Fair enough, I'll go poke the proper people now...
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] AsciiDoc fix for tutorial
From: Junio C Hamano @ 2006-03-04 21:51 UTC (permalink / raw)
To: Francis Daly; +Cc: git
In-Reply-To: <20060304163527.GA12015@craic.sysops.org>
Francis Daly <francis@daoine.org> writes:
> shows the difference between that previous state and the state two
> -commits ago. Also, HEAD~5 can be used as a shorthand for HEAD^^^^^,
> +commits ago. Also, HEAD~5 can be used as a shorthand for HEAD{caret}{caret}{caret}^^,
Thanks. Why not 5 {caret}, not just three {caret} plus ^^?
^ permalink raw reply
* git-status too verbose?
From: Eric Jaffe @ 2006-03-04 17:52 UTC (permalink / raw)
To: git
I was wondering if anyone else thinks that git-status should be more
like "git-diff --name-status". That is,
# A a/newfile.c
# M a/oldfile.c
instead of
# new file: a/newfile.c
# modified: a/oldfile.c
This would be similar to cg-status and "svn status", etc.
--
Eric Jaffe <jaffe.eric@gmail.com>
^ permalink raw reply
* Re: On recording renames
From: Linus Torvalds @ 2006-03-04 17:36 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, paul
In-Reply-To: <7v8xrqqrdd.fsf@assigned-by-dhcp.cox.net>
On Sat, 4 Mar 2006, Junio C Hamano wrote:
>
> An ideal merge strategy would handle the case where pieces of
> code gradually moves around across file boundaries. I do not
> think this is something you can sensibly do by recording file
> rename history. It would not help the situation a bit even if
> you gave each file (or content or object or whatever you want to
> call it) a persistent ID.
Actually, we have an absolutely perfect example of this much closer to
home.
I originally did the "rev-list split" series on an older version of git,
before you did the --objects-edge and the full pathname hashing
improvements. But when I was done, you'd merged that, and I needed to
merge my rev-list.c split with your improvements in order to send it to
you.
Now, the whold file hadn't actually been renamed, but about 50% of that
file had been split into a new one. So effectively you had a merge where
part of the new stuff had to be merged into another file.
Now, I think this is actually more common than renames in many ways. It's
not a "complete" rename, but as far as _part_ of your changes were
concerned, it was one.
And yes, such a split can be something that is done in stages, again
exactly the same way about 85% of rev-list.c was moved into revision.c in
two stages: the first stage was the argument parsing and setup, and the
second stage was the actual revision walking logic.
Linus
^ permalink raw reply
* [PATCH] AsciiDoc fix for tutorial
From: Francis Daly @ 2006-03-04 16:35 UTC (permalink / raw)
To: git
RE \^.+\^ becomes <sup>. Not wanted here
---
Documentation/tutorial.txt | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
7b81a656bfa1faea449f4c9c083d69f940912a8d
diff --git a/Documentation/tutorial.txt b/Documentation/tutorial.txt
index 66680d7..268a877 100644
--- a/Documentation/tutorial.txt
+++ b/Documentation/tutorial.txt
@@ -309,7 +309,7 @@ git diff HEAD^^ HEAD^
-------------------------------------
shows the difference between that previous state and the state two
-commits ago. Also, HEAD~5 can be used as a shorthand for HEAD^^^^^,
+commits ago. Also, HEAD~5 can be used as a shorthand for HEAD{caret}{caret}{caret}^^,
and more generally HEAD~n can refer to the nth previous commit.
Commits representing merges have more than one parent, and you can
specify which parent to follow in that case; see
--
1.2.GIT
--
Francis Daly francis@daoine.org
^ permalink raw reply related
* [PATCH 5/5] git.el: Added customize support for all parameters.
From: Alexandre Julliard @ 2006-03-04 16:38 UTC (permalink / raw)
To: git
Also fixed quoting of git-log-msg-separator.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
contrib/emacs/git.el | 85 ++++++++++++++++++++++++++++++++------------------
1 files changed, 54 insertions(+), 31 deletions(-)
c41661801015e1d04d1ac3c3a3ccd2ba254bb02c
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 0b24b4d..5135e36 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -44,7 +44,6 @@
;; - switching branches
;; - revlist browser
;; - git-show-branch browser
-;; - customize support
;; - menus
;;
@@ -52,68 +51,92 @@
(require 'ewoc)
-;;;; Faces
+;;;; Customizations
;;;; ------------------------------------------------------------
+(defgroup git nil
+ "Git user interface")
+
+(defcustom git-committer-name nil
+ "User name to use for commits.
+The default is to fall back to `add-log-full-name' and then `user-full-name'."
+ :group 'git
+ :type '(choice (const :tag "Default" nil)
+ (string :tag "Name")))
+
+(defcustom git-committer-email nil
+ "Email address to use for commits.
+The default is to fall back to `add-log-mailing-address' and then `user-mail-address'."
+ :group 'git
+ :type '(choice (const :tag "Default" nil)
+ (string :tag "Email")))
+
+(defcustom git-commits-coding-system 'utf-8
+ "Default coding system for the log message of git commits."
+ :group 'git
+ :type 'coding-system)
+
+(defcustom git-append-signed-off-by nil
+ "Whether to append a Signed-off-by line to the commit message before editing."
+ :group 'git
+ :type 'boolean)
+
+(defcustom git-per-dir-ignore-file ".gitignore"
+ "Name of the per-directory ignore file."
+ :group 'git
+ :type 'string)
+
(defface git-status-face
'((((class color) (background light)) (:foreground "purple")))
- "Git mode face used to highlight added and modified files.")
+ "Git mode face used to highlight added and modified files."
+ :group 'git)
(defface git-unmerged-face
'((((class color) (background light)) (:foreground "red" :bold t)))
- "Git mode face used to highlight unmerged files.")
+ "Git mode face used to highlight unmerged files."
+ :group 'git)
(defface git-unknown-face
'((((class color) (background light)) (:foreground "goldenrod" :bold t)))
- "Git mode face used to highlight unknown files.")
+ "Git mode face used to highlight unknown files."
+ :group 'git)
(defface git-uptodate-face
'((((class color) (background light)) (:foreground "grey60")))
- "Git mode face used to highlight up-to-date files.")
+ "Git mode face used to highlight up-to-date files."
+ :group 'git)
(defface git-ignored-face
'((((class color) (background light)) (:foreground "grey60")))
- "Git mode face used to highlight ignored files.")
+ "Git mode face used to highlight ignored files."
+ :group 'git)
(defface git-mark-face
'((((class color) (background light)) (:foreground "red" :bold t)))
- "Git mode face used for the file marks.")
+ "Git mode face used for the file marks."
+ :group 'git)
(defface git-header-face
'((((class color) (background light)) (:foreground "blue")))
- "Git mode face used for commit headers.")
+ "Git mode face used for commit headers."
+ :group 'git)
(defface git-separator-face
'((((class color) (background light)) (:foreground "brown")))
- "Git mode face used for commit separator.")
+ "Git mode face used for commit separator."
+ :group 'git)
(defface git-permission-face
'((((class color) (background light)) (:foreground "green" :bold t)))
- "Git mode face used for permission changes.")
-
-(defvar git-committer-name nil
- "*User name to use for commits.
-If not set, fall back to `add-log-full-name' and then `user-full-name'.")
-
-(defvar git-committer-email nil
- "*Email address to use for commits.
-If not set, fall back to `add-log-mailing-address' and then `user-mail-address'.")
-
-(defvar git-commits-coding-system 'utf-8
- "Default coding system for git commits.")
-
-(defvar git-append-signed-off-by nil
- "Whether to append a Signed-off-by line to the commit message.")
-
-(defconst git-log-msg-separator "--- log message follows this line ---")
-
-(defconst git-per-dir-ignore-file ".gitignore"
- "Name of the per-directory ignore file.")
+ "Git mode face used for permission changes."
+ :group 'git)
;;;; Utilities
;;;; ------------------------------------------------------------
+(defconst git-log-msg-separator "--- log message follows this line ---")
+
(defun git-get-env-strings (env)
"Build a list of NAME=VALUE strings from a list of environment strings."
(mapcar (lambda (entry) (concat (car entry) "=" (cdr entry))) env))
@@ -279,7 +302,7 @@ If not set, fall back to `add-log-mailin
(with-current-buffer buffer
(goto-char (point-min))
(if
- (setq log-start (re-search-forward (concat "^" git-log-msg-separator "\n") nil t))
+ (setq log-start (re-search-forward (concat "^" (regexp-quote git-log-msg-separator) "\n") nil t))
(save-restriction
(narrow-to-region (point-min) log-start)
(goto-char (point-min))
--
1.2.4.g0040-dirty
--
Alexandre Julliard
julliard@winehq.org
^ permalink raw reply related
* [PATCH 4/5] git.el: Added support for Signed-off-by.
From: Alexandre Julliard @ 2006-03-04 16:38 UTC (permalink / raw)
To: git
If `git-append-signed-off-by' is non-nil, automatically append a
sign-off line to the log message when editing it.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
contrib/emacs/git.el | 16 +++++++++++-----
1 files changed, 11 insertions(+), 5 deletions(-)
00728d51cbda0f21be59cc56b23f4943c6657a63
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 335dcb2..0b24b4d 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -39,7 +39,6 @@
;; - hook into file save (after-save-hook)
;; - diff against other branch
;; - renaming files from the status buffer
-;; - support for appending signed-off-by
;; - creating tags
;; - fetch/pull
;; - switching branches
@@ -103,6 +102,9 @@ If not set, fall back to `add-log-mailin
(defvar git-commits-coding-system 'utf-8
"Default coding system for git commits.")
+(defvar git-append-signed-off-by nil
+ "Whether to append a Signed-off-by line to the commit message.")
+
(defconst git-log-msg-separator "--- log message follows this line ---")
(defconst git-per-dir-ignore-file ".gitignore"
@@ -792,7 +794,8 @@ If not set, fall back to `add-log-mailin
(unless git-status (error "Not in git-status buffer."))
(let ((buffer (get-buffer-create "*git-commit*"))
(merge-heads (git-get-merge-heads))
- (dir default-directory))
+ (dir default-directory)
+ (sign-off git-append-signed-off-by))
(with-current-buffer buffer
(when (eq 0 (buffer-size))
(cd dir)
@@ -809,10 +812,13 @@ If not set, fall back to `add-log-mailin
'face 'git-header-face)
(propertize git-log-msg-separator 'face 'git-separator-face)
"\n")
- (when (and merge-heads (file-readable-p ".git/MERGE_MSG"))
- (insert-file-contents ".git/MERGE_MSG"))))
+ (cond ((and merge-heads (file-readable-p ".git/MERGE_MSG"))
+ (insert-file-contents ".git/MERGE_MSG"))
+ (sign-off
+ (insert (format "\n\nSigned-off-by: %s <%s>\n"
+ (git-get-committer-name) (git-get-committer-email)))))))
(let ((log-edit-font-lock-keywords
- `(("^\\(Author:\\|Date:\\|Parent:\\)\\(.*\\)"
+ `(("^\\(Author:\\|Date:\\|Parent:\\|Signed-off-by:\\)\\(.*\\)"
(1 font-lock-keyword-face)
(2 font-lock-function-name-face))
(,(concat "^\\(" (regexp-quote git-log-msg-separator) "\\)$")
--
1.2.4.g0040-dirty
--
Alexandre Julliard
julliard@winehq.org
^ permalink raw reply related
* [PATCH 3/5] git.el: Automatically update .gitignore status.
From: Alexandre Julliard @ 2006-03-04 16:38 UTC (permalink / raw)
To: git
Update .gitignore files in the status list as they are created or
modified.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
contrib/emacs/git.el | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
403b5738e69df610ab625085ccbd771a466b7af8
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 2363e48..335dcb2 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -213,14 +213,19 @@ If not set, fall back to `add-log-mailin
"Add a file name to the ignore file in its directory."
(let* ((fullname (expand-file-name file))
(dir (file-name-directory fullname))
- (name (file-name-nondirectory fullname)))
+ (name (file-name-nondirectory fullname))
+ (ignore-name (expand-file-name git-per-dir-ignore-file dir))
+ (created (not (file-exists-p ignore-name))))
(save-window-excursion
- (set-buffer (find-file-noselect (expand-file-name git-per-dir-ignore-file dir)))
+ (set-buffer (find-file-noselect ignore-name))
(goto-char (point-max))
(unless (zerop (current-column)) (insert "\n"))
(insert name "\n")
(sort-lines nil (point-min) (point-max))
- (save-buffer))))
+ (save-buffer))
+ (when created
+ (git-run-command nil nil "update-index" "--info-only" "--add" "--" (file-relative-name ignore-name)))
+ (git-add-status-file (if created 'added 'modified) (file-relative-name ignore-name))))
;;;; Wrappers for basic git commands
--
1.2.4.g0040-dirty
--
Alexandre Julliard
julliard@winehq.org
^ permalink raw reply related
* [PATCH 2/5] git.el: Set default directory before running the status mode setup hooks.
From: Alexandre Julliard @ 2006-03-04 16:38 UTC (permalink / raw)
To: git
Also set the list-buffers-directory variable for nicer buffer list
display.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
contrib/emacs/git.el | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
437d990348e13e6a4460cc445ec5d2b2077cf2fb
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 5828d4c..2363e48 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -943,6 +943,7 @@ Commands:
(erase-buffer)
(let ((status (ewoc-create 'git-fileinfo-prettyprint "" "")))
(set (make-local-variable 'git-status) status))
+ (set (make-local-variable 'list-buffers-directory) default-directory)
(run-hooks 'git-status-mode-hook)))
(defun git-status (dir)
@@ -952,8 +953,8 @@ Commands:
(if (file-directory-p (concat (file-name-as-directory dir) ".git"))
(let ((buffer (create-file-buffer (expand-file-name "*git-status*" dir))))
(switch-to-buffer buffer)
- (git-status-mode)
(cd dir)
+ (git-status-mode)
(git-refresh-status)
(goto-char (point-min)))
(message "%s is not a git working tree." dir)))
--
1.2.4.g0040-dirty
--
Alexandre Julliard
julliard@winehq.org
^ permalink raw reply related
* [PATCH 1/5] git.el: Portability fixes for XEmacs and Emacs CVS.
From: Alexandre Julliard @ 2006-03-04 16:37 UTC (permalink / raw)
To: git
Fixed octal constants for XEmacs.
Added highlighting support in log-edit buffer for Emacs CVS.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
contrib/emacs/git.el | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
7c95060616dd2f596d2f0bc0d707c584002913db
diff --git a/contrib/emacs/git.el b/contrib/emacs/git.el
index 8f23477..5828d4c 100644
--- a/contrib/emacs/git.el
+++ b/contrib/emacs/git.el
@@ -388,9 +388,9 @@ If not set, fall back to `add-log-mailin
(propertize
(if (or (not old-perm)
(not new-perm)
- (eq 0 (logand #O111 (logxor old-perm new-perm))))
+ (eq 0 (logand ?\111 (logxor old-perm new-perm))))
" "
- (if (eq 0 (logand #O111 old-perm)) "+x" "-x"))
+ (if (eq 0 (logand ?\111 old-perm)) "+x" "-x"))
'face 'git-permission-face))
(defun git-fileinfo-prettyprint (info)
@@ -806,7 +806,13 @@ If not set, fall back to `add-log-mailin
"\n")
(when (and merge-heads (file-readable-p ".git/MERGE_MSG"))
(insert-file-contents ".git/MERGE_MSG"))))
- (log-edit #'git-do-commit nil #'git-log-edit-files buffer)))
+ (let ((log-edit-font-lock-keywords
+ `(("^\\(Author:\\|Date:\\|Parent:\\)\\(.*\\)"
+ (1 font-lock-keyword-face)
+ (2 font-lock-function-name-face))
+ (,(concat "^\\(" (regexp-quote git-log-msg-separator) "\\)$")
+ (1 font-lock-comment-face)))))
+ (log-edit #'git-do-commit nil #'git-log-edit-files buffer))))
(defun git-find-file ()
"Visit the current file in its own buffer."
@@ -891,7 +897,7 @@ If not set, fall back to `add-log-mailin
(define-key map "d" diff-map)
(define-key map "=" 'git-diff-file)
(define-key map "f" 'git-find-file)
- (define-key map [RET] 'git-find-file)
+ (define-key map "\r" 'git-find-file)
(define-key map "g" 'git-refresh-status)
(define-key map "i" 'git-ignore-file)
(define-key map "l" 'git-log-file)
--
1.2.4.g0040-dirty
--
Alexandre Julliard
julliard@winehq.org
^ permalink raw reply related
* Emacs git interface
From: Jakub Narebski @ 2006-03-04 15:10 UTC (permalink / raw)
To: Alexandre Julliard; +Cc: git
Thank you for creating Emacs git interface.
You might want to take a look at other Emacs version control interfaces
http://www.emacswiki.org/cgi-bin/wiki/CategoryVersionControl
especially for distributed SCMs similar to Git: Mercurial and Monotone:
http://hg.serpentine.com/mercurial/bos?f=794a337fb657;file=contrib/mercurial.el;style=gitweb
http://viewmtn.angrygoats.net/getfile.py?id=file&path=contrib/monotone.el
--
Jakub Narebski
Poland
^ permalink raw reply
* [PATCH] contrib/emacs: Add an Emacs VC backend.
From: Alexandre Julliard @ 2006-03-04 14:32 UTC (permalink / raw)
To: git
Add a basic Emacs VC backend. It currently supports the following
commands: checkin, checkout, diff, log, revert, and annotate. There is
only limited support for working with revisions other than HEAD.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
---
contrib/emacs/vc-git.el | 135 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 135 insertions(+), 0 deletions(-)
create mode 100644 contrib/emacs/vc-git.el
b0c7984b6da71ab875c40a661b9a743370c41dfb
diff --git a/contrib/emacs/vc-git.el b/contrib/emacs/vc-git.el
new file mode 100644
index 0000000..2453cdc
--- /dev/null
+++ b/contrib/emacs/vc-git.el
@@ -0,0 +1,135 @@
+;;; vc-git.el --- VC backend for the git version control system
+
+;; Copyright (C) 2006 Alexandre Julliard
+
+;; This program is free software; you can redistribute it and/or
+;; modify it under the terms of the GNU General Public License as
+;; published by the Free Software Foundation; either version 2 of
+;; the License, or (at your option) any later version.
+;;
+;; This program is distributed in the hope that it will be
+;; useful, but WITHOUT ANY WARRANTY; without even the implied
+;; warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+;; PURPOSE. See the GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public
+;; License along with this program; if not, write to the Free
+;; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+;; MA 02111-1307 USA
+
+;;; Commentary:
+
+;; This file contains a VC backend for the git version control
+;; system.
+;;
+;; To install: put this file on the load-path and add GIT to the list
+;; of supported backends in `vc-handled-backends'.
+;;
+;; TODO
+;; - changelog generation
+;; - working with revisions other than HEAD
+;;
+
+(defvar git-commits-coding-system 'utf-8
+ "Default coding system for git commits.")
+
+(defun vc-git--run-command-string (file &rest args)
+ "Run a git command on FILE and return its output as string."
+ (let* ((ok t)
+ (str (with-output-to-string
+ (with-current-buffer standard-output
+ (unless (eq 0 (apply #'call-process "git" nil '(t nil) nil
+ (append args (list (file-relative-name file)))))
+ (setq ok nil))))))
+ (and ok str)))
+
+(defun vc-git--run-command (file &rest args)
+ "Run a git command on FILE, discarding any output."
+ (let ((name (file-relative-name file)))
+ (eq 0 (apply #'call-process "git" nil (get-buffer "*Messages") nil (append args (list name))))))
+
+(defun vc-git-registered (file)
+ "Check whether FILE is registered with git."
+ (with-temp-buffer
+ (let* ((dir (file-name-directory file))
+ (name (file-relative-name file dir)))
+ (when dir (cd dir))
+ (and (eq 0 (call-process "git" nil '(t nil) nil "ls-files" "-c" "-z" "--" name))
+ (let ((str (buffer-string)))
+ (and (> (length str) (length name))
+ (string= (substring str 0 (1+ (length name))) (concat name "\0"))))))))
+
+(defun vc-git-state (file)
+ "git-specific version of `vc-state'."
+ (let ((diff (vc-git--run-command-string file "diff-index" "-z" "HEAD" "--")))
+ (if (and diff (string-match ":[0-7]\\{6\\} [0-7]\\{6\\} [0-9a-f]\\{40\\} [0-9a-f]\\{40\\} [ADMU]\0[^\0]+\0" diff))
+ 'edited
+ 'up-to-date)))
+
+(defun vc-git-workfile-version (file)
+ "git-specific version of `vc-workfile-version'."
+ (let ((str (with-output-to-string
+ (with-current-buffer standard-output
+ (call-process "git" nil '(t nil) nil "symbolic-ref" "HEAD")))))
+ (if (string-match "^\\(refs/heads/\\)?\\(.+\\)$" str)
+ (match-string 2 str)
+ str)))
+
+(defun vc-git-revert (file &optional contents-done)
+ "Revert FILE to the version stored in the git repository."
+ (if contents-done
+ (vc-git--run-command file "update-index" "--")
+ (vc-git--run-command file "checkout" "HEAD")))
+
+(defun vc-git-checkout-model (file)
+ 'implicit)
+
+(defun vc-git-workfile-unchanged-p (file)
+ (let ((sha1 (vc-git--run-command-string file "hash-object" "--"))
+ (head (vc-git--run-command-string file "ls-tree" "-z" "HEAD" "--")))
+ (and head
+ (string-match "[0-7]\\{6\\} blob \\([0-9a-f]\\{40\\}\\)\t[^\0]+\0" head)
+ (string= (car (split-string sha1 "\n")) (match-string 1 head)))))
+
+(defun vc-git-register (file &optional rev comment)
+ "Register FILE into the git version-control system."
+ (vc-git--run-command file "update-index" "--add" "--"))
+
+(defun vc-git-print-log (file)
+ (let ((name (file-relative-name file))
+ (coding-system-for-read git-commits-coding-system))
+ (vc-do-command nil 'async "git" name "rev-list" "--pretty" "HEAD" "--")))
+
+(defun vc-git-diff (file &optional rev1 rev2)
+ (let ((name (file-relative-name file)))
+ (if (and rev1 rev2)
+ (vc-do-command "*vc-diff*" 0 "git" name "diff-tree" "-p" rev1 rev2 "--")
+ (vc-do-command "*vc-diff*" 0 "git" name "diff-index" "-p" (or rev1 "HEAD") "--"))
+ ; git-diff-index doesn't set exit status like diff does
+ (if (vc-git-workfile-unchanged-p file) 0 1)))
+
+(defun vc-git-checkin (file rev comment)
+ (let ((coding-system-for-write git-commits-coding-system))
+ (vc-git--run-command file "commit" "-m" comment "--only" "--")))
+
+(defun vc-git-checkout (file &optional editable rev destfile)
+ (vc-git--run-command file "checkout" (or rev "HEAD")))
+
+(defun vc-git-annotate-command (file buf &optional rev)
+ ; FIXME: rev is ignored
+ (let ((name (file-relative-name file)))
+ (call-process "git" nil buf nil "annotate" name)))
+
+(defun vc-git-annotate-time ()
+ (and (re-search-forward "[0-9a-f]+\t(.*\t\\([0-9]+\\)-\\([0-9]+\\)-\\([0-9]+\\) \\([0-9]+\\):\\([0-9]+\\):\\([0-9]+\\) \\([-+0-9]+\\)\t[0-9]+)" nil t)
+ (vc-annotate-convert-time
+ (apply #'encode-time (mapcar (lambda (match) (string-to-number (match-string match))) '(6 5 4 3 2 1 7))))))
+
+;; Not really useful since we can't do anything with the revision yet
+;;(defun vc-annotate-extract-revision-at-line ()
+;; (save-excursion
+;; (move-beginning-of-line 1)
+;; (and (looking-at "[0-9a-f]+")
+;; (buffer-substring (match-beginning 0) (match-end 0)))))
+
+(provide 'vc-git)
--
1.2.4.g0040-dirty
--
Alexandre Julliard
julliard@winehq.org
^ permalink raw reply related
* Re: On recording renames
From: Junio C Hamano @ 2006-03-04 13:19 UTC (permalink / raw)
To: git; +Cc: paul
In-Reply-To: <7v64muvin9.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
> A bit more on merges and renames...
> The whole thread is worth reading, but the punch line is:
>
> The transition happened over time with multiple commits.
> You cannot record "this is the rename" by attributing that
> information to one particular commit.
After re-reading that thread, and especially the analysis of the
history of that part of the kernel source I did back then, I am
again convinced that Linus was right when he said "file renames
do not matter". That real-life example shows how inadequate
file boundaries are when dealing with content changes.
An ideal merge strategy would handle the case where pieces of
code gradually moves around across file boundaries. I do not
think this is something you can sensibly do by recording file
rename history. It would not help the situation a bit even if
you gave each file (or content or object or whatever you want to
call it) a persistent ID.
One way (now, it is my turn to handwave) to do such a merge
might be to take the whole tree as if it were a flat single file
(think of it as a concatenation of all files in the tree) with
each line tagged with the pathname. You and your friend would
start from something like this. A single file that describe
topics of interest to both of you:
notes.txt:Kernel Topics
notes.txt: - filesystem
notes.txt: - scheduler
notes.txt: - devices
notes.txt:Cool Git Topics
notes.txt: - git-cvsserver
notes.txt: - Cogito
And your friend splits this into two files and starts editing,
while you edit the original file:
your friend you
linux.txt:Kernel Topics notes.txt:Kernel Topics
linux.txt: - filesystem notes.txt: - filesystem
linux.txt: - scheduler notes.txt: - scheduler
linux.txt: - devices notes.txt: - devices
linux.txt: - stable driver API notes.txt: - mm
git.txt:Cool Git Topics notes.txt:Cool Git Topics
git.txt: - git-cvsserver notes.txt: - git-cvsserver
git.txt: - Cogito notes.txt: - gitview
notes.txt: - Cogito
notes.txt: - StGIT
notes.txt: - diff --cc
Now you would want to compare notes and merge them. When
comparing these two "trees", the clever merge algorithm would
treat this two-column thingy and merge both labels
(i.e. pathnames) and contents:
linux.txt:Kernel Topics
linux.txt: - filesystem
linux.txt: - scheduler
linux.txt: - devices
linux.txt: - mm
linux.txt: - stable driver API
git.txt:Cool Git Topics
git.txt: - git-cvsserver
git.txt: - gitview
git.txt: - Cogito
git.txt: - StGIT
git.txt: - diff --cc
It could even guess that the line you touched are related to the
hunk your friend moved to another file (iow, your friend gave a
new label to the region you touched), and label your new line
with the same pathname as surrounding lines.
I suspect this is weave merge taken to its extreme, but I am
handwaving so please do not ask me how I would propose to
implement it ;-). The point really is that file is a poor unit
of operation when dealing with changes.
^ permalink raw reply
* Re: Problems with using git
From: Mark Wooding @ 2006-03-04 10:56 UTC (permalink / raw)
To: git
In-Reply-To: <20060302235824.GA13436@kroah.com>
Greg KH <greg@kroah.com> wrote:
> The latest development tree, and the latest public betas contain
> 1.1.3. If you think this should be newer, I can easily go poke the
> proper people...
Given that there's a security issue which got fixed in 1.1.5, I think
this is really a bit poor.
I notice, by contrast, that Debian had managed to repackage and release
a new GIT the day after Junio fixed the bug in the first place. That
was more than a month ago.
-- [mdw]
^ permalink raw reply
* cvsimport woes
From: Rajkumar S @ 2006-03-04 7:47 UTC (permalink / raw)
To: git
Hi,
I am trying to track a cvs project using git. The idea is to use cvsimport to update my
local git copy and make my changes in a separate branch. But for some reason after
cvsimport the last update of cvs repository is not reflected in git. I have made a small
script to test this behavior and am able to reproduce is consistently. I am working on
FreeBSD 6.0-RELEASE, git version 1.2.4 and cvsps version 2.1
The first script is to init a cvs repository, add 3 files and cvsimport it into git
repository, before which I remove the all directories and .cvsps
raj@beastie:~$ cat git_init.sh
export CVSROOT=/home/raj/cvsroot
rm -rf cvsroot/ git/ src/ /home/raj/.cvsps
mkdir cvsroot git src
cvs init
cd src/
echo "Line one" > file.txt
echo "Line one" > file1.txt
echo "Line one" > file2.txt
cvs import -m "Imported sources" src start realstart
cd ..
rm -rf src/
cvs co src
git cvsimport -v -d /home/raj/cvsroot -C git/ src
on executing:
N src/file.txt
N src/file1.txt
N src/file2.txt
No conflicts created by this import
cvs checkout: Updating src
U src/file.txt
U src/file1.txt
U src/file2.txt
cvs_direct initialized to CVSROOT /home/raj/cvsroot
cvs rlog: Logging src
Fetching file.txt v 1.1
New file.txt: 9 bytes
Fetching file1.txt v 1.1
New file1.txt: 9 bytes
Fetching file2.txt v 1.1
New file2.txt: 9 bytes
Tree ID b75643d0deaa77018b4dbaa2ff81756c4c1bebc1
Committed patch 1 (origin 2006-03-04 07:37:59)
Committing initial tree b75643d0deaa77018b4dbaa2ff81756c4c1bebc1
Commit ID e800fd633e319b9a0b4c351f2964a03abf96b6e2
Fetching file.txt v 1.1.1.1
Update file.txt: 9 bytes
Fetching file1.txt v 1.1.1.1
Update file1.txt: 9 bytes
Fetching file2.txt v 1.1.1.1
Update file2.txt: 9 bytes
Tree ID b75643d0deaa77018b4dbaa2ff81756c4c1bebc1
Parent ID e800fd633e319b9a0b4c351f2964a03abf96b6e2
Committed patch 2 (start 2006-03-04 07:37:59)
Commit ID 21bd067b19310d11790e99ad421de6611b942fbd
Created tag 'realstart' on 'start'
DONE; creating master branch
Now edit two files, commit cvs and cvsupdate again.
raj@beastie:~$ cat git_test.sh
export CVSROOT=/home/raj/cvsroot
cd src/
echo "Line two" >> file.txt
echo "Line two" >> file1.txt
cvs commit -m "v2.0"
cd ..
git cvsimport -v -d /home/raj/cvsroot -C git/ src
cd git
git status
cd ..
echo cat git/file.txt
cat git/file.txt
echo cat src/file.txt
cat src/file.txt
on executing:
cvs commit: Examining .
Checking in file.txt;
/home/raj/cvsroot/src/file.txt,v <-- file.txt
new revision: 1.2; previous revision: 1.1
done
Checking in file1.txt;
/home/raj/cvsroot/src/file1.txt,v <-- file1.txt
new revision: 1.2; previous revision: 1.1
done
cvs_direct initialized to CVSROOT /home/raj/cvsroot
cvs rlog: Logging src
skip patchset 1: 1141457879 before 1141457879
skip patchset 2: 1141457879 before 1141457879
Switching from master to origin
Fetching file.txt v 1.2
Update file.txt: 18 bytes
Fetching file1.txt v 1.2
Update file1.txt: 18 bytes
Tree ID 18d855d5b825ef1c0ecb9d26591e654cbe5c21df
Parent ID e800fd633e319b9a0b4c351f2964a03abf96b6e2
Committed patch 3 (origin 2006-03-04 07:39:35)
Commit ID 6e7129d186834d5b2941e78c1c67c5255f868e12
DONE
#
# Updated but not checked in:
# (will commit)
#
# modified: file.txt
# modified: file1.txt
#
cat git/file.txt
Line one
cat src/file.txt
Line one
Line two
As you can see the git/file.txt and src/file.txt are different. I have tried my best to
read all documentation and follow them faithfully and I hope I am not making any obviously
stupid mistake.
raj
^ permalink raw reply
* [PATCH] cvsserver: anonymous cvs via pserver support
From: Martin Langhoff @ 2006-03-04 7:30 UTC (permalink / raw)
To: git, junkio; +Cc: Martin Langhoff
git-cvsserver now knows how to do the pserver auth chat when the user
is anonymous. To get it to work, add a line to your inetd.conf like
cvspserver stream tcp nowait nobody git-cvsserver pserver
(On some inetd implementations you may have to put the pserver parameter twice.)
Commits are blocked. Naively, git-cvsserver assumes non-malicious users. Please
review the code before setting this up on an internet-accessible server.
NOTE: the <nobody> user above will need write access to the .git directory
to maintain the sqlite database. Updating of the sqlite database should be
put in an update hook to avoid this problem, so that it is maintained by
users with write access.
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
---
git-cvsserver.perl | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
91a6bf468230d63c414a21adeef94f1242eaaaab
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index b450792..7d3f78e 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -87,6 +87,31 @@ $log->info("--------------- STARTING ---
my $TEMP_DIR = tempdir( CLEANUP => 1 );
$log->debug("Temporary directory is '$TEMP_DIR'");
+# if we are called with a pserver argument,
+# deal with the authentication cat before entereing the
+# main loop
+if (@ARGV && $ARGV[0] eq 'pserver') {
+ my $line = <STDIN>; chomp $line;
+ unless( $line eq 'BEGIN AUTH REQUEST') {
+ die "E Do not understand $line - expecting BEGIN AUTH REQUEST\n";
+ }
+ $line = <STDIN>; chomp $line;
+ req_Root('root', $line) # reuse Root
+ or die "E Invalid root $line \n";
+ $line = <STDIN>; chomp $line;
+ unless ($line eq 'anonymous') {
+ print "E Only anonymous user allowed via pserver\n";
+ print "I HATE YOU\n";
+ }
+ $line = <STDIN>; chomp $line; # validate the password?
+ $line = <STDIN>; chomp $line;
+ unless ($line eq 'END AUTH REQUEST') {
+ die "E Do not understand $line -- expecting END AUTH REQUEST\n";
+ }
+ print "I LOVE YOU\n";
+ # and now back to our regular programme...
+}
+
# Keep going until the client closes the connection
while (<STDIN>)
{
@@ -165,6 +190,7 @@ sub req_Root
print "E the repo config file needs a [gitcvs] section added, and the parameter 'enabled' set to 1\n";
print "E \n";
print "error 1 GITCVS emulation disabled\n";
+ return 0;
}
if ( defined ( $cfg->{gitcvs}{logfile} ) )
@@ -173,6 +199,8 @@ sub req_Root
} else {
$log->nofile();
}
+
+ return 1;
}
# Global_option option \n
@@ -914,6 +942,12 @@ sub req_ci
$log->info("req_ci : " . ( defined($data) ? $data : "[NULL]" ));
+ if ( @ARGV && $ARGV[0] eq 'pserver')
+ {
+ print "error 1 pserver access cannot commit\n";
+ exit;
+ }
+
if ( -e $state->{CVSROOT} . "/index" )
{
print "error 1 Index already exists in git repo\n";
--
1.2.4.g09a27-dirty
^ permalink raw reply related
* Re: [PATCH] Add a Documentation/git-tools.txt
From: Marco Costalba @ 2006-03-04 6:42 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Alexandre Julliard, git
In-Reply-To: <87psl9i4as.fsf@wine.dyndns.org>
A brief survey of useful git tools, including third-party
and external projects.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
---
Documentation/git-tools.txt | 97 +++++++++++++++++++++++++++++++++++++++++++
1 files changed, 97 insertions(+), 0 deletions(-)
create mode 100644 Documentation/git-tools.txt
5e8c2ec9d08dce7f333b0963d7911c3096ab6588
diff --git a/Documentation/git-tools.txt b/Documentation/git-tools.txt
new file mode 100644
index 0000000..00e57a6
--- /dev/null
+++ b/Documentation/git-tools.txt
@@ -0,0 +1,97 @@
+A short git tools survey
+========================
+
+
+Introduction
+------------
+
+Apart from git contrib/ area there are some others third-party tools
+you may want to look.
+
+This document presents a brief summary of each tool and the corresponding
+link.
+
+
+Alternative/Augmentative Procelains
+-----------------------------------
+
+ - *Cogito* (http://www.kernel.org/pub/software/scm/cogito/)
+
+ Cogito is a version control system layered on top of the git tree history
+ storage system. It aims at seamless user interface and ease of use,
+ providing generally smoother user experience than the "raw" Core GIT
+ itself and indeed many other version control systems.
+
+
+ - *pg* (http://www.spearce.org/category/projects/scm/pg/)
+
+ pg is a shell script wrapper around GIT to help the user manage a set of
+ patches to files. pg is somewhat like quilt or StGIT, but it does have a
+ slightly different feature set.
+
+
+ - *StGit* (http://www.procode.org/stgit/)
+
+ Stacked GIT provides a quilt-like patch management functionality in the
+ GIT environment. You can easily manage your patches in the scope of GIT
+ until they get merged upstream.
+
+
+History Viewers
+---------------
+
+ - *gitk* (shipped with git-core)
+
+ gitk is a simple TK GUI for browsing history of GIT repositories easily.
+
+
+ - *gitview* (contrib/)
+
+ gitview is a GTK based repository browser for git
+
+
+ - *gitweb* (ftp://ftp.kernel.org/pub/software/scm/gitweb/)
+
+ GITweb provides full-fledged web interface for GIT repositories.
+
+
+ - *qgit* (http://digilander.libero.it/mcostalba/)
+
+ QGit is a git/StGIT GUI viewer built on Qt/C++. QGit could be used
+ to browse history and directory tree, view annotated files, commit
+ changes cherry picking single files or applying patches.
+ Currently it is the fastest and most feature rich among the git
+ viewers and commit tools.
+
+
+
+Foreign SCM interface
+---------------------
+
+ - *git-svn* (contrib/)
+
+ git-svn is a simple conduit for changesets between a single Subversion
+ branch and git.
+
+
+ - *quilt2git / git2quilt* (http://home-tj.org/wiki/index.php/Misc)
+
+ These utilities convert patch series in a quilt repository and commit
+ series in git back and forth.
+
+
+Others
+------
+
+ - *(h)gct* (http://www.cyd.liu.se/users/~freku045/gct/)
+
+ Commit Tool or (h)gct is a GUI enabled commit tool for git and
+ Mercurial (hg). It allows the user to view diffs, select which files
+ to committed (or ignored / reverted) write commit messages and
+ perform the commit itself.
+
+ - *git.el* (contrib/)
+
+ This is an Emacs interface for git. The user interface is modeled on
+ pcl-cvs. It has been developed on Emacs 21 and will probably need some
+ tweaking to work on XEmacs.
--
1.2.2.gce4c
^ permalink raw reply related
* Re: [PATCH] diff-delta: bound hash list length to avoid O(m*n) behavior
From: Linus Torvalds @ 2006-03-04 6:21 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Nicolas Pitre, git
In-Reply-To: <7vfylzx7t3.fsf@assigned-by-dhcp.cox.net>
On Fri, 3 Mar 2006, Junio C Hamano wrote:
>
> The first round. The set of objects packed were from
> today's Linus tip (everything down to epoch v2.6.12-rc2), 193309
> objects in total, on my Duron 750 with slow disks.
>
> real user sys bytes savings
> master 11m17.121s 10m23.280s 0m47.290s 109045599 N/A
> nico 25m37.058s 23m0.770s 2m20.460s 104401392 4.25%
> jc 24m12.072s 21m45.120s 2m16.400s 104409761 4.25%
Ouch.
Btw, it's often worth using /usr/bin/time instead of the bash built-in
time. Why? Because /usr/bin/time reports one absolutely _hugely_ important
number (maybe more important than almost any of the other numbers in
there).
Which one? It's the "minor pagefaults". That's a very good approximation
of memory usage overhead.
We've already had one person report that they ran out of memory when
packing. So memory usage is actually a problem.
Anyway, it looks like the 16-byte window is the way to go, even regardless
of any memory use issue.
Linus
^ permalink raw reply
* Re: On recording renames
From: Junio C Hamano @ 2006-03-04 6:16 UTC (permalink / raw)
To: git; +Cc: paul
In-Reply-To: <7vfylyx3e3.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano <junkio@cox.net> writes:
>
> a1--a2--a3--a4--a5--A
> / \
> ---O---b1--b2--b3--b4--B---*
>
> O has hello.c
> a1 renames file hello.c to world.c and a2-a5-A modifies world.c
> b1-b4-B modifies hello.c
> we are about to merge A and B
>
> comparing O and A may not notice O's hello.c and A's world.c
> are similar!
>
> But you are allowed to write a new merge strategy that is more
> careful about renames. There is no reason you can only look at
> three trees. Such a merge strategy, when given commit A and B,
> would walk the history back, running "diff-tree -M" for each
> commit along the way, and difference between O's hello.c and
> a1's world.c would be hopefully *much* smaller than O's hello.c
> and A's world.c -- even the current similarity estimator may
> recognize it is a rename.
A bit more on merges and renames. The thread that started on
Dec 16 2005 by Don Zickus is about a case that anybody
interested in renaming merge should think about. Unfortunately
gmane web interface says it is "down for maintenance" so I
cannot give an URL, but the message IDs of key messages are:
<68948ca0512161205x3d5921bfm3bfcaa64f988eb99@mail.gmail.com>
<7vbqzgbcyv.fsf@assigned-by-dhcp.cox.net>
The whole thread is worth reading, but the punch line is:
The transition happened over time with multiple commits.
You cannot record "this is the rename" by attributing that
information to one particular commit.
^ permalink raw reply
* [PATCH] tar-tree: file/dirmode fix.
From: Junio C Hamano @ 2006-03-04 5:35 UTC (permalink / raw)
To: git; +Cc: Matt McCutchen
In-Reply-To: <1141446331.3171.4.camel@mattlaptop>
This fixes two bugs introduced when we switched to generic tree
traversal code.
(1) directory mode recorded silently became 0755, not 0777
(2) if passed a tree object (not a commit), it emitted an
alarming error message (but proceeded anyway).
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
tar-tree.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
815afaf1bd0ddf419231d2d9f129260ce1ddbecc
diff --git a/tar-tree.c b/tar-tree.c
index e85a1ed..e478e13 100644
--- a/tar-tree.c
+++ b/tar-tree.c
@@ -304,9 +304,11 @@ static void write_header(const unsigned
}
if (S_ISDIR(mode))
- mode |= 0755; /* GIT doesn't store permissions of dirs */
- if (S_ISLNK(mode))
- mode |= 0777; /* ... nor of symlinks */
+ mode |= 0777;
+ else if (S_ISREG(mode))
+ mode |= (mode & 0100) ? 0777 : 0666;
+ else if (S_ISLNK(mode))
+ mode |= 0777;
sprintf(&header[100], "%07o", mode & 07777);
/* XXX: should we provide more meaningful info here? */
@@ -391,7 +393,7 @@ int main(int argc, char **argv)
usage(tar_tree_usage);
}
- commit = lookup_commit_reference(sha1);
+ commit = lookup_commit_reference_gently(sha1, 1);
if (commit) {
write_global_extended_header(commit->object.sha1);
archive_time = commit->date;
--
1.2.4.gfe04
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox