git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC/PATCH] git put: an alternative to add/reset/checkout

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Jun 8, 2011, 15:18 UTC
Message-ID
<BANLkTink9T7M5989Ntpnt5jYcn3bdCXKhQ@mail.gmail.com>
In-Reply-To
<20110607200659.GA6177@sigill.intra.peff.net>
On Wed, Jun 8, 2011 at 3:06 AM, Jeff King <peff@peff.net> wrote:
> But another way to think about it is that commits, the index, and the
> working tree are all "locations" with content. And one common operation
> you may want to do is to move content from one spot to another, either
> whole, by file, or by diff hunks.

Also "git put --pretend" or "git put --dry-run" may show the diff of content movement, without actual moving. "--dry-run --patch" combination probably does not make sense though.

Show 6 quoted lines
> As you can see, this handles only three typoes of locations: the
> worktree, the index, and an arbitrary commit (really a tree-ish). Some
> other types I've thought of are:
>
>  ....
>

I find it intuitive (given a source tree and destination one(s), you can copy content by paths or even by hunks), until you give it more powers (creating new branch or commit, move subdirs...). The original git-put idea could reduce a lot of confusion for new users. Your extra types seem uncommon to me (or can be well covered with current commands without much confusion). For advanced use cases, maybe the current command set can be enhanced with new options.

-- 
Duy
Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 13 of 18 in “git put: an alternative to add/reset/checkout”
  1. git put: an alternative to add/reset/checkoutJeff King, Jun 7, 2011
  2. Junio C HamanoJun 7, 2011
  3. Jeff KingJun 7, 2011
  4. Michael NahasJun 8, 2011
  5. Jakub NarebskiJun 8, 2011
  6. Matthieu MoyJun 8, 2011
  7. Jeff KingJun 8, 2011
  8. Matthieu MoyJun 8, 2011
  9. Jakub NarebskiJun 8, 2011
  10. Matthieu MoyJun 8, 2011
  11. Jakub NarebskiJun 8, 2011
  12. Nguyen Thai Ngoc DuyJun 10, 2011
  13. Nguyen Thai Ngoc DuyJun 8, 2011
  14. Nguyen Thai Ngoc DuyJan 23, 2012
  15. Michael NahasJan 23, 2012
  16. Nguyen Thai Ngoc DuyJan 23, 2012
  17. Michael NahasJan 23, 2012
  18. Junio C HamanoJan 23, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.