{"thread":{"id":"6599","subject":"[ANNOUNCE] GIT 1.5.0-rc3","startedAt":"2007-02-01T00:26:36Z","lastAt":"2007-02-06T07:53:05Z","messageCount":14,"participants":["Junio C Hamano","Bill Lear","Robin Rosenberg","Jeff King","Linus Torvalds","Theodore Tso","Jakub Narebski","David Kågedal","Shawn O. Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"33196","messageId":"7v7iv2soxv.fsf@assigned-by-dhcp.cox.net","threadId":"6599","inReplyTo":null,"subject":"[ANNOUNCE] GIT 1.5.0-rc3","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-01T00:26:36Z","receivedAt":"2007-02-01T00:26:36Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"It's been a week and a half, and here comes the -rc3\n\n  http://www.kernel.org/pub/software/scm/git/\n\n  git-1.5.0-rc3.tar.{gz,bz2}\t\t\t(tarball)\n  git-htmldocs-1.5.0-rc3.tar.{gz,bz2}\t\t(preformatted docs)\n  git-manpages-1.5.0-rc3.tar.{gz,bz2}\t\t(preformatted docs)\n  testing/git-*-1.5.0-rc3-1.$arch.rpm\t\t(RPM)\n\nHopefully this will be the last -rc before the final 1.5.0.\n\nThis contains the \"git user's manual\" by J. Bruce Fields.  While\nit still has its own \"To Do\" section, it has already been in a\nvery good shape for some time, giving information with coherence\nand guiding a new user in a carefully chosen order of topics\ninto much more pleasant git experience than before.\n\n----------------------------------------------------------------\n\nChanges since v1.5.0-rc2 are as follows:\n\nAlex Riesen (5):\n  Insert ACTIVESTATE_STRING in Git.pm\n  Force Activestate Perl to tie git command pipe handle to a handle class\n  Cleanup uninitialized value in chomp\n  Allow default core.logallrefupdates to be overridden with template's config\n  Fix git-update-index to work with relative pathnames.\n\nAlexandre Julliard (1):\n  vc-git.el: Take into account the destination name in vc-checkout.\n\nAndy Parkins (5):\n  New files in git weren't being downloaded during CVS update\n  If abbrev is set to zero in git-describe, don't add the unique suffix\n  Allow the tag signing key to be specified in the config file\n  UNIX reference time of 1970-01-01 00:00 is UTC timezone, not local time zone\n  Heavily expanded update hook to send more useful emails than the old hook\n\nAneesh Kumar K.V (2):\n  blameview: Use git-cat-file to read the file content.\n  Update git-cat-file documentation\n\nBill Lear (1):\n  Document --check option to git diff.\n\nDavid Kågedal (1):\n  Improved error message from git-rebase\n\nEric Wong (1):\n  git-svn: remove leading slash when printing removed directories\n\nJ. Bruce Fields (31):\n  Documentation: add git user's manual\n  Documentation: expand preface and todo's\n  Documentation: git-rebase discussion, miscellaneous user-manual updates\n  Documentation: more user-manual todo's\n  Documentation: reorder development section, todo's\n  Documentation: begin discussion of git-remote in user manual\n  Documentation: rev-list -> rev-parse, other typos, start examples\n  user manual: answer some comments from Junio\n  user-manual: replace init-db by init\n  user-manual: reindent\n  user-manual:  rewrap, fix heading levels\n  user-manual: add \"quick start\" as chapter 1\n  user-manual: minor quickstart reorganization\n  user-manual: clarify difference between tag and branch\n  user-manual: update references discussion\n  user-manual: update git-gc discussion\n  user-manual: stub discussion of fsck and reflog\n  user-manual: reorganize fetch discussion, add internals, etc.\n  user-manual: git-fsck, dangling objects\n  user-manual: fsck-objects -> fsck\n  user-manual: repo-config -> config\n  user-manual: add references to git-config man page\n  user-manual: typo fix\n  user-manual: fix a header level\n  user-manual: reflogs, other recovery\n  user-manual: rewrap a few long lines\n  user-manual: minor \"TODO\" updates\n  user-manual: document git-show-branch example\n  user-manual: SHA1 -> object name\n  user-manual: point to README for gitweb information\n  user-manual: todo's\n\nJakub Narebski (3):\n  Documentation/config.txt: Document config file syntax better\n  t/t1300-repo-config.sh: value continued on next line\n  Documentation/config.txt: Correct info about subsection name\n\nJason Riedy (1):\n  Use inttypes.h rather than stdint.h.\n\nJeff King (4):\n  format-patch: fix bug with --stdout in a subdirectory\n  contrib/vim: update syntax for changed commit template\n  diffcore-pickaxe: fix infinite loop on zero-length needle\n  Add a sample program 'blameview' to show how to use git-blame --incremental\n\nJohannes Schindelin (2):\n  annotate: use pager\n  reflog inspection: introduce shortcut \"-g\"\n\nJohannes Sixt (1):\n  Add a missing fork() error check.\n\nJunio C Hamano (43):\n  User manual: fix typos in examples\n  Documentation/tutorial-2: Fix interesting typo in an example.\n  Revert \"prune: --grace=time\"\n  Make sure git_connect() always give two file descriptors.\n  is_repository_shallow(): prototype fix.\n  shallow repository: disable unsupported operations for now.\n  git-gc: do not run git-prune by default.\n  cvsimport: activate -a option, really.\n  .mailmap: fix screw-ups in Uwe's name\n  honor --author even with --amend, -C, and -c.\n  reflog gc: a tag that does not point at a commit is not a crime.\n  git-checkout -m: fix merge case\n  git-daemon documentation on enabling services.\n  ls-remote and clone: accept --upload-pack=<path> as well.\n  Refactor the pack header reading function out of receive-pack.c\n  Allow fetch-pack to decide keeping the fetched pack without exploding\n  fetch-pack: remove --keep-auto and make it the default.\n  Consolidate {receive,fetch}.unpackLimit\n  Allow non-developer to clone, checkout and fetch more easily.\n  parse-remote: do not barf on a remote shorthand without any refs to fetch.\n  show-branch -g: default to HEAD\n  Documentation: pack-refs --all vs default behaviour\n  Make sure we do not write bogus reflog entries.\n  git-merge: leave sensible reflog message when used as the first level UI.\n  create_symref: check error return from open().\n  write_in_full: size_t is unsigned.\n  Don't force everybody to call setup_ident().\n  git-blame --porcelain: quote filename in c-style when needed.\n  Update describe documentation.\n  Document 'git-blame --incremental'\n  git-fsck-objects is now synonym to git-fsck\n  Two small typofixes.\n  lock_any_ref_for_update(): do not accept malformatted refs.\n  git-commit -s: no extra space when sign-offs appear at the end already.\n  git-blame: somewhat better commenting.\n  git-send-email: remove debugging output.\n  Fix git-tag -u\n  Documentation: \"git-checkout <tree> <path>\" takes any tree-ish\n  t9200: Re-code non-ascii path test in UTF-8\n  t9200: do not test -x bit if the filesystem does not support it.\n  git main documentation: point at the user's manual.\n  Do not use hardcoded path to xhmtl.xsl to generate user's manual\n  GIT v1.5.0-rc3\n\nLinus Torvalds (5):\n  fsck-objects: refactor checking for connectivity\n  Fix seriously broken \"git pack-refs\"\n  Add dangling objects tips.\n  git-blame --incremental\n  git-push through git protocol\n\nMark Wooding (3):\n  wt-status: Actually accept `color.status.BLAH' configuration variables.\n  Documentation/config.txt: Fix documentation of colour config tweaks.\n  Make fsck and fsck-objects be builtins.\n\nNicolas Pitre (3):\n  fix suggested branch creation command when detaching head\n  git-log -g --pretty=oneline should display the reflog message\n  tone down the detached head warning\n\nPeter Eriksen (2):\n  sha1_file.c: Avoid multiple calls to find_pack_entry().\n  Documentation: --amend cannot be combined with -c/-C/-F.\n\nRené Scharfe (1):\n  git-blame --incremental: don't use pager\n\nSam Vilain (1):\n  contrib/emacs/vc-git.el: support vc-version-other-window\n\nSanti Béjar (1):\n  git-fetch: Allow fetching the remote HEAD\n\nShawn O. Pearce (6):\n  Remove unnecessary found variable from describe.\n  Teach git-describe to display distances from tags.\n  Compute accurate distances in git-describe before output.\n  Teach for-each-ref about a little language called Tcl.\n  Don't coredump on bad refs in update-server-info.\n  Escape --upload-pack from expr.\n\nSimon 'corecode' Schubert (1):\n  Replace perl code with pure shell code\n\nTom Prince (1):\n  Rename git-repo-config to git-config.\n\nUwe Kleine-König (2):\n  rename --exec to --upload-pack for fetch-pack and peek-remote\n  make --upload-pack option to git-fetch configurable\n"},{"id":"33252","messageId":"17858.6789.392883.685981@lisa.zopyra.com","threadId":"6599","inReplyTo":"7v7iv2soxv.fsf@assigned-by-dhcp.cox.net","subject":"Re: [ANNOUNCE] GIT 1.5.0-rc3","fromName":"Bill Lear","fromEmail":"rael@zopyra.com","sentAt":"2007-02-01T16:51:17Z","receivedAt":"2007-02-01T16:51:17Z","isPatch":false,"sender":{"key":"rael@zopyra.com","avatar":"https://gravatar.com/avatar/c4f2d2790ca3828d3b4e7dfebabf61d2fe94fd82fa49cdac2a5295dd2d46a874?d=mp&s=160"},"body":"On Wednesday, January 31, 2007 at 16:26:36 (-0800) Junio C Hamano writes:\n>It's been a week and a half, and here comes the -rc3\n>\n>  http://www.kernel.org/pub/software/scm/git/\n>\n>  git-1.5.0-rc3.tar.{gz,bz2}\t\t\t(tarball)\n>  git-htmldocs-1.5.0-rc3.tar.{gz,bz2}\t\t(preformatted docs)\n>  git-manpages-1.5.0-rc3.tar.{gz,bz2}\t\t(preformatted docs)\n>  testing/git-*-1.5.0-rc3-1.$arch.rpm\t\t(RPM)\n\nThere are no such files .*1.5.0-rc3.* on this server.  However, there\nare .*1.5.0.rc3.* files.\n\n\nBill\n"},{"id":"33275","messageId":"200702012134.40933.robin.rosenberg.lists@dewire.com","threadId":"6599","inReplyTo":"7v7iv2soxv.fsf@assigned-by-dhcp.cox.net","subject":"Re: [ANNOUNCE] GIT 1.5.0-rc3","fromName":"Robin Rosenberg","fromEmail":"robin.rosenberg.lists@dewire.com","sentAt":"2007-02-01T20:34:40Z","receivedAt":"2007-02-01T20:34:40Z","isPatch":false,"sender":{"key":"robin.rosenberg@dewire.com","avatar":"https://avatars.githubusercontent.com/u/46357?v=4"},"body":"torsdag 01 februari 2007 01:26 skrev Junio C Hamano:\n> Junio C Hamano (43):\n>   t9200: Re-code non-ascii path test in UTF-8\n\nI sent a patch that converts to \"visible\" characters when looked\nat with iso-8859-1/windows-1252 googles. It also tests the file system before \nexecuting the test. \n\n>   t9200: do not test -x bit if the filesystem does not support it.\n\nThe description is misleading. Git on cygwin chooses to ignore the executable \nflag by default, not because the filesystem won't handle it, but rather that \nenough many *other* applications sets it needlessly, that ignoring it becomes \nless problematic than honouring it.\n\nAdding \"git config core.filemode true\" at the start of this test verifiies \nthat it works on NTFS too. \n\n-- robin\n"},{"id":"33553","messageId":"7vps8qtgbm.fsf@assigned-by-dhcp.cox.net","threadId":"6599","inReplyTo":"7v7iv2soxv.fsf@assigned-by-dhcp.cox.net","subject":"What's in git.git (stable)","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-04T09:36:29Z","receivedAt":"2007-02-04T09:36:29Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Thanks everybody for helping to tie the loose ends for the next\nrelease.\n\nThanks to Nico's handful updates, I think his \"reflog on HEAD\nitself\" series is ready for inclusion, although tonight's update\nstill has it parked in 'next' (I did try out 'next' with his\nlatest for a couple of hours today).  I've already updated the\ndraft release notes for 1.5.0 (v1.5.0.txt in todo branch), with\nits inclusion in mind.\n\nI've re-read the three tutorials and tried to fix them up\nsomewhat to match the recent reality.  I'd appreciate somebody\ncan look at JBF's user manual.\n\nSeveral things to note (in the following, substitute $gmane with\nhttp://article.gmane.org/gmane.comp.version-control.git):\n\n - Working around Tk geometry problem, especially on non Linux+X\n   platforms.  I've forwarded Mark Levedahl's patches\n   ($gmane/38361) to Paul Mackerras for his blessing; hopefully\n   he can Ack and/or suggest improvements.  I'd really like to\n   have them in 1.5.0 in some form.\n\n - Nico's \"reflog on HEAD\".  I'll merge this tomorrow (I just\n   ran out of time today).  I will re-try to break its \"git\n   reflog expire --stale-fix --all\" before actually merging it,\n   though.\n\n - Reverting the patch to allow tracking branch names as the\n   value of branch.*.merge ($gmane/38621).  I think it is a good\n   idea to revert this before 1.5.0 gets out; just haven't got\n   around to do so.\n\n - Teaching \"git blame\" to also use the working tree files\n   and/or index.  I actually think defaulting to working tree\n   when an explicit HEAD is not given (and --cached to use the\n   one in the index) makes a lot of sense, but I haven't got\n   around to code the latter yet.  Not defaulting to HEAD\n   changes semantics, so if we ever are going to do it, I think\n   we should do so before 1.5.0.\n\n - Preventing push from updating the current branch of non-bare\n   repository.  I think doing so unconditionally is a bad idea\n   (and I have Linus's veto to back it up $gmane/38592), but I\n   suspect most people would want the default to be less\n   confusing to new people.  If we are ever going to forbid by\n   default and allow pusher to force, that would be a behaviour\n   change and it would be better to do so before 1.5.0.\n\n - We might want to allow git-push to use the wildcard refspec,\n   like git-fetch does, for symmetry.  It would make the\n   mothership-satellite arrangement much more natural\n   ($gname/38549).  Unfortunately I haven't had a chance to\n   start coding it.  I think however this could be added post\n   1.5.0.\n\n - \"git remote add -t -f -m\" and rewrite of \"git clone\" based on\n   it ($gmane/38470, $gmane/38545).  While I think this leads us\n   in right direction, I do not think 1.5.0 needs to wait for\n   it.  Certainly I do not want to reimplement \"git clone\"\n   before 1.5.0, although I think the additions to \"git remote add\"\n   are relatively safe.\n\n - Catering to filesystems whose readdir() returns pathnames\n   that are different from what are used when they were creat()ed\n   will not happen ($gmane/38620).\n\n\n* The 'master' branch has these since v1.5.0-rc3.\n\n Andy Parkins (1):\n  doc: hooks.txt said post-commit default sends an email, it doesn't\n\n Eric Wong (2):\n  git-svn: do not let Git.pm warn if we prematurely close pipes\n  Disallow invalid --pretty= abbreviations\n\n Johannes Schindelin (2):\n  Teach the '@{...}' notation to git-log -g\n  Update the documentation for the new '@{...}' syntax\n\n Junio C Hamano (9):\n  detached HEAD -- finishing touches\n  Use \"git checkout -q\" in git-bisect\n  Tutorial: fix asciidoc formatting of \"git add\" section.\n  Tutorial-2: Adjust git-status output to recent reality.\n  core-tutorial: http reference link fix\n  fix reflog entries for \"git-branch\"\n  honor GIT_REFLOG_ACTION in git-commit\n  Why is it bad to rewind a branch that has already been pushed out?\n  combine-diff: special case --unified=0\n\n Mike Coleman (1):\n  Fix some documentation typos and grammar\n\n Nicolas Pitre (4):\n  reword the detached head message a little again\n  add a quiet option to git-checkout\n  prevent HEAD reflog to be interpreted as current branch reflog\n  provide a nice @{...} syntax to always mean the current branch reflog\n\n Pavel Roskin (2):\n  git-config --rename-section could rename wrong section\n  Assorted typo fixes\n\n Shawn O. Pearce (18):\n  Pull out remote listing functions in git-remote.\n  Teach 'git remote' how to cleanup stale tracking branches.\n  Cleanup prepare_packed_git_one to reuse install_packed_git.\n  Correct comment in prepare_packed_git_one.\n  Refactor open_packed_git to return an error code.\n  Don't find objects in packs which aren't available anymore.\n  Don't leak file descriptors from unavailable pack files.\n  Cleanup subcommand documentation for git-remote.\n  Keep untracked files not involved in a merge.\n  Default GIT_MERGE_VERBOSITY to 5 during tests.\n  bash: Remove short option completions for branch/checkout/diff.\n  bash: Classify cat-file and reflog as plumbing.\n  bash: Complete long options to git-add.\n  bash: Add space after unique command name is completed.\n  bash: Classify more commends out of completion.\n  bash: Support unique completion on git-config.\n  bash: Support unique completion when possible.\n  bash: Support internal revlist options better.\n"},{"id":"33580","messageId":"20070204185144.GB24368@coredump.intra.peff.net","threadId":"6599","inReplyTo":"7vps8qtgbm.fsf@assigned-by-dhcp.cox.net","subject":"Re: What's in git.git (stable)","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2007-02-04T18:51:45Z","receivedAt":"2007-02-04T18:51:45Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Feb 04, 2007 at 01:36:29AM -0800, Junio C Hamano wrote:\n\n>  - Teaching \"git blame\" to also use the working tree files\n>    and/or index.  I actually think defaulting to working tree\n>    when an explicit HEAD is not given (and --cached to use the\n>    one in the index) makes a lot of sense, but I haven't got\n>    around to code the latter yet.  Not defaulting to HEAD\n>    changes semantics, so if we ever are going to do it, I think\n>    we should do so before 1.5.0.\n\nJust a thought, but it might be useful to blame the contents of an\narbitrary file (but starting the history at a given pathname). Something\nlike \"git blame --contents /tmp/foo.c file.c\", with contents defaulting\nto \"file.c\". There's much discussion of editor interfaces, and this\nleaves the possibility of git-blaming the contents of the editor buffer\n(after writing it out to a temp file) without having to save changes to\nthe working tree file.\n\nAdmittedly, I think this will be rare, but if you git-blame from an\neditor, it seems awkward to either be inaccurate (by blaming the last\nsaved working tree file, but comparing it to the buffer) or to save the\nfile as a side effect.\n\n-Peff\n"},{"id":"33582","messageId":"Pine.LNX.4.64.0702041111010.8424@woody.linux-foundation.org","threadId":"6599","inReplyTo":"20070204185144.GB24368@coredump.intra.peff.net","subject":"Re: What's in git.git (stable)","fromName":"Linus Torvalds","fromEmail":"torvalds@linux-foundation.org","sentAt":"2007-02-04T19:12:34Z","receivedAt":"2007-02-04T19:12:34Z","isPatch":false,"sender":{"key":"torvalds@linux-foundation.org","avatar":"https://avatars.githubusercontent.com/u/1024025?v=4"},"body":"\n\nOn Sun, 4 Feb 2007, Jeff King wrote:\n> \n> Just a thought, but it might be useful to blame the contents of an\n> arbitrary file (but starting the history at a given pathname). Something\n> like \"git blame --contents /tmp/foo.c file.c\", with contents defaulting\n> to \"file.c\". There's much discussion of editor interfaces, and this\n> leaves the possibility of git-blaming the contents of the editor buffer\n> (after writing it out to a temp file) without having to save changes to\n> the working tree file.\n\nI agree, that probably would make most sense. If we do this at all. On the \nother hand, I suspect that most editors would probably want to pipe the \ncontents to the program, not write it to a temp-file.\n\n(I think it's a worthy feature, but Junio's patch wasn't exactly pretty, \nso the question boils down to whether it's really worth it).\n\n\t\tLinus\n"},{"id":"33590","messageId":"20070204205858.GE12943@thunk.org","threadId":"6599","inReplyTo":"Pine.LNX.4.64.0702041111010.8424@woody.linux-foundation.org","subject":"Re: What's in git.git (stable)","fromName":"Theodore Tso","fromEmail":"tytso@mit.edu","sentAt":"2007-02-04T20:58:58Z","receivedAt":"2007-02-04T20:58:58Z","isPatch":false,"sender":{"key":"tytso@mit.edu","avatar":"https://avatars.githubusercontent.com/u/51416?v=4"},"body":"On Sun, Feb 04, 2007 at 11:12:34AM -0800, Linus Torvalds wrote:\n> \n> \n> On Sun, 4 Feb 2007, Jeff King wrote:\n> > \n> > Just a thought, but it might be useful to blame the contents of an\n> > arbitrary file (but starting the history at a given pathname). Something\n> > like \"git blame --contents /tmp/foo.c file.c\", with contents defaulting\n> > to \"file.c\". There's much discussion of editor interfaces, and this\n> > leaves the possibility of git-blaming the contents of the editor buffer\n> > (after writing it out to a temp file) without having to save changes to\n> > the working tree file.\n> \n> I agree, that probably would make most sense. If we do this at all. On the \n> other hand, I suspect that most editors would probably want to pipe the \n> contents to the program, not write it to a temp-file.\n\n... and use it with --incremental, as well.  In emacs you can have the\nannotation take place as it is being written out relatively easily, by\narranging to have a callback function get called each time more\ninformation is handed back to emacs via a pipe.\n\n\t\t\t\t\t\t- Ted\n"},{"id":"33591","messageId":"eq5jdt$173$1@sea.gmane.org","threadId":"6599","inReplyTo":"20070204205858.GE12943@thunk.org","subject":"Re: What's in git.git (stable)","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-02-04T21:34:13Z","receivedAt":"2007-02-04T21:34:13Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Theodore Tso wrote:\n> On Sun, Feb 04, 2007 at 11:12:34AM -0800, Linus Torvalds wrote:\n>> On Sun, 4 Feb 2007, Jeff King wrote:\n>>> \n>>> Just a thought, but it might be useful to blame the contents of an\n>>> arbitrary file (but starting the history at a given pathname). Something\n>>> like \"git blame --contents /tmp/foo.c file.c\", with contents defaulting\n>>> to \"file.c\". There's much discussion of editor interfaces, and this\n>>> leaves the possibility of git-blaming the contents of the editor buffer\n>>> (after writing it out to a temp file) without having to save changes to\n>>> the working tree file.\n>> \n>> I agree, that probably would make most sense. If we do this at all. On the \n>> other hand, I suspect that most editors would probably want to pipe the \n>> contents to the program, not write it to a temp-file.\n> \n> ... and use it with --incremental, as well.  In emacs you can have the\n> annotation take place as it is being written out relatively easily, by\n> arranging to have a callback function get called each time more\n> information is handed back to emacs via a pipe.\n\nSo perhaps instead of \"git blame --contents /tmp/foo.c file.c\" we should\nhave \"cat /tmp/foo.c | git blame --stdin file.c\", hmmm? Editor would then\npipe current contents of the buffer to \"git blame --stdin --incremental\nfile.c\" (where file.c is the name in tree/in HEAD).\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"33592","messageId":"87bqk9ftm5.fsf@morpheus.local","threadId":"6599","inReplyTo":"eq5jdt$173$1@sea.gmane.org","subject":"Re: What's in git.git (stable)","fromName":"David Kågedal","fromEmail":"davidk@lysator.liu.se","sentAt":"2007-02-04T22:25:22Z","receivedAt":"2007-02-04T22:25:22Z","isPatch":false,"sender":{"key":"davidk@lysator.liu.se","avatar":"https://avatars.githubusercontent.com/u/60530?v=4"},"body":"Jakub Narebski <jnareb@gmail.com> writes:\n\n> Theodore Tso wrote:\n>> On Sun, Feb 04, 2007 at 11:12:34AM -0800, Linus Torvalds wrote:\n>>> On Sun, 4 Feb 2007, Jeff King wrote:\n>>>> \n>>>> Just a thought, but it might be useful to blame the contents of an\n>>>> arbitrary file (but starting the history at a given pathname). Something\n>>>> like \"git blame --contents /tmp/foo.c file.c\", with contents defaulting\n>>>> to \"file.c\". There's much discussion of editor interfaces, and this\n>>>> leaves the possibility of git-blaming the contents of the editor buffer\n>>>> (after writing it out to a temp file) without having to save changes to\n>>>> the working tree file.\n>>> \n>>> I agree, that probably would make most sense. If we do this at all. On the \n>>> other hand, I suspect that most editors would probably want to pipe the \n>>> contents to the program, not write it to a temp-file.\n>> \n>> ... and use it with --incremental, as well.  In emacs you can have the\n>> annotation take place as it is being written out relatively easily, by\n>> arranging to have a callback function get called each time more\n>> information is handed back to emacs via a pipe.\n>\n> So perhaps instead of \"git blame --contents /tmp/foo.c file.c\" we should\n> have \"cat /tmp/foo.c | git blame --stdin file.c\", hmmm? Editor would then\n> pipe current contents of the buffer to \"git blame --stdin --incremental\n> file.c\" (where file.c is the name in tree/in HEAD).\n\nBut if we allow the standard convention of using - to mean stdin, the\n--contents option would be more flexible, since \"--contents -\" would\njust be a special case.\n\n-- \nDavid Kågedal\n"},{"id":"33602","messageId":"7vtzy1pauf.fsf_-_@assigned-by-dhcp.cox.net","threadId":"6599","inReplyTo":"20070204205858.GE12943@thunk.org","subject":"[PATCH 1/2] Rename get_ident() to fmt_ident() and make it available to outside","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-05T03:00:40Z","receivedAt":"2007-02-05T03:00:40Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This makes the functionality of ident.c::get_ident() available to\nother callers.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n * This by itself is totally uninteresting, but the second one\n   depends on it.\n\n cache.h |    1 +\n ident.c |    8 ++++----\n 2 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/cache.h b/cache.h\nindex 201704b..38a9bc0 100644\n--- a/cache.h\n+++ b/cache.h\n@@ -321,6 +321,7 @@ unsigned long approxidate(const char *);\n \n extern const char *git_author_info(int);\n extern const char *git_committer_info(int);\n+extern const char *fmt_ident(const char *name, const char *email, const char *date_str, int);\n \n struct checkout {\n \tconst char *base_dir;\ndiff --git a/ident.c b/ident.c\nindex a6fc7b5..bb03bdd 100644\n--- a/ident.c\n+++ b/ident.c\n@@ -185,8 +185,8 @@ static const char *env_hint =\n \"Add --global to set your account\\'s default\\n\"\n \"\\n\";\n \n-static const char *get_ident(const char *name, const char *email,\n-\t\t\t     const char *date_str, int error_on_no_name)\n+const char *fmt_ident(const char *name, const char *email,\n+\t\t      const char *date_str, int error_on_no_name)\n {\n \tstatic char buffer[1000];\n \tchar date[50];\n@@ -233,7 +233,7 @@ static const char *get_ident(const char *name, const char *email,\n \n const char *git_author_info(int error_on_no_name)\n {\n-\treturn get_ident(getenv(\"GIT_AUTHOR_NAME\"),\n+\treturn fmt_ident(getenv(\"GIT_AUTHOR_NAME\"),\n \t\t\t getenv(\"GIT_AUTHOR_EMAIL\"),\n \t\t\t getenv(\"GIT_AUTHOR_DATE\"),\n \t\t\t error_on_no_name);\n@@ -241,7 +241,7 @@ const char *git_author_info(int error_on_no_name)\n \n const char *git_committer_info(int error_on_no_name)\n {\n-\treturn get_ident(getenv(\"GIT_COMMITTER_NAME\"),\n+\treturn fmt_ident(getenv(\"GIT_COMMITTER_NAME\"),\n \t\t\t getenv(\"GIT_COMMITTER_EMAIL\"),\n \t\t\t getenv(\"GIT_COMMITTER_DATE\"),\n \t\t\t error_on_no_name);\n-- \n1.5.0.rc3.40.g1f7d\n"},{"id":"33603","messageId":"7vsldlpaua.fsf_-_@assigned-by-dhcp.cox.net","threadId":"6599","inReplyTo":"20070204205858.GE12943@thunk.org","subject":"[PATCH 2/2] git-blame: no rev means start from the working tree file.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-05T03:00:45Z","receivedAt":"2007-02-05T03:00:45Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Warning: this changes the semantics.\n\nThis makes \"git blame\" without any positive rev to start digging\nfrom the working tree copy, which is made into a fake commit\nwhose sole parent is the HEAD.\n\nIt also adds --contents <file> option to pretend as if the\nworking tree copy has the contents of the named file.  You can\nuse '-' to make the command read from the standard input.\n\nIf you want the command to start annotating from the HEAD\ncommit, you need to explicitly give HEAD parameter.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n\n Theodore Tso <tytso@mit.edu> writes:\n\n > On Sun, Feb 04, 2007 at 11:12:34AM -0800, Linus Torvalds wrote:\n >> \n >> On Sun, 4 Feb 2007, Jeff King wrote:\n >> > \n >> > Just a thought, but it might be useful to blame the contents of an\n >> > arbitrary file (but starting the history at a given pathname). Something\n >> > like \"git blame --contents /tmp/foo.c file.c\", with contents defaulting\n >> > to \"file.c\". There's much discussion of editor interfaces, and this\n >> > leaves the possibility of git-blaming the contents of the editor buffer\n >> > (after writing it out to a temp file) without having to save changes to\n >> > the working tree file.\n >> \n >> I agree, that probably would make most sense. If we do this at all. On the \n >> other hand, I suspect that most editors would probably want to pipe the \n >> contents to the program, not write it to a temp-file.\n >\n > ... and use it with --incremental, as well.  In emacs you can have the\n > annotation take place as it is being written out relatively easily, by\n > arranging to have a callback function get called each time more\n > information is handed back to emacs via a pipe.\n\n * By popular request, this is the second round of the patch.\n   I've splitted out a small change to make ident.c::get_ident()\n   available to this one into a separate commit, which this\n   patch depends on.\n\n builtin-blame.c |  209 ++++++++++++++++++++++++++++++++++++++++++++++++-------\n diff-lib.c      |   44 +++++++++++-\n diff.h          |    1 +\n 3 files changed, 228 insertions(+), 26 deletions(-)\n\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex 1c21204..897323a 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -15,9 +15,10 @@\n #include \"revision.h\"\n #include \"quote.h\"\n #include \"xdiff-interface.h\"\n+#include \"cache-tree.h\"\n \n static char blame_usage[] =\n-\"git-blame [-c] [-l] [-t] [-f] [-n] [-p] [-L n,m] [-S <revs-file>] [-M] [-C] [-C] [commit] [--] file\\n\"\n+\"git-blame [-c] [-l] [-t] [-f] [-n] [-p] [-L n,m] [-S <revs-file>] [-M] [-C] [-C] [--contents <filename>] [commit] [--] file\\n\"\n \"  -c, --compatibility Use the same output mode as git-annotate (Default: off)\\n\"\n \"  -b                  Show blank SHA-1 for boundary commits (Default: off)\\n\"\n \"  -l, --long          Show long commit SHA1 (Default: off)\\n\"\n@@ -29,6 +30,7 @@ static char blame_usage[] =\n \"  -L n,m              Process only line range n,m, counting from 1\\n\"\n \"  -M, -C              Find line movements within and across files\\n\"\n \"  --incremental       Show blame entries as we find them, incrementally\\n\"\n+\"  --contents file     Use <file>'s contents as the final image\\n\"\n \"  -S revs-file        Use revisions from revs-file instead of calling git-rev-list\\n\";\n \n static int longest_file;\n@@ -333,9 +335,13 @@ static struct origin *find_origin(struct scoreboard *sb,\n \tdiff_tree_setup_paths(paths, &diff_opts);\n \tif (diff_setup_done(&diff_opts) < 0)\n \t\tdie(\"diff-setup\");\n-\tdiff_tree_sha1(parent->tree->object.sha1,\n-\t\t       origin->commit->tree->object.sha1,\n-\t\t       \"\", &diff_opts);\n+\n+\tif (is_null_sha1(origin->commit->object.sha1))\n+\t\tdo_diff_cache(parent->tree->object.sha1, &diff_opts);\n+\telse\n+\t\tdiff_tree_sha1(parent->tree->object.sha1,\n+\t\t\t       origin->commit->tree->object.sha1,\n+\t\t\t       \"\", &diff_opts);\n \tdiffcore_std(&diff_opts);\n \n \t/* It is either one entry that says \"modified\", or \"created\",\n@@ -402,9 +408,13 @@ static struct origin *find_rename(struct scoreboard *sb,\n \tdiff_tree_setup_paths(paths, &diff_opts);\n \tif (diff_setup_done(&diff_opts) < 0)\n \t\tdie(\"diff-setup\");\n-\tdiff_tree_sha1(parent->tree->object.sha1,\n-\t\t       origin->commit->tree->object.sha1,\n-\t\t       \"\", &diff_opts);\n+\n+\tif (is_null_sha1(origin->commit->object.sha1))\n+\t\tdo_diff_cache(parent->tree->object.sha1, &diff_opts);\n+\telse\n+\t\tdiff_tree_sha1(parent->tree->object.sha1,\n+\t\t\t       origin->commit->tree->object.sha1,\n+\t\t\t       \"\", &diff_opts);\n \tdiffcore_std(&diff_opts);\n \n \tfor (i = 0; i < diff_queued_diff.nr; i++) {\n@@ -1047,9 +1057,12 @@ static int find_copy_in_parent(struct scoreboard *sb,\n \t    (!porigin || strcmp(target->path, porigin->path)))\n \t\tdiff_opts.find_copies_harder = 1;\n \n-\tdiff_tree_sha1(parent->tree->object.sha1,\n-\t\t       target->commit->tree->object.sha1,\n-\t\t       \"\", &diff_opts);\n+\tif (is_null_sha1(target->commit->object.sha1))\n+\t\tdo_diff_cache(parent->tree->object.sha1, &diff_opts);\n+\telse\n+\t\tdiff_tree_sha1(parent->tree->object.sha1,\n+\t\t\t       target->commit->tree->object.sha1,\n+\t\t\t       \"\", &diff_opts);\n \n \tif (!diff_opts.find_copies_harder)\n \t\tdiffcore_std(&diff_opts);\n@@ -1336,9 +1349,9 @@ static void get_commit_info(struct commit *commit,\n \ttmp += 2;\n \tendp = strchr(tmp, '\\n');\n \tif (!endp)\n-\t\tgoto error_out;\n+\t\tendp = tmp + strlen(tmp);\n \tlen = endp - tmp;\n-\tif (len >= sizeof(summary_buf))\n+\tif (len >= sizeof(summary_buf) || len == 0)\n \t\tgoto error_out;\n \tmemcpy(summary_buf, tmp, len);\n \tsummary_buf[len] = 0;\n@@ -1910,6 +1923,137 @@ static int git_blame_config(const char *var, const char *value)\n \treturn git_default_config(var, value);\n }\n \n+static struct commit *fake_working_tree_commit(const char *path, const char *contents_from)\n+{\n+\tstruct commit *commit;\n+\tstruct origin *origin;\n+\tunsigned char head_sha1[20];\n+\tchar *buf;\n+\tconst char *ident;\n+\tint fd;\n+\ttime_t now;\n+\tunsigned long fin_size;\n+\tint size, len;\n+\tstruct cache_entry *ce;\n+\tunsigned mode;\n+\n+\tif (get_sha1(\"HEAD\", head_sha1))\n+\t\tdie(\"No such ref: HEAD\");\n+\n+\ttime(&now);\n+\tcommit = xcalloc(1, sizeof(*commit));\n+\tcommit->parents = xcalloc(1, sizeof(*commit->parents));\n+\tcommit->parents->item = lookup_commit_reference(head_sha1);\n+\tcommit->object.parsed = 1;\n+\tcommit->date = now;\n+\tcommit->object.type = OBJ_COMMIT;\n+\n+\torigin = make_origin(commit, path);\n+\n+\tif (!contents_from || strcmp(\"-\", contents_from)) {\n+\t\tstruct stat st;\n+\t\tconst char *read_from;\n+\n+\t\tif (contents_from) {\n+\t\t\tif (stat(contents_from, &st) < 0)\n+\t\t\t\tdie(\"Cannot stat %s\", contents_from);\n+\t\t\tread_from = contents_from;\n+\t\t}\n+\t\telse {\n+\t\t\tif (lstat(path, &st) < 0)\n+\t\t\t\tdie(\"Cannot lstat %s\", path);\n+\t\t\tread_from = path;\n+\t\t}\n+\t\tfin_size = st.st_size;\n+\t\tbuf = xmalloc(fin_size+1);\n+\t\tmode = canon_mode(st.st_mode);\n+\t\tswitch (st.st_mode & S_IFMT) {\n+\t\tcase S_IFREG:\n+\t\t\tfd = open(read_from, O_RDONLY);\n+\t\t\tif (fd < 0)\n+\t\t\t\tdie(\"cannot open %s\", read_from);\n+\t\t\tif (read_in_full(fd, buf, fin_size) != fin_size)\n+\t\t\t\tdie(\"cannot read %s\", read_from);\n+\t\t\tbreak;\n+\t\tcase S_IFLNK:\n+\t\t\tif (readlink(read_from, buf, fin_size+1) != fin_size)\n+\t\t\t\tdie(\"cannot readlink %s\", read_from);\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tdie(\"unsupported file type %s\", read_from);\n+\t\t}\n+\t}\n+\telse {\n+\t\t/* Reading from stdin */\n+\t\tcontents_from = \"standard input\";\n+\t\tbuf = NULL;\n+\t\tfin_size = 0;\n+\t\tmode = 0;\n+\t\twhile (1) {\n+\t\t\tssize_t cnt = 8192;\n+\t\t\tbuf = xrealloc(buf, fin_size + cnt);\n+\t\t\tcnt = xread(0, buf + fin_size, cnt);\n+\t\t\tif (cnt < 0)\n+\t\t\t\tdie(\"read error %s from stdin\",\n+\t\t\t\t    strerror(errno));\n+\t\t\tif (!cnt)\n+\t\t\t\tbreak;\n+\t\t\tfin_size += cnt;\n+\t\t}\n+\t\tbuf = xrealloc(buf, fin_size + 1);\n+\t}\n+\tbuf[fin_size] = 0;\n+\torigin->file.ptr = buf;\n+\torigin->file.size = fin_size;\n+\twrite_sha1_file(buf, fin_size, blob_type, origin->blob_sha1);\n+\tcommit->util = origin;\n+\n+\t/*\n+\t * Read the current index, replace the path entry with\n+\t * origin->blob_sha1 without mucking with its mode or type\n+\t * bits; we are not going to write this index out -- we just\n+\t * want to run \"diff-index --cached\".\n+\t */\n+\tdiscard_cache();\n+\tread_cache();\n+\n+\tlen = strlen(path);\n+\tif (!mode) {\n+\t\tint pos = cache_name_pos(path, len);\n+\t\tif (0 <= pos)\n+\t\t\tmode = ntohl(active_cache[pos]->ce_mode);\n+\t\telse\n+\t\t\t/* Let's not bother reading from HEAD tree */\n+\t\t\tmode = S_IFREG | 0644;\n+\t}\n+\tsize = cache_entry_size(len);\n+\tce = xcalloc(1, size);\n+\thashcpy(ce->sha1, origin->blob_sha1);\n+\tmemcpy(ce->name, path, len);\n+\tce->ce_flags = create_ce_flags(len, 0);\n+\tce->ce_mode = create_ce_mode(mode);\n+\tadd_cache_entry(ce, ADD_CACHE_OK_TO_ADD|ADD_CACHE_OK_TO_REPLACE);\n+\n+\t/*\n+\t * We are not going to write this out, so this does not matter\n+\t * right now, but someday we might optimize diff-index --cached\n+\t * with cache-tree information.\n+\t */\n+\tcache_tree_invalidate_path(active_cache_tree, path);\n+\n+\tcommit->buffer = xmalloc(400);\n+\tident = fmt_ident(\"Not Committed Yet\", \"not.committed.yet\", NULL, 0);\n+\tsprintf(commit->buffer,\n+\t\t\"tree 0000000000000000000000000000000000000000\\n\"\n+\t\t\"parent %s\\n\"\n+\t\t\"author %s\\n\"\n+\t\t\"committer %s\\n\\n\"\n+\t\t\"Version of %s from %s\\n\",\n+\t\tsha1_to_hex(head_sha1),\n+\t\tident, ident, path, contents_from ? contents_from : path);\n+\treturn commit;\n+}\n+\n int cmd_blame(int argc, const char **argv, const char *prefix)\n {\n \tstruct rev_info revs;\n@@ -1924,6 +2068,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \tconst char *final_commit_name = NULL;\n \tchar type[10];\n \tconst char *bottomtop = NULL;\n+\tconst char *contents_from = NULL;\n \n \tgit_config(git_blame_config);\n \tsave_commit_buffer = 0;\n@@ -1968,6 +2113,11 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t\t\t\tdie(\"More than one '-L n,m' option given\");\n \t\t\tbottomtop = arg;\n \t\t}\n+\t\telse if (!strcmp(\"--contents\", arg)) {\n+\t\t\tif (++i >= argc)\n+\t\t\t\tusage(blame_usage);\n+\t\t\tcontents_from = argv[i];\n+\t\t}\n \t\telse if (!strcmp(\"--incremental\", arg))\n \t\t\tincremental = 1;\n \t\telse if (!strcmp(\"--score-debug\", arg))\n@@ -2087,7 +2237,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \targv[unk] = NULL;\n \n \tinit_revisions(&revs, NULL);\n-\tsetup_revisions(unk, argv, &revs, \"HEAD\");\n+\tsetup_revisions(unk, argv, &revs, NULL);\n \tmemset(&sb, 0, sizeof(sb));\n \n \t/*\n@@ -2114,16 +2264,14 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \tif (!sb.final) {\n \t\t/*\n \t\t * \"--not A B -- path\" without anything positive;\n-\t\t * default to HEAD.\n+\t\t * do not default to HEAD, but use the working tree\n+\t\t * or \"--contents\".\n \t\t */\n-\t\tunsigned char head_sha1[20];\n-\n-\t\tfinal_commit_name = \"HEAD\";\n-\t\tif (get_sha1(final_commit_name, head_sha1))\n-\t\t\tdie(\"No such ref: HEAD\");\n-\t\tsb.final = lookup_commit_reference(head_sha1);\n-\t\tadd_pending_object(&revs, &(sb.final->object), \"HEAD\");\n+\t\tsb.final = fake_working_tree_commit(path, contents_from);\n+\t\tadd_pending_object(&revs, &(sb.final->object), \":\");\n \t}\n+\telse if (contents_from)\n+\t\tdie(\"Cannot use --contents with final commit object name\");\n \n \t/*\n \t * If we have bottom, this will mark the ancestors of the\n@@ -2132,11 +2280,22 @@ int cmd_blame(int argc, const char **argv, const char *prefix)\n \t */\n \tprepare_revision_walk(&revs);\n \n-\to = get_origin(&sb, sb.final, path);\n-\tif (fill_blob_sha1(o))\n-\t\tdie(\"no such path %s in %s\", path, final_commit_name);\n+\tif (is_null_sha1(sb.final->object.sha1)) {\n+\t\tchar *buf;\n+\t\to = sb.final->util;\n+\t\tbuf = xmalloc(o->file.size + 1);\n+\t\tmemcpy(buf, o->file.ptr, o->file.size + 1);\n+\t\tsb.final_buf = buf;\n+\t\tsb.final_buf_size = o->file.size;\n+\t}\n+\telse {\n+\t\to = get_origin(&sb, sb.final, path);\n+\t\tif (fill_blob_sha1(o))\n+\t\t\tdie(\"no such path %s in %s\", path, final_commit_name);\n \n-\tsb.final_buf = read_sha1_file(o->blob_sha1, type, &sb.final_buf_size);\n+\t\tsb.final_buf = read_sha1_file(o->blob_sha1, type,\n+\t\t\t\t\t      &sb.final_buf_size);\n+\t}\n \tnum_read_blob++;\n \tlno = prepare_lines(&sb);\n \ndiff --git a/diff-lib.c b/diff-lib.c\nindex 2c9be60..91cd877 100644\n--- a/diff-lib.c\n+++ b/diff-lib.c\n@@ -7,6 +7,7 @@\n #include \"diff.h\"\n #include \"diffcore.h\"\n #include \"revision.h\"\n+#include \"cache-tree.h\"\n \n /*\n  * diff-files\n@@ -271,7 +272,7 @@ static int diff_cache(struct rev_info *revs,\n \t\t\t\tbreak;\n \t\t\t}\n \t\t\t/* Show difference between old and new */\n-\t\t\tshow_modified(revs,ac[1], ce, 1,\n+\t\t\tshow_modified(revs, ac[1], ce, 1,\n \t\t\t\t      cached, match_missing);\n \t\t\tbreak;\n \t\tcase 1:\n@@ -372,3 +373,44 @@ int run_diff_index(struct rev_info *revs, int cached)\n \tdiff_flush(&revs->diffopt);\n \treturn ret;\n }\n+\n+int do_diff_cache(const unsigned char *tree_sha1, struct diff_options *opt)\n+{\n+\tstruct tree *tree;\n+\tstruct rev_info revs;\n+\tint i;\n+\tstruct cache_entry **dst;\n+\tstruct cache_entry *last = NULL;\n+\n+\t/*\n+\t * This is used by git-blame to run diff-cache internally;\n+\t * it potentially needs to repeatedly run this, so we will\n+\t * start by removing the higher order entries the last round\n+\t * left behind.\n+\t */\n+\tdst = active_cache;\n+\tfor (i = 0; i < active_nr; i++) {\n+\t\tstruct cache_entry *ce = active_cache[i];\n+\t\tif (ce_stage(ce)) {\n+\t\t\tif (last && !strcmp(ce->name, last->name))\n+\t\t\t\tcontinue;\n+\t\t\tcache_tree_invalidate_path(active_cache_tree,\n+\t\t\t\t\t\t   ce->name);\n+\t\t\tlast = ce;\n+\t\t\tce->ce_mode = 0;\n+\t\t\tce->ce_flags &= ~htons(CE_STAGEMASK);\n+\t\t}\n+\t\t*dst++ = ce;\n+\t}\n+\tactive_nr = dst - active_cache;\n+\n+\tinit_revisions(&revs, NULL);\n+\trevs.prune_data = opt->paths;\n+\ttree = parse_tree_indirect(tree_sha1);\n+\tif (!tree)\n+\t\tdie(\"bad tree object %s\", sha1_to_hex(tree_sha1));\n+\tif (read_tree(tree, 1, opt->paths))\n+\t\treturn error(\"unable to read tree %s\", sha1_to_hex(tree_sha1));\n+\treturn diff_cache(&revs, active_cache, active_nr, revs.prune_data,\n+\t\t\t  1, 0);\n+}\ndiff --git a/diff.h b/diff.h\nindex 7a347cf..eece65d 100644\n--- a/diff.h\n+++ b/diff.h\n@@ -222,6 +222,7 @@ extern int run_diff_files(struct rev_info *revs, int silent_on_removed);\n \n extern int run_diff_index(struct rev_info *revs, int cached);\n \n+extern int do_diff_cache(const unsigned char *, struct diff_options *);\n extern int diff_flush_patch_id(struct diff_options *, unsigned char *);\n \n #endif /* DIFF_H */\n-- \n1.5.0.rc3.40.g1f7d\n"},{"id":"33699","messageId":"7v3b5jka3t.fsf_-_@assigned-by-dhcp.cox.net","threadId":"6599","inReplyTo":"7vps8qtgbm.fsf@assigned-by-dhcp.cox.net","subject":"Quick status updates","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-06T07:40:06Z","receivedAt":"2007-02-06T07:40:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <junkio@cox.net> writes:\n\n> Several things to note (in the following, substitute $gmane with\n> http://article.gmane.org/gmane.comp.version-control.git):\n>\n>  - Working around Tk geometry problem, especially on non Linux+X\n>    platforms.  I've forwarded Mark Levedahl's patches\n>    ($gmane/38361) to Paul Mackerras for his blessing; hopefully\n>    he can Ack and/or suggest improvements.  I'd really like to\n>    have them in 1.5.0 in some form.\n\nMark and I got a response from Paul; unfortunately he is too\nbusy right now, immediately after post 2.6.20 merge window has\nopened.  I've parked Mark's patches and another one suggested by\nLinus in response to Johannes Sixt's MinGW work in 'next' for\nnow.  Depending on Paul's availablity, I might end up applying\nthem in my tree first.\n\n>  - Nico's \"reflog on HEAD\".\n>  - Reverting the patch to allow tracking branch names as the\n>    value of branch.*.merge ($gmane/38621).\n>  - Teaching \"git blame\" to also use the working tree files\n>    and/or index.\n>  - \"git remote add -t -f -m\" ($gmane/38470).\n\nThese four are in (\"git clone\" rewrite is not).\n\n>  - We might want to allow git-push to use the wildcard refspec,\n>    like git-fetch does, for symmetry.\n\nI've done this which was not too painful -- a patch in a\nseparate message to follow.\n\nI also applied a handful patches from early this year that was\nleft unapplied.  After reviewing the message I am responding to,\nand an earlier \"a few remaining issues...\" ($gmane/35993), I\nthink I am pretty much done with 1.5.0 preparation.\n\nAfter pulling gfi from Shawn and applying the outstanding gitk\npatches (either via Paul or myself), I'll tag -rc4 and give it a\nweek or so before the final.\n\nI should remember to remove git-merge-recur before -rc4 ;-).\n"},{"id":"33701","messageId":"7vtzxziv5y.fsf_-_@assigned-by-dhcp.cox.net","threadId":"6599","inReplyTo":"7v3b5jka3t.fsf_-_@assigned-by-dhcp.cox.net","subject":"[PATCH] git-push: allow globbing wildcard refspec.","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-06T07:48:09Z","receivedAt":"2007-02-06T07:48:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"This allows you to set up mothership-satellite configuration\nmore symmetrically and naturally by allowing the globbing\nwildcard refspec for git-push.  On your satellite machine:\n\n    [remote \"mothership\"]\n        url = mothership:project.git\n        pull = refs/heads/*:refs/remotes/mothership/*\n        push = refs/heads/*:refs/remotes/satellite/*\n\nYou would say \"git fetch mothership\" to update your tracking\nbranches under mothership/ to keep track of the progress on the\nmothership side, and when you are done working on the satellite\nmachine, you would \"git push mothership\" to update their\ntracking branches under satellite/.  Corresponding configuration\non the mothership machine can be used to make \"git fetch satellite\"\nupdate its tracking branch under satellite/. on the mothership.\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\n builtin-push.c |  114 ++++++++++++++++++++++++++++++++++++++++----------------\n 1 files changed, 82 insertions(+), 32 deletions(-)\n\ndiff --git a/builtin-push.c b/builtin-push.c\nindex 5f4d7d3..c45649e 100644\n--- a/builtin-push.c\n+++ b/builtin-push.c\n@@ -54,38 +54,84 @@ static void expand_refspecs(void)\n \tfor_each_ref(expand_one_ref, NULL);\n }\n \n+struct wildcard_cb {\n+\tconst char *from_prefix;\n+\tint from_prefix_len;\n+\tconst char *to_prefix;\n+\tint to_prefix_len;\n+\tint force;\n+};\n+\n+static int expand_wildcard_ref(const char *ref, const unsigned char *sha1, int flag, void *cb_data)\n+{\n+\tstruct wildcard_cb *cb = cb_data;\n+\tint len = strlen(ref);\n+\tchar *expanded, *newref;\n+\n+\tif (len < cb->from_prefix_len ||\n+\t    memcmp(cb->from_prefix, ref, cb->from_prefix_len))\n+\t\treturn 0;\n+\texpanded = xmalloc(len * 2 + cb->force +\n+\t\t\t   (cb->to_prefix_len - cb->from_prefix_len) + 2);\n+\tnewref = expanded + cb->force;\n+\tif (cb->force)\n+\t\texpanded[0] = '+';\n+\tmemcpy(newref, ref, len);\n+\tnewref[len] = ':';\n+\tmemcpy(newref + len + 1, cb->to_prefix, cb->to_prefix_len);\n+\tstrcpy(newref + len + 1 + cb->to_prefix_len,\n+\t       ref + cb->from_prefix_len);\n+\tadd_refspec(expanded);\n+\treturn 0;\n+}\n+\n+static int wildcard_ref(const char *ref)\n+{\n+\tint len;\n+\tconst char *colon;\n+\tstruct wildcard_cb cb;\n+\n+\tmemset(&cb, 0, sizeof(cb));\n+\tif (ref[0] == '+') {\n+\t\tcb.force = 1;\n+\t\tref++;\n+\t}\n+\tlen = strlen(ref);\n+\tcolon = strchr(ref, ':');\n+\tif (! (colon && ref < colon &&\n+\t       colon[-2] == '/' && colon[-1] == '*' &&\n+\t       /* \"<mine>/<asterisk>:<yours>/<asterisk>\" is at least 7 bytes */\n+\t       7 <= len &&\n+\t       ref[len-2] == '/' && ref[len-1] == '*') )\n+\t\treturn 0 ;\n+\tcb.from_prefix = ref;\n+\tcb.from_prefix_len = colon - ref - 1;\n+\tcb.to_prefix = colon + 1;\n+\tcb.to_prefix_len = len - (colon - ref) - 2;\n+\tfor_each_ref(expand_wildcard_ref, &cb);\n+\treturn 1;\n+}\n+\n static void set_refspecs(const char **refs, int nr)\n {\n \tif (nr) {\n-\t\tint pass;\n-\t\tfor (pass = 0; pass < 2; pass++) {\n-\t\t\t/* pass 0 counts and allocates, pass 1 fills */\n-\t\t\tint i, cnt;\n-\t\t\tfor (i = cnt = 0; i < nr; i++) {\n-\t\t\t\tif (!strcmp(\"tag\", refs[i])) {\n-\t\t\t\t\tint len;\n-\t\t\t\t\tchar *tag;\n-\t\t\t\t\tif (nr <= ++i)\n-\t\t\t\t\t\tdie(\"tag <tag> shorthand without <tag>\");\n-\t\t\t\t\tif (pass) {\n-\t\t\t\t\t\tlen = strlen(refs[i]) + 11;\n-\t\t\t\t\t\ttag = xmalloc(len);\n-\t\t\t\t\t\tstrcpy(tag, \"refs/tags/\");\n-\t\t\t\t\t\tstrcat(tag, refs[i]);\n-\t\t\t\t\t\trefspec[cnt] = tag;\n-\t\t\t\t\t}\n-\t\t\t\t\tcnt++;\n-\t\t\t\t\tcontinue;\n-\t\t\t\t}\n-\t\t\t\tif (pass)\n-\t\t\t\t\trefspec[cnt] = refs[i];\n-\t\t\t\tcnt++;\n-\t\t\t}\n-\t\t\tif (!pass) {\n-\t\t\t\tsize_t bytes = cnt * sizeof(char *);\n-\t\t\t\trefspec_nr = cnt;\n-\t\t\t\trefspec = xrealloc(refspec, bytes);\n+\t\tint i;\n+\t\tfor (i = 0; i < nr; i++) {\n+\t\t\tconst char *ref = refs[i];\n+\t\t\tif (!strcmp(\"tag\", ref)) {\n+\t\t\t\tchar *tag;\n+\t\t\t\tint len;\n+\t\t\t\tif (nr <= ++i)\n+\t\t\t\t\tdie(\"tag shorthand without <tag>\");\n+\t\t\t\tlen = strlen(refs[i]) + 11;\n+\t\t\t\ttag = xmalloc(len);\n+\t\t\t\tstrcpy(tag, \"refs/tags/\");\n+\t\t\t\tstrcat(tag, refs[i]);\n+\t\t\t\tref = tag;\n \t\t\t}\n+\t\t\telse if (wildcard_ref(ref))\n+\t\t\t\tcontinue;\n+\t\t\tadd_refspec(ref);\n \t\t}\n \t}\n \texpand_refspecs();\n@@ -129,8 +175,10 @@ static int get_remotes_uri(const char *repo, const char *uri[MAX_URI])\n \t\t\telse\n \t\t\t\terror(\"more than %d URL's specified, ignoring the rest\", MAX_URI);\n \t\t}\n-\t\telse if (is_refspec && !has_explicit_refspec)\n-\t\t\tadd_refspec(xstrdup(s));\n+\t\telse if (is_refspec && !has_explicit_refspec) {\n+\t\t\tif (!wildcard_ref(s))\n+\t\t\t\tadd_refspec(xstrdup(s));\n+\t\t}\n \t}\n \tfclose(f);\n \tif (!n)\n@@ -156,8 +204,10 @@ static int get_remote_config(const char* key, const char* value)\n \t\t\t\terror(\"more than %d URL's specified, ignoring the rest\", MAX_URI);\n \t\t}\n \t\telse if (config_get_refspecs &&\n-\t\t\t !strcmp(key + 7 + config_repo_len, \".push\"))\n-\t\t\tadd_refspec(xstrdup(value));\n+\t\t\t !strcmp(key + 7 + config_repo_len, \".push\")) {\n+\t\t\tif (!wildcard_ref(value))\n+\t\t\t\tadd_refspec(xstrdup(value));\n+\t\t}\n \t\telse if (config_get_receivepack &&\n \t\t\t !strcmp(key + 7 + config_repo_len, \".receivepack\")) {\n \t\t\tif (!receivepack) {\n-- \n1.5.0.rc3.83.g88293c-dirty\n"},{"id":"33702","messageId":"20070206075305.GC10508@spearce.org","threadId":"6599","inReplyTo":"7vtzxziv5y.fsf_-_@assigned-by-dhcp.cox.net","subject":"Re: [PATCH] git-push: allow globbing wildcard refspec.","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-02-06T07:53:05Z","receivedAt":"2007-02-06T07:53:05Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Junio C Hamano <junkio@cox.net> wrote:\n>     [remote \"mothership\"]\n>         url = mothership:project.git\n>         pull = refs/heads/*:refs/remotes/mothership/*\n\nDon't you mean `fetch = ...` here?\n\n-- \nShawn.\n"}]}