Commit graph

6945 commits

Author SHA1 Message Date
Junio C Hamano 8d63d95f29 quote.c: ensure the same quoting across platforms.
We read a byte from "char *" and compared it with ' ' to decide
if it needs quoting to protect textual output.  With a platform
where char is unsigned char that would give different result.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-30 16:07:54 -08:00
Junio C Hamano 4508dde169 Revert "send-pack --keep: do not explode into loose objects on the receiving end."
This reverts commit c7740a943e.  There should
be a way to make this controllable from the receiver end.
2006-10-30 16:02:07 -08:00
Junio C Hamano 4903161fb8 Surround "#define DEBUG 0" with "#ifndef DEBUG..#endif"
Otherwise "make CFLAGS=-DDEBUG=1" is cumbersome to run.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-30 15:29:53 -08:00
Junio C Hamano ae86ad6575 git-pickaxe: tighten sanity checks.
When compiled for debugging, make sure that refcnt sanity check
code detects underflows in origin reference counting.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-30 14:27:52 -08:00
Junio C Hamano f5f75c652b git-pickaxe: refcount origin correctly in find_copy_in_parent()
This makes "git-pickaxe -C master -- revision.c" to finish with
proper refcounts for all origins.  I am reasonably happy with
it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 23:56:12 -08:00
Junio C Hamano 2c40f98439 git-pickaxe: allow -Ln,m as well as -L n,m
The command rejects -L1,10 as an invalid line range specifier
and I got frustrated enough by it, so this makes it allow both
forms of input.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 23:50:55 -08:00
Nicolas Pitre 5ca807842f missing small substitution
Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 21:10:26 -08:00
Junio C Hamano 54a4c6173e git-pickaxe: WIP to refcount origin structure.
The origin structure is allocated for each commit and path while
the code traverse down it is copied into different blame entries.
To avoid leaks, try refcounting them.

This still seems to leak, which I haven't tracked down fully yet.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 15:29:25 -08:00
Shawn Pearce b807770924 Teach git-index-pack how to keep a pack file.
To prevent a race condition between `index-pack --stdin` and
`repack -a -d` where the repack deletes the newly created pack
file before any refs are updated to reference objects contained
within it we mark the pack file as one that should be kept.  This
removes it from the list of packs that `repack -a -d` will consider
for removal.

Callers such as `receive-pack` which want to invoke `index-pack`
should use this new --keep option to prevent the newly created pack
and index file pair from being deleted before they have finished any
related ref updates.  Only after all ref updates have been finished
should the associated .keep file be removed.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 13:45:03 -08:00
Junio C Hamano 01cff2d2ca Merge early part of branch 'np/index-pack' into sp/keep-pack 2006-10-29 13:44:54 -08:00
Shawn Pearce ce8590748b Only repack active packs by skipping over kept packs.
During `git repack -a -d` only repack objects which are loose or
which reside in an active (a non-kept) pack.  This allows the user
to keep large packs as-is without continuous repacking and can be
very helpful on large repositories.  It should also help us resolve
a race condition between `git repack -a -d` and the new pack store
functionality in `git-receive-pack`.

Kept packs are those which have a corresponding .keep file in
$GIT_OBJECT_DIRECTORY/pack.  That is pack-X.pack will be kept
(not repacked and not deleted) if pack-X.keep exists in the same
directory when `git repack -a -d` starts.

Currently this feature is not documented and there is no user
interface to keep an existing pack.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 12:46:21 -08:00
Shawn Pearce d4ff6d92c3 Allow short pack names to git-pack-objects --unpacked=.
This allows us to pass just the file name of a pack rather than
the complete path when we want pack-objects to consider its
contents as though they were loose objects.  This can be helpful
if $GIT_OBJECT_DIRECTORY contains shell metacharacters which make
it cumbersome to pass complete paths safely in a shell script.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 12:46:21 -08:00
Sergey Vlasov 6dcfa306f2 git-send-email: Read the default SMTP server from the GIT config file
Make the default value for --smtp-server configurable through the
'sendemail.smtpserver' option in .git/config (or $HOME/.gitconfig).

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Acked-by: Ryan Anderson <rda@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 12:45:23 -08:00
Sergey Vlasov 9c572b21dd git-send-email: Document support for local sendmail instead of SMTP server
Fix the --smtp-server option description to match reality.

Signed-off-by: Sergey Vlasov <vsu@altlinux.ru>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 12:41:38 -08:00
Robin Rosenberg b1f33d6265 Swap the porcelain and plumbing commands in the git man page
This makes the documentation less confusing to newcomers.

Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 12:36:40 -08:00
Robin Rosenberg ce4231ffa8 Mention that pull can work locally in the synopsis
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 12:36:27 -08:00
Junio C Hamano c7740a943e send-pack --keep: do not explode into loose objects on the receiving end.
This adds "keep-pack" extension to send-pack vs receive pack protocol,
and makes the receiver invoke "index-pack --stdin --fix-thin".

With this, you can ask send-pack not to explode the result into
loose objects on the receiving end.

I've patched has_sha1_file() to re-check for added packs just
like is done in read_sha1_file() for now, but I think the static
"re-prepare" interface for packs was a mistake.  Creation of a
new pack inside a process that needs to read objects in them
back ought to be a rare event, so we are better off making the
callers (such as receive-pack that calls "index-pack --stdin
--fix-thin") explicitly call re-prepare.  That way we do not
have to penalize ordinary users of read_sha1_file() and
has_sha1_file().

We would need to fix this someday.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-29 00:49:17 -07:00
Jakub Narebski 151602df00 gitweb: Add "next" link to commitdiff view
Add a kind of "next" view in the bottom part of navigation bar for
"commitdiff" view.

For commitdiff between two commits:
  (from: _commit_)
For commitdiff for one single parent commit:
  (parent: _commit_)
For commitdiff for one merge commit
  (merge: _commit_ _commit_ ...)
For commitdiff for root (parentless) commit
  (initial)
where _link_ denotes hyperlink. SHA1 is shortened to 7 characters on
display, everything is perhaps unnecessary esc_html on display.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-28 14:26:00 -07:00
Jakub Narebski c60c56cc70 gitweb: Move git_get_last_activity subroutine earlier
This is purely cosmetic.  Having git_get_* between two parse_* subroutines
violated a good convention to group related things together.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-28 14:26:00 -07:00
Junio C Hamano 1dc5e55f2d Documentation: fix git-format-patch mark-up and link it from git.txt
Two asterisks the SYNOPSIS section were mistaken as emphasis,
and the latter backtick in "`<key>`s" were not recognized as
closing backtick.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-28 14:25:41 -07:00
Jakub Narebski ba7545adab Documentation: Update information about <format> in git-for-each-ref
Update information about value of <format> used when it is left
unspecified.  Add information about `%%` and `%xx` interpolation
(URL encoding).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-28 14:23:34 -07:00
Dennis Stosberg 367dce2a5b Bash completion support for aliases
- Add aliases to the list of available git commands.
 - Make completion work for aliased commands.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-28 13:36:39 -07:00
Junio C Hamano 5b329a5f5e t6022: ignoring untracked files by merge-recursive when they do not matter
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 17:16:40 -07:00
Junio C Hamano 65ac6e9c3f merge-recursive: adjust to loosened "working file clobbered" check
The three-way merge by git-read-tree does not complain about
presense of the file in the working tree that is involved in a
merge when the merge result needs to be determined by the
caller.  Adjust merge-recursive so that it makes sure that an
untracked file is not touched when the merge decides the path
should not be included in the final result.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 17:16:40 -07:00
Junio C Hamano 9fe0d87da3 merge-recursive: make a few functions static.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 17:16:40 -07:00
Junio C Hamano 9926ba98a4 merge-recursive: use abbreviated commit object name.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 17:16:40 -07:00
Junio C Hamano ed93b449c5 merge: loosen overcautious "working file will be lost" check.
The three-way merge complained unconditionally when a path that
does not exist in the index is involved in a merge when it
existed in the working tree.  If we are merging an old version
that had that path tracked, but the path is not tracked anymore,
and if we are merging that old version in, the result will be
that the path is not tracked.  In that case we should not
complain.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 17:16:39 -07:00
Petr Baudis 887a612fef gitweb: Fix up bogus $stylesheet declarations
This seems to be a pre-++ residual declaration and it wasn't good for
anything at all besides flooding the webserver errorlog with "omg, our in
the same scope!!" warnings.

[jc: the patch was bogus by defining the variable which defeated a
 later test that checked it with "defined", which I fixed up.]

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 17:15:41 -07:00
Nicolas Pitre b89c4e93cc index-pack: minor fixes to comment and function name
Use proper english. Be more exact in one comment.

[jc: I threw in a bit of style clean-up as well]

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 15:00:19 -07:00
Nicolas Pitre d9c20ba13d enhance clone and fetch -k experience
Now that index-pack can be streamed with a pack, it is probably a good
idea to use it directly instead of creating a temporary file and running
index-pack afterwards.  This way index-pack can abort early whenever a
corruption is encountered even if the pack has not been fully
downloaded, it can display a progress percentage as it knows how much to
expects, and it is a bit faster since the pack indexing is partially
done as data is received. Using fetch -k doesn't need to disable thin
pack generation on the remote end either.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 14:58:31 -07:00
Junio C Hamano 36889a5078 tests: merge-recursive is usable without Python
Many tests still protected themselves with $no_python; there is no need
to do so anymore.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 14:29:55 -07:00
Junio C Hamano 019298015b Merge branch 'maint'
* maint:
  gitweb: Check git base URLs before generating URL from it
  Documentation: add git in /etc/services.
  Documentation: add upload-archive service to git-daemon.
  git-cherry: document limit and add diagram
  diff-format.txt: Correct information about pathnames quoting in patch format
2006-10-27 02:16:18 -07:00
Jakub Narebski d6b7e0b98f gitweb: Check git base URLs before generating URL from it
Check if each of git base URLs in @git_base_url_list is true before
appending "/$project" to it to generate project URL.

This fixes the error that for default configuration for gitweb in
Makefile, with GITWEB_BASE_URL empty (and "++GITWEB_BASE_URL++" being
"" in gitweb.cgi), we had URL of "/$project" in the summary view.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 02:12:56 -07:00
Christian Couder f8a5da6d94 Documentation: add git in /etc/services.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 02:10:52 -07:00
Christian Couder e2b1d1ccdd Documentation: add upload-archive service to git-daemon.
This patch minimaly documents the upload-archive service,
hoping that someone with better knowledge will improve upon.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-27 02:10:41 -07:00
Rene Scharfe a8ebdb90f9 git-cherry: document limit and add diagram
This patch adds the diagram from the long usage string of git-cherry to
its documentation, and documents the third option.  I changed some of
the + to - in order to save the reader from wondering where they might
fit into the picture.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 18:53:18 -07:00
Junio C Hamano 2e6d8f181d Merge branch 'jc/reflog' into lj/refs
* jc/reflog:
  sha1_name.c: avoid compilation warnings.
  ref-log: allow ref@{count} syntax.
2006-10-26 18:48:30 -07:00
Junio C Hamano ac1a1f9927 Merge branch 'jc/combined' into maint
* jc/combined:
  combine-diff: honour --no-commit-id
  combine-diff: fix hunk_comment_line logic.
  combine-diff: a few more finishing touches.
2006-10-26 18:45:52 -07:00
Lars Hjemli 97f7a7bd0d Fix show-ref usagestring
This describes the abbreviation possibilities for git-show-ref

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 18:38:05 -07:00
Jakub Narebski fb8e23fae2 diff-format.txt: Correct information about pathnames quoting in patch format
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 18:34:18 -07:00
Rene Scharfe 2b60356da5 Make git-cherry handle root trees
This patch on top of 'next' makes built-in git-cherry handle root
commits.

It moves the static function log-tree.c::diff_root_tree() to
tree-diff.c and makes it more similar to diff_tree_sha1() by
shuffling around arguments and factoring out the call to
log_tree_diff_flush().  Consequently the name is changed to
diff_root_tree_sha1().  It is a version of diff_tree_sha1() that
compares the empty tree (= root tree) against a single 'real' tree.

This function is then used in get_patch_id() to compute patch IDs
for initial commits instead of SEGFAULTing, as the current code
does if confronted with parentless commits.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 18:31:17 -07:00
Andy Parkins 543551e53a Make filenames line up in git-status output
When all the filenames line up it's much easier to copy and paste them
somewhere else, or to remove the "modified:", "copied:", etc prefix.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 18:30:56 -07:00
Nicolas Pitre 9bee247851 mimic unpack-objects when --stdin is used with index-pack
It appears that git-unpack-objects writes the last part of the input
buffer to stdout after the pack has been parsed.  This looks a bit
suspicious since the last fill() might have filled the buffer up to
the 4096 byte limit and more data might still be pending on stdin,
but since this is about being a drop-in replacement for unpack-objects
let's simply duplicate the same behavior for now.

[jc: with fix-up appeared in Nico's sleep]

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 18:27:44 -07:00
Jakub Narebski 35f401a670 gitweb: Use --no-commit-id in git_commit and git_commitdiff
Use --no-commit-id option to git-diff-tree command in git_commit and
git_commitdiff to filter out commit ID output that git-diff-tree adds
when called with only one <tree-ish> (not only for --stdin). Remove
filtering commit IDs from git-diff-tree output.

This option is in git since at least v1.0.0, so make use of it.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 02:16:30 -07:00
Junio C Hamano af70fa4f48 Merge branch 'jc/combined'
* jc/combined:
  combine-diff: honour --no-commit-id
  combine-diff: fix hunk_comment_line logic.
2006-10-26 02:07:18 -07:00
Junio C Hamano 44152787bc combine-diff: honour --no-commit-id
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 02:05:59 -07:00
Junio C Hamano 7a8ac59f2f combine-diff: fix hunk_comment_line logic.
We forgot that the last element of sline[] is a sentinel without
the actual line.  *BLUSH*

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 02:05:05 -07:00
Junio C Hamano e893f7ad73 Merge branch 'jc/combined'
* jc/combined:
  combine-diff: a few more finishing touches.
  Documentation: clarify refname disambiguation rules.
  diff-format.txt: Combined diff format documentation supplement
  Remove --syslog in git-daemon inetd documentation examples.
  Documentation: updates to "Everyday GIT"
2006-10-26 01:18:55 -07:00
Junio C Hamano d5f6a01af0 combine-diff: a few more finishing touches.
"new file" and "deleted file" were already reported in the
original code, but the logic was not as transparent as it could
have.  This uses a few variables and more comments to clarify
the flow.  The rule is: (1) if a path exists in the merge result
when no parent had it, we report "new" (otherwise it came from
the parents, as opposed to have added by the evil merge). (2) if
the path does not exist in the merge result, it is "deleted".

Since we can say "new" and "deleted", there is no reason not to
follow the /dev/null convention.  This fixes it.

Appending function name after @@@ ... @@@ is trivial, so
implement it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 01:18:49 -07:00
Junio C Hamano 0ac3056850 Documentation: clarify refname disambiguation rules.
Nobody should create ambiguous refs (i.e. have tag "foobar" and branch
"foobar" at the same time) that need to be disambiguated with these
rules to keep sanity, but the rules are there so document them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-10-26 01:15:42 -07:00