Commit Graph

4529 Commits

Author SHA1 Message Date
Junio C Hamano
aadc81c13b Merge branch 'jc/reupdate' into next
* jc/reupdate:
  update-index --again: take optional pathspecs
  update-index --again
  update-index: plug memory leak from prefix_path()
  checkout-index: plug memory leak from prefix_path()
  update-index --unresolve: work from a subdirectory.
2006-05-06 00:20:54 -07:00
Junio C Hamano
7bb0d900d7 Merge branch 'jc/bindiff' into next
* jc/bindiff:
  binary diff and apply: testsuite.
2006-05-06 00:20:45 -07:00
Junio C Hamano
42d0ee8302 binary diff and apply: testsuite.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-06 00:15:54 -07:00
Junio C Hamano
22293b9c41 update-index --again: take optional pathspecs
When pathspecs are given, update-index --again further limits
the set of paths to be updated to those that match them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 23:11:29 -07:00
Junio C Hamano
83e77a25dc update-index --again
After running 'git-update-index' for some paths, you may want to
do the update on the same set of paths again.

The new flag --again checks the paths whose index entries are
are different from the HEAD commit and updates them from the
working tree contents.

This was brought up by Carl Worth on #git.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 22:57:27 -07:00
Junio C Hamano
fb69a760cc update-index: plug memory leak from prefix_path()
prefix_path() sometimes allocates new memory and returns it, and
other times returns the incoming path argument intact.  The
callers need to be a bit careful not to leak memory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 22:53:56 -07:00
Junio C Hamano
dc46da2286 checkout-index: plug memory leak from prefix_path()
prefix_path() sometimes allocates new memory and returns it, and
other times returns the incoming path argument intact.  The
callers need to be a bit careful not to leak memory.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 22:40:45 -07:00
Junio C Hamano
09895c1fa0 update-index --unresolve: work from a subdirectory.
It completely forgot to take the prefix into account, so you
had to feed the full path even when you start from a
subdirectory, which was nonsensical.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 17:50:06 -07:00
Junio C Hamano
2749fa7771 Merge branch 'jc/bindiff' into next
* jc/bindiff:
  binary diff: further updates.
  binary patch.
  pack-object: squelch eye-candy on non-tty
  core.prefersymlinkrefs: use symlinks for .git/HEAD
  repo-config: trim white-space before comment
  Fix for config file section parsing.
  Clarify git-cherry documentation.
  Update git-unpack-objects documentation.
  Fix up docs where "--" isn't displayed correctly.
  Several trivial documentation touch ups.
  git-svn 1.0.0
  git-svn: documentation updates
  delta: stricter constness
  Makefile: do not link rev-list any specially.
  builtin-push: --all and --tags _are_ explicit refspecs
2006-05-05 15:36:04 -07:00
Junio C Hamano
0660626caf binary diff: further updates.
This updates the user interface and generated diff data format.

 * "diff --binary" is used to signal that we want an e-mailable
   binary patch.  It implies --full-index and -p.

 * "apply --allow-binary-replacement" acquired a short synonym
   "apply --binary".

 * After the "GIT binary patch\n" header line there is a token
   to record which binary patch mechanism was used, so that we
   can extend it later.  Currently there are two mechanisms
   defined: "literal" and "delta".  The former records the
   deflated postimage and the latter records the deflated delta
   from the preimage to postimage.

   For purely implementation convenience, I added the deflated
   length after these "literal/delta" tokens (otherwise the
   decoding side needs to guess and reallocate the buffer while
   inflating).  Improvement patches are very welcomed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 15:24:32 -07:00
Junio C Hamano
051308f6e9 binary patch.
This adds "binary patch" to the diff output and teaches apply
what to do with them.

On the diff generation side, traditionally, we said "Binary
files differ\n" without giving anything other than the preimage
and postimage object name on the index line.  This was good
enough for applying a patch generated from your own repository
(very useful while rebasing), because the postimage would be
available in such a case.  However, this was not useful when the
recipient of such a patch via e-mail were to apply it, even if
the preimage was available.

This patch allows the diff to generate "binary" patch when
operating under --full-index option.  The binary patch follows
the usual extended git diff headers, and looks like this:

	"GIT binary patch\n"
	<length byte><data>"\n"
	...
	"\n"

Each line is prefixed with a "length-byte", whose value is upper
or lowercase alphabet that encodes number of bytes that the data
on the line decodes to (1..52 -- 'A' means 1, 'B' means 2, ...,
'Z' means 26, 'a' means 27, ...).  <data> is 1 or more groups of
5-byte sequence, each of which encodes up to 4 bytes in base85
encoding.  Because 52 / 4 * 5 = 65 and we have the length byte,
an output line is capped to 66 characters.  The payload is the
same diff-delta as we use in the packfiles.

On the consumption side, git-apply now can decode and apply the
binary patch when --allow-binary-replacement is given, the diff
was generated with --full-index, and the receiving repository
has the preimage blob, which is the same condition as it always
required when accepting an "Binary files differ\n" patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 15:24:32 -07:00
Junio C Hamano
86118bcb46 pack-object: squelch eye-candy on non-tty
One of my post-update scripts runs a git-fetch into a separate
repository and sends the results back to me (2>&1); I end up
getting this in the mail:

    Generating pack...
    Done counting 180 objects.
    Result has 131 objects.
    Deltifying 131 objects.
       0% (0/131) done^M   1% (2/131) done^M...

This defaults not to do the progress report when not on a tty.

You could give --progress to force the progress report, but
let's not bother even documenting it nor mentioning it in the
usage string.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 15:24:12 -07:00
Junio C Hamano
a814deca8b Merge branch 'js/fmt-patch' into next
* js/fmt-patch:
  Teach fmt-patch about --keep-subject
  Teach fmt-patch about --numbered
  fmt-patch: implement -o <dir>
  fmt-patch: output file names to stdout
  Teach fmt-patch to write individual files.
2006-05-05 14:54:43 -07:00
Junio C Hamano
188a634fec Merge branch 'fix'
* fix:
  core.prefersymlinkrefs: use symlinks for .git/HEAD
  repo-config: trim white-space before comment
  Fix for config file section parsing.
2006-05-05 14:49:49 -07:00
Junio C Hamano
e388c73825 core.prefersymlinkrefs: use symlinks for .git/HEAD
When inspecting a project whose build infrastructure used to
assume that .git/HEAD is a symlink ref, core.prefersymlinkrefs
in the config file of such a project would help to bisect its
history.

Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 9f0bb90d16 commit)
2006-05-05 14:37:08 -07:00
Johannes Schindelin
7ebdba6142 repo-config: trim white-space before comment
Earlier, calling

	git-repo-config core.hello

on a .git/config like this:

	[core]
		hello = world ; a comment

would yield "world " (i.e. with a trailing space).

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from c1aee1fd8d commit)
2006-05-05 14:34:47 -07:00
sean
93ddef3e2d Fix for config file section parsing.
Currently, if the target key has a section that matches
the initial substring of another section we mistakenly
believe we've found the correct section.  To avoid this
problem, ensure that the section lengths are identical
before comparison.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:33:58 -07:00
sean
81ae43cdc4 Clarify git-cherry documentation.
Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:23:08 -07:00
sean
ae0b219c8e Update git-unpack-objects documentation.
Document that git-unpack-objects will not produce any
results when used on a pack that exists in a repository;
move it first.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:22:32 -07:00
sean
e994004f93 Fix up docs where "--" isn't displayed correctly.
A bare "--" doesn't show up in man or html pages correctly
as two individual dashes unless backslashed as \--
in the asciidoc source.  Note, no backslash is needed
inside a literal block.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:21:52 -07:00
sean
2b5f3ed316 Several trivial documentation touch ups.
Move incorrect asciidoc level 2 titles back to level 1.

  Show output of git-name-rev in man page example.

  Reword sentences that begin with a period (.) in asciidoc
  numbered lists to work around conversion to man page bug.

  Mention that git-repack now calls git-prune-packed
  when the -d option is passed to it.

  [imap] section headers in the config file example need to be
  contained in a literal block.  imap.pass is the proper config
  file variable to use, not imap.password.

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:21:18 -07:00
Eric Wong
88521450fc git-svn 1.0.0
Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:19:11 -07:00
Eric Wong
81c5a0e6e5 git-svn: documentation updates
* Clarify that 'init' requires an argument
* Remove instances of 'SVN_URL' in the manpage, it's not an
  environment variable.
* Refer to 'Additional Fetch Arguments' when documenting 'fetch'
* document --authors-file / -A option

Thanks to Pavel Roskin and Seth Falcon for bringing these issues
to my attention.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:18:41 -07:00
Johannes Schindelin
8ac80a5701 Teach fmt-patch about --keep-subject
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:11:59 -07:00
Johannes Schindelin
596524b33d Teach fmt-patch about --numbered
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:11:57 -07:00
Johannes Schindelin
2448482b3d fmt-patch: implement -o <dir>
I had to move the command line parsing around a little; setup_revisions()
could mistaken <dir> for a valid ref.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 14:11:55 -07:00
Johannes Schindelin
81f3a188a3 fmt-patch: output file names to stdout
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 13:56:01 -07:00
Johannes Schindelin
0377db77da Teach fmt-patch to write individual files.
When called with "--stdout", it still writes to standard output.

Notable differences to git-format-patch:

	- since fmt-patch uses the standardized logging machinery, it is
	  no longer "From nobody", but "From <commit_sha1>",

	- the empty lines before and after the "---" just before the
	  diffstat are no longer there,

	- git-format-patch outputs the commit_sha1 just before the first
	  diff, which fmt-patch does not,

	- the file names are no longer output to stdout, but to stderr
	  (since stdout is freopen()ed all the time), and

	- "git fmt-patch HEAD^" does not work as expected: it outputs
	  *all* commits reachable from HEAD^!

The last one is possibly a showstopper. At least I used to call that
command quite often...

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 13:55:45 -07:00
Junio C Hamano
ac4c758adc delta: stricter constness
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 02:50:11 -07:00
Junio C Hamano
fb335158d5 Makefile: do not link rev-list any specially.
We used to depend on bignum from openssl for rev-list to compute
merge-order, but there is no reason to use different build
recipe from other programs anymore.  Just build it with git-%$X
rule like everybody else.

Noticed by Alexey Dobriyan.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-04 17:38:41 -07:00
Johannes Schindelin
5edbcd8d77 builtin-push: --all and --tags _are_ explicit refspecs
... so do not get refspecs from remotes/* or the config if one of them
was specified.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-04 17:28:14 -07:00
Junio C Hamano
25a9ff836f Merge branch 'jc/cache-tree' into next
* jc/cache-tree:
  fsck-objects: do not segfault on missing tree in cache-tree
2006-05-04 00:17:28 -07:00
Junio C Hamano
f8098a3329 Merge branch 'jc/grep' into next
* jc/grep:
  builtin-grep: -L (--files-without-match).
  builtin-grep: binary files -a and -I
  builtin-grep: terminate correctly at EOF
2006-05-04 00:15:23 -07:00
Junio C Hamano
4cc0b8a41b Merge branch 'js/fetchconfig' into next
* js/fetchconfig:
  Add a conversion tool to migrate remote information into the config
  fetch, pull: ask config for remote information
  Add a few more words to the glossary.
  Added definitions for a few words:
  Alphabetize the glossary.
  sha1_to_hex() usage cleanup
2006-05-04 00:14:56 -07:00
Johannes Schindelin
a4a6e4ab32 Add a conversion tool to migrate remote information into the config
Use this tool to rewrite the .git/remotes/* files into the config.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-04 00:07:06 -07:00
Johannes Schindelin
73136b2e8a fetch, pull: ask config for remote information
Now you can say

    [remote.junio]
        url = git://git.kernel.org/pub/scm/git/git.git
        fetch = next:next

    in your .git/config.

[jc: fixed up the log message that still said "pull" ]

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-04 00:07:06 -07:00
Junio C Hamano
5892fc6504 Merge branch 'jc/logs'
* jc/logs:
  builtin-log/whatchanged/show: make them official.
2006-05-04 00:04:32 -07:00
Junio C Hamano
476d239804 Merge branch 'jc/show-branch-dense'
* jc/show-branch-dense:
  show-branch: omit uninteresting merges.
2006-05-03 23:58:35 -07:00
Junio C Hamano
df71b4f7f9 Merge branch 'jc/symref'
* jc/symref:
  core.prefersymlinkrefs: use symlinks for .git/HEAD
2006-05-03 23:54:55 -07:00
Junio C Hamano
230f544e87 Merge branch 'jc/diff'
* jc/diff:
  builtin-diff: call it "git-diff", really.
  builtin-diff.c: die() formatting type fix.
  built-in diff: assorted updates.
  built-in diff.
2006-05-03 23:54:34 -07:00
Junio C Hamano
6b16250a45 Merge branch 'js/repoconfig'
* js/repoconfig:
  repo-config: deconvolute logics
  repo-config: readability fixups.
  repo-config: support --get-regexp
2006-05-03 23:41:28 -07:00
Junio C Hamano
d820f91871 Merge branch 'jc/count'
* jc/count:
  builtin-count-objects: open packs when running -v
  builtin-count-objects: make it official.
  built-in count-objects.
2006-05-03 23:40:39 -07:00
Junio C Hamano
5dfde87156 Merge branch 'js/remoteconfig'
* js/remoteconfig:
  Revert "fetch, pull: ask config for remote information"
  fetch, pull: ask config for remote information
  builtin-push: also ask config for remote information
  builtin-push: make it official.
  Fix builtin-push to honor Push: lines in remotes file.
  builtin-push: resurrect parsing of Push: lines
  git builtin "push"
2006-05-03 23:28:09 -07:00
Junio C Hamano
dd371b49f9 Merge branch 'maint'
* maint:
  Add a few more words to the glossary.
  Added definitions for a few words:
  Alphabetize the glossary.
2006-05-03 23:00:02 -07:00
Jon Loeliger
7abd7117ec Add a few more words to the glossary.
Clean up a few entries and fix typos.

    bare repository
    cherry-picking
    hook
    topic branch

[jc: removing questionable "symbolic ref -- see 'ref'" for now.]

Signed-off-by: Jon Loeliger <jdl@jdl.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-03 22:59:30 -07:00
Jon Loeliger
9290cd58c3 Added definitions for a few words:
fast forward
    pickaxe
    refspec
    tracking branch

Wild hack allows "link:git-" prefix to reference commands too.

Signed-off-by: Jon Loeliger <jdl@jdl.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-03 22:31:50 -07:00
Jon Loeliger
aa9b1573a5 Alphabetize the glossary.
Signed-off-by: Jon Loeliger <jdl@jdl.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-03 22:31:43 -07:00
Linus Torvalds
dcb3450fd8 sha1_to_hex() usage cleanup
Somebody on the #git channel complained that the sha1_to_hex() thing uses
a static buffer which caused an error message to show the same hex output
twice instead of showing two different ones.

That's pretty easily rectified by making it uses a simple LRU of a few
buffers, which also allows some other users (that were aware of the buffer
re-use) to be written in a more straightforward manner.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-03 22:06:45 -07:00
Junio C Hamano
e23d2d6b76 builtin-grep: -L (--files-without-match).
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-03 21:46:29 -07:00
Junio C Hamano
6d60bbefdc fsck-objects: do not segfault on missing tree in cache-tree
Even if trees are missing in cache-tree, we should continue and
check the rest of the object database.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-03 21:17:45 -07:00