summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2005-12-05Documentation: shared repository management in tutorial.Libravatar Junio C Hamano2-69/+171
The branch policy script I outlined was improved and polished by Carl and posted on the list twice since then. It is a shame not to pick it up, so replace the original outline in howto/update-hook-example.txt with the latest from Carl. Also talk about setting up git-shell to allow git-push/git-fetch only SSH access to a shared repository host in the tutorial. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-05Documentation: push/receive hook references.Libravatar Junio C Hamano2-0/+9
Mention documentation pages that talk about update and post-update hooks from git-push, because a frequently asked question is "I want X to happen when I push" and people would not know to look at git-receive-pack documentation until they understand that is what runs on the other end. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-05Documentation: git-diff asciidoc table workaround.Libravatar Junio C Hamano1-8/+10
The table facility was nice in rendering HTML but was disastrous for man page. Reword the text and do not use table for now. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-05Documentation: git-mv manpage workaround.Libravatar Junio C Hamano1-2/+5
Work-around asciidoc manpage trouble that does not seem to allow more than one line in the SYNOPSIS section. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-05Documentation: talk about pathspec in bisect.Libravatar Junio C Hamano1-15/+51
Also work-around asciidoc manpage trouble that does not seem to allow more than one line in the SYNOPSIS section. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04server-info: throw away T computation as well.Libravatar Junio C Hamano1-130/+3
Again, dumb transport clients are too dumb to make use of the top objects information to make a choice among multiple packs, so computing these lines are useless for now. We could resurrect them if needed later. Also dumb transport clients presumably can do their own approximation by downloading idx files to see how relevant each pack is for their fetch. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04server-info: stop sorting packs by latest date.Libravatar Junio C Hamano1-36/+3
This does not seem to buy us much, for the same reason as the previous change. Dumb clients are still too dumb. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04server-info.c: drop unused D lines.Libravatar Junio C Hamano1-110/+10
We tried to compute pack interdependency information in $GIT_DIR/objects/info/packs, hoping that dumb transports would make use of it when choosing from multiple choice, but that has never materialized, so stop computing D lines for now. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04sha1_file.c: make sure packs in an alternate odb is named properly.Libravatar Junio C Hamano1-6/+23
We somehow ended up registering packs in alternate object directories as "dir/object//pack/pack-*", which confusd the update-server-info code very badly. Also we did not attempt to detect a mistake of listing the object directory itself as one of the alternates. This does not lead to incorrect behaviour, but is simply wasteful, so try to do so when we are trivially able to. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04git.c: remove excess output for debugging when command is too long.Libravatar Junio C Hamano1-1/+1
When the given command name was too long, we exited with a message with the number of bytes of the final command name inside parentheses, without saying what that number is. It was only meant as a debugging aid while development, so remove it. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04struct tree: remove unused field "parent"Libravatar Junio C Hamano2-2/+0
The field is not used anymore, after the recent ls-tree rewrite. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04Documentation: rebase does not use cherry-pick anymore.Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04Document the --(no-)edit switch of git-revert and git-cherry-pickLibravatar Petr Baudis3-4/+17
This switch was not documented properly. I decided not to mention the --no-edit switch in the git-cherry-pick documentation since we always default to no editing. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04show-branch: allow glob pattern to name branches to show.Libravatar Junio C Hamano2-15/+84
With this, you can say "git-show-branch topic/* master" to show all the topic branches you have under .git/refs/heads/topic/ and your master branch. Another example is "git-show-branch --list v1.0*" to show all the v1.0 tags. You can disambiguate by saying "heads/topic/*" to show only topic branches if you have tags under .git/refs/tags/topic/ as well. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04Update the git-ls-tree documentationLibravatar Petr Baudis1-14/+29
This patch aims to freshen up a bit the git-ls-tree documentation. It hints that the list of paths are in fact patterns to be matched, explains the new -t, --name-only and --name-status options, corrects the original autorship information to refer to yours sincerely, corrects several grammar mistakes, etc. Since the documentation still deserves some significant work (at least proper description of the pattern matching), I also added the stub notice. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04git.c: two fixes, gitsetenv type and off-by-one error.Libravatar Junio C Hamano1-2/+1
gitsetenv as implemented in compat/setenv.c takes two const char* and int; match that. Also fix an incorrect attempt in prepend_to_path() to NUL-terminate the string which stuffed the NUL character at one past the end of allocation, and was not needed to begin with (we copy the old_path string including the NUL which terminates it). Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04compat/setenv: do not free what we fed putenv(3).Libravatar Junio C Hamano1-2/+6
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-04Warn when send-pack does nothingLibravatar Daniel Barkalow1-0/+6
If you try to push into an empty repository with no ref arguments to git push, it doesn't do anything and doesn't say anything. This adds a warning when send-pack isn't going to push anything, so you don't assume that it silently did what you wanted. Signed-off-by: Daniel Barkalow <barkalow@iabervon.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-03[PATCH] daemon.c and path.enter_repo(): revamp path validation.Libravatar Junio C Hamano2-58/+159
The whitelist of git-daemon is checked against return value from enter_repo(), and enter_repo() used to return the value obtained from getcwd() to avoid directory aliasing issues as discussed earier (mid October 2005). Unfortunately, it did not go well as we hoped. For example, /pub on a kernel.org public machine is a symlink to its real mountpoint, and it is understandable that the administrator does not want to adjust the whitelist every time /pub needs to point at a different partition for storage allcation or whatever reasons. Being able to keep using /pub/scm as the whitelist is a desirable property. So this version of enter_repo() reports what it used to chdir() and validate, but does not use getcwd() to canonicalize the directory name. When it sees a user relative path ~user/path, it internally resolves it to try chdir() there, but it still reports ~user/path (possibly after appending .git if allowed to do so, in which case it would report ~user/path.git). What this means is that if a whitelist wants to allow a user relative path, it needs to say "~" (for all users) or list user home directories like "~alice" "~bob". And no, you cannot say /home if the advertised way to access user home directories are ~alice,~bob, etc. The whole point of this is to avoid unnecessary aliasing issues. Anyway, because of this, daemon needs to do a bit more work to guard itself. Namely, it needs to make sure that the accessor does not try to exploit its leading path match rule by inserting /../ in the middle or hanging /.. at the end. I resurrected the belts and suspender paranoia code HPA did for this purpose. This check cannot be done in the enter_repo() unconditionally, because there are valid callers of enter_repo() that want to honor /../; authorized users coming over ssh to run send-pack and fetch-pack should be allowed to do so. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-03A few more options for git-cat-fileLibravatar H. Peter Anvin2-18/+42
This adds '-e' option to git-cat-file, to test for the existence of the object. This also cleans up the option-parsing in git-cat-file slightly. [jc: HPA version had -n option which did rev-parse --verify; the real value of this patch is the option parsing cleanup.] Signed-off-by: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-03Add compat/setenv.c, use in git.c.Libravatar Jason Riedy3-9/+53
There is no setenv() in Solaris 5.8. The trivial calls to setenv() were replaced by putenv() in a much earlier patch, but setenv() was used again in git.c. This patch just adds a compat/setenv.c. The rule for building git$(X) also needs to include compat. objects and compiler flags. Those are now in makefile vars COMPAT_OBJS and COMPAT_CFLAGS. Signed-off-by: E. Jason Riedy <ejr@cs.berkeley.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-03New test case: Criss-cross mergeLibravatar Fredrik Kuivinen1-0/+92
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-03New test case: merge with directory/file conflictsLibravatar Fredrik Kuivinen1-0/+25
Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-03test-lib.sh: Add new function, test_expect_codeLibravatar Fredrik Kuivinen1-0/+13
The test is considered OK if it exits with code $1 Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-03git-merge: Exit with code 2 if no strategy was able to handle the merge.Libravatar Fredrik Kuivinen1-1/+2
This way it is possible to test in scripts if the merge was non-clean or if the strategy had other problems with the merge. Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-02documentation: git-tagLibravatar No name1-1/+21
[jc: light edit applied on top of the original] Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-02documentation: git-bisect (help HTML break man)Libravatar Junio C Hamano1-7/+7
Use the same trick Josef used to introduce line breaks for git-mv documentation for now, to help HTML rendering. This breaks manpages and we need to come up with a better solution. Noticed by linux@horizon.com (No Name). Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-02documentation: clarify read-tree --resetLibravatar No name1-4/+6
[jc: light edit applied on top of the original] Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-02git-merge documentation: conflicting merge leaves higher stages in indexLibravatar Junio C Hamano1-4/+6
This hopefully concludes the latest updates that changes the behaviour of the merge on an unsuccessful automerge. Instead of collapsing the conflicted path in the index to show HEAD, we leave it unmerged, now that diff-files can compare working tree files with higher stages. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-02merge-one-file: make sure we do not mismerge symbolic links.Libravatar Junio C Hamano1-0/+8
We ran "merge" command on O->A, O->B, A!=B case without verifying the path involved is not a symlink. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-02merge-one-file: make sure we create the merged file.Libravatar Junio C Hamano1-1/+7
The "update-index followed by checkout-index" chain served two purposes -- to collapse the index to "our" version, and make sure that file exists in the working tree. In the recent update to leave the index unmerged on conflicting path, we wanted to stop doing the former, but we still need to do the latter (we allow merging to work in an un-checked-out working tree). Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-01t3100: add ls-tree -t and -d tests.Libravatar Junio C Hamano1-0/+38
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-01merge-recursive: adjust git-ls-tree use for the latest.Libravatar Junio C Hamano1-1/+1
You need to pass -t flag if you want to see tree objects in "git-ls-tree -r" output these days. This change broke the tree structure reading code in git-merge-recursive used to detect D/F conflicts. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-01git wrapper: more careful argument stuffingLibravatar Alex Riesen1-7/+12
- Use stderr for error output - Build git_command more careful - ENOENT is good enough for check of failed exec to show usage, no access() check needed [jc: Originally from Alex Riesen with inputs from Sven Verdoolaege mixed in.] Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-01git-merge-one-file: do not worry about 'rmdir -p' not removing directory.Libravatar Junio C Hamano1-1/+1
9ae2172aed289f2706a0e88288909fa47eddd7e7 used "rmdir -p" carelessly, causing the more important "git-update-index --remove" to be skipped. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-01ls-tree: --name-onlyLibravatar Junio C Hamano1-2/+11
Fingers of some "git diff" users are trained to do --name-only which git-ls-tree unfortunately does not take. With this, cd sub/directory && git-ls-tree -r --name-only .. would show only the names not object names nor modes. I threw in another synonym --name-status only for usability, but obviously ls-tree does not do any comparison so what it does is the same as --name-only. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-01ls-tree: resurrect '-d' to mean 'show trees only'Libravatar Junio C Hamano1-0/+6
With this: git-ls-tree -d HEAD -- drivers/net/ shows only immediate subtrees of drivers/net. git-ls-tree -d -t HEAD -- drivers/net/ shows drivers, drivers/net and immediate subtrees of drivers/net. git-ls-tree -d -r HEAD -- drivers/net/ shows drivers, drivers/net and all subtrees of drivers/net (but not blobs). Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-01git-ls-tree: add "-t" option to always show the tree entriesLibravatar Linus Torvalds1-24/+41
The old (new) behaviour was that it only shows trees if the object is specified exactly, and recursive is not set. That makes sense, because there is obviously nothing else it can show for that case. However, with the new "-t" option, it will show the tree even with "-r", as it traverses down into it. NOTE! This also means that it will show all trees leading up to that tree. For example, if you do a git-ls-tree -t HEAD -- drivers/char/this/file/does/not/exist it will show the trees that lead up to the files that do not exist: [torvalds@g5 linux]$ git-ls-tree -t HEAD -- drivers/char/this/file/does/not/exist 040000 tree 9cb687b77dcd64bf82e9a73214db467c964c1266 drivers 040000 tree 298e2fadf0ff3867d1ef49936fd2c7bf6ce1eb66 drivers/char [torvalds@g5 linux]$ and note how this is true even though I didn't specify "-r": the fact that I supplied a pathspec automatically implies "enough recursion" for that particular pathspec. I think the code is cleaner and easier to understand too: the patch looks bigger, but it's really just splitting up the "should we recurse into this tree" into a function of its own. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-01Makefile: say the default target upfront.Libravatar Junio C Hamano1-0/+3
Alex Riesen wants to keep extra makefile targets in config.mak, but the file is included before any of our real targets. Having this at the beginning allows you to do so. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-12-01Documentation: describe '-f' option to git-fetch.Libravatar Junio C Hamano1-0/+5
The option description header was there without body text, confusingly getting rendered as if the description for --tags applied to the option. Noticed by Carl Baldwin. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-30Move couple of ifdefs after "include config.mk"Libravatar Timo Hirvonen1-16/+12
This makes it possible to define WITH_SEND_EMAIL etc. in config.mak. Also remove GIT_LIST_TWEAK because it isn't used anymore. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-30Merge branch 'jc/subdir'Libravatar Junio C Hamano38-20/+168
2005-11-30Merge branches 'jc/apply', 'lt/ls-tree', 'lt/bisect' and 'lt/merge'Libravatar Junio C Hamano16-320/+215
2005-11-30Do not attempt to access literal dirname "GIT_OBJECT_DIRECTORY".Libravatar Tommi Virtanen1-1/+1
Dereference the environment variable before using it. Signed-off-by: Tommi Virtanen <tv@inoi.fi> Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-30Tutorial: adjust merge example to recursive strategy.Libravatar Junio C Hamano1-8/+7
Current default, merge-recursive, gives slightly different message while working from merge-resolve which was used to prepare the illustration in the tutorial. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-30merge-recursive: match the unmerged index entry behaviour with merge-resolveLibravatar Junio C Hamano1-2/+0
This minimally changes merge-recursive to match what happens when O->A, O->B, A!=B 3-way filelevel merge leaves conflicts to the new merge-resolve behaviour. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-30diff-files: show diffs with stage0 and unmerged stage at the same time.Libravatar Junio C Hamano2-23/+5
After thinking about it more, I realized that much of the change I did on top of Linus' version does not make much sense. This commit reverts it so that it by default shows diffs with stage0 paths or stage2 paths with working tree; the unmerged stage to use can be overridden with -1/-2/-3 option (-2 is the default so essentially is a no-op). When the index file is unmerged, we are by definition in the middle of a conflicting merge, and we should show the diff with stage 2 by default. More importantly, paths without conflicts are updated in the working tree and collapsed to stage0 in the index, so showing diff with stage0 at the same time does not hurt. In normal cases, stage0 entries should be in sync with the working tree files and does not clutter the output. It even helps the user to realize that the working tree has local changes unrelated to the merge and remember to be careful not to do a "git-commit -a" after resolving the conflicts. When there is no unmerged entries, giving diff_unmerged_stage a default value of 2 does not cause any harm, because it would not be used anyway. So in all, always showing diff between stage0 paths and unmerged entries from a stage (defaulting to 2) is the right thing to do, as Linus originally did. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-30merge-one-file: leave unmerged index entries upon automerge failure.Libravatar Linus Torvalds1-5/+1
When automerge fails, we used to collapse the path to stage0 from "our" branch, to help "diff-files" users to view the half-merged state against the current HEAD. Now diff-files has been taught how to compare with unmerged stage2,leaving them unmerged is a better thing to do, especially this prevents the unresolved conflicts to be committed by mistake. Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-30diff-files: -1/-2/-3 to diff against unmerged stage.Libravatar Linus Torvalds2-8/+64
While resolving conflicted merge, it was not easy to compare the working tree file with unmerged index entries. This commit introduces new options -1/-2/-3 (with synonyms --base, --ours, and --theirs) to compare working tree files with specified stages. When none of these options are given, the command defaults to -2 if the index file is unmerged, otherwise it acts as before. [jc: majorly butchered from the version Linus originally posted.] Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-11-29git-diff: do not turn off -p/-M with any diff options.Libravatar Junio C Hamano1-2/+15
When the user gives a diff option (e.g. --cached) to "git diff", we turned off the built-in default option -p, which is usually not what user wants to see. This commit makes lack of --name-status, --name-only nor -r to add -p, and lack of -B*, -C* nor -M* to add -M to the flags given to the underlying diff. Signed-off-by: Junio C Hamano <junkio@cox.net>