[{"data":1,"prerenderedAt":314},["ShallowReactive",2],{"project-12218622":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":27,"sentiment":28,"stance_mix":29,"scored_comments":34,"aspects":35,"strip":39,"post_text":41,"what":42,"said":70,"maker_in_thread":151,"shape":154,"grid":159,"attempts":276,"same_week":277,"maker_shows":249,"maker_hidden":306,"reader_version":307,"card":308},"12218622","Git Confirm","Git Confirm. Git hook to catch accidentally committed code (TODO\u002FSkip)","title","Show HN: Git Confirm. Git hook to catch accidentally committed code (TODO\u002FSkip)","https:\u002F\u002Fgithub.com\u002Fpimterry\u002Fgit-confirm","github.com","pimterry",1470237995,2016,51,45,729,2264,33,"notable","dev_tools","git hook","cli",[21,24,25,26],"pre-commit","git add -p","accidental commit","debated",0.077,{"positive":30,"neutral":31,"mixed":32,"critical":33},4,5,0,3,12,{"idea":36,"execution":37,"privacy":38},{"positive":30,"critical":33},{"positive":32,"critical":32},{"positive":32,"critical":32},[31,31,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,33,33,32,33,32,32,32,32,32,40,32,32,33,33,32,32,32,32,40,40,31,31],1,null,{"problem":43,"audience":49,"pricing":41,"motivation":61,"time_to_build":41,"stack":67,"openness":68,"stage":69,"team_size":69},{"value":44,"source":45,"evidence":46},"Catches accidentally committed code such as TODO or skip markers","maker",[47],{"id":48},"post",{"value":50,"source":51,"evidence":52},"Developers who commit with git","inferred",[53,57],{"id":54,"by":55,"text":56},"12219607","themckman","There isn't a lot that peeves me more than working with developers with poor git commit habits. As someone who takes every commit they make seriously, it can really…",{"id":58,"by":59,"text":60},"12219902","nathancahill","Same. Last project I worked on, most people used git add ., git commit, without ever looking at what was staged. The peeves were real. I'd love a tool that didn't let you commit…",{"value":62,"source":45,"evidence":63},"Likes git add -p but it does not work well for new files and easy to miss changes",[64],{"id":65,"by":11,"text":66},"12219645","I built this mostly because I really like git add -p, but afaict it doesn't work at all for adding totally new files, and it's easy to miss things in the middle of big chunks of…",[],"open_source","unknown",{"praise":71,"objections":85,"requests":104,"questions":116,"alternatives":121},[72,78],{"value":73,"source":74,"evidence":75},"Useful for catching unrelated or temporary changes before commit","commenter",[76,77],{"id":54,"by":55,"text":56},{"id":58,"by":59,"text":60},{"value":79,"source":74,"evidence":80},"Overcommit is a good alternative for managing hooks",[81],{"id":82,"by":83,"text":84},"12221234","dpcx","https:\u002F\u002Fgithub.com\u002Fbrigade\u002Fovercommit It's wonderful.",[86,93],{"value":87,"source":74,"evidence":88},"Copying hook via curl into .git\u002Fhooks could clobber existing hooks",[89],{"id":90,"by":91,"text":92},"12220262","web007","``` curl https:\u002F\u002F...\u002Fhook.sh > .git\u002Fhooks\u002Fpre-commit ``` This seems like a bad idea, since you may already have a commit hook that this would clobber. Does anyone use any kind of…",{"value":94,"source":74,"evidence":95},"Developers can bypass it with -n or empty messages",[96,100],{"id":97,"by":98,"text":99},"12219660","throwawayReply","It's a good idea but ultimately the people who don't care about this will start doing: git commit -am \"\" \u002Fy",{"id":101,"by":102,"text":103},"12220989","happyslobro","Don't forget -n (--no-verify). The last thing we need is some automated test suite getting in our way ;)",[105,112],{"value":106,"source":74,"evidence":107},"Support for matching AWS access key patterns by default",[108],{"id":109,"by":110,"text":111},"12221225","john_oshea","``` git config --add hooks.confirm.match \"AKIA\" ``` would probably be a good default for AWS users.",{"value":113,"source":74,"evidence":114},"Learn from project history to flag unrelated files",[115],{"id":54,"by":55,"text":56},[117],{"value":118,"source":74,"evidence":119},"How to handle hook plugin management",[120],{"id":90,"by":91,"text":92},[122,127,133,140],{"value":123,"source":74,"evidence":124},"overcommit",[125,126],{"id":90,"by":91,"text":92},{"id":82,"by":83,"text":84},{"value":25,"source":74,"evidence":128},[129],{"id":130,"by":131,"text":132},"12219613","coherentpony","You can also git add -p, but that's a habit you have to develop.",{"value":134,"source":74,"evidence":135},"git commit -v",[136],{"id":137,"by":138,"text":139},"12219691","jdoliner","This looks pretty similar to `git commit -v` which brings up a diff of changes in a text editor and prompts you for a commit message.",{"value":141,"source":74,"evidence":142},"GUI clients like SourceTree",[143,147],{"id":144,"by":145,"text":146},"12222288","boardwaalk","Honestly I think the best thing you can do towards making good commits is having a good GUI client and using it well. What I do is, after I'm done making a mess of things, I…",{"id":148,"by":149,"text":150},"12223415","wingerlang","I agree, some time ago I wrote down why I liked GUIs and this was the main point. A relevant part is: ``` This also means that for every commit, you ‘must’ skim through each file…",{"comments":40,"answered":32,"key":152},[153],{"id":65,"text":66},{"commenters":155,"max_depth":156,"maker_replies":40,"first_comment_mins":157,"lifespan_hours":158},34,6,101,141,[160,162,163,167,171,174,177,181,183,185,188,190,192,194,197,200,202,205,207,209,210,212,215,216,219,222,224,227,228,230,233,235,239,241,244,247,251,255,258,261,264,266,267,271,273],[54,32,31,161,55,32],"project\u002Fpositive\u002Fidea",[58,32,31,161,59,32],[164,32,32,165,166,32],"12221023","other\u002Fneutral\u002Fprivacy","jbverschoor",[168,32,32,169,170,32],"12222423","other\u002Fneutral\u002Fnone","e40",[172,40,32,169,173,32],"12220237","bArray",[175,40,32,169,176,32],"12220687","YZF",[178,40,32,179,180,32],"12221020","commenter\u002Fneutral\u002Fnone","btym",[182,40,32,179,176,32],"12221158",[184,40,32,179,173,32],"12222099",[186,40,32,169,187,32],"12221675","jquast",[189,40,32,179,173,32],"12222065",[191,40,32,179,187,32],"12223023",[193,40,32,179,173,32],"12224239",[195,40,32,169,196,32],"12221775","atjoslin",[198,40,32,169,199,32],"12221905","aiiane",[201,40,32,179,173,32],"12222053",[203,40,32,169,204,32],"12222760","flukus",[206,40,32,169,173,32],"12222037",[144,208,32,169,145,32],2,[148,208,32,169,149,32],[90,33,33,211,91,32],"project\u002Fneutral\u002Fexecution",[213,33,33,211,214,32],"12221042","spenuke",[82,33,32,169,83,32],[217,33,33,211,218,32],"12221346","delinka",[220,33,32,179,221,32],"12221986","avar",[223,33,32,179,218,32],"12222336",[225,30,32,169,226,32],"12219747","Sir_Cmpwn",[130,31,32,169,131,32],[65,31,32,229,11,40],"maker\u002Fneutral\u002Fidea",[231,31,32,179,232,32],"12219945","abusque",[137,156,40,234,138,32],"project\u002Fcritical\u002Fidea",[236,156,32,237,238,32],"12220054","commenter\u002Fneutral\u002Fidea","nilved",[240,156,32,179,138,32],"12220241",[109,242,33,243,110,32],7,"project\u002Fneutral\u002Fprivacy",[245,242,32,165,246,32],"12223007","carterehsmith",[248,249,33,250,187,32],"12221719",8,"project\u002Fneutral\u002Fidea",[252,253,32,169,254,32],"12219546",9,"samstokes",[256,253,32,169,257,32],"12219777","cheald",[259,253,32,169,260,32],"12220703","praseodym",[262,253,32,169,263,32],"12222207","daveguy",[97,265,40,234,98,32],10,[101,265,40,234,102,32],[268,269,31,161,270,32],"12219767",11,"dweinus",[272,269,32,169,270,32],"12220384",[274,34,31,161,275,32],"12254103","amitmerchant",[],[278,283,287,292,297,301],{"id":279,"name":280,"points":281,"category":282},"12211754","Noms",508,"data",{"id":284,"name":285,"points":286,"category":20},"12209595","Sharingbuttons.io",350,{"id":288,"name":289,"points":290,"category":291},"12209889","Lambda School",220,"learning_science",{"id":293,"name":294,"points":295,"category":296},"12182581","wireframe-world",181,"creative",{"id":298,"name":299,"points":300,"category":291},"12194010","Apple",172,{"id":302,"name":303,"points":304,"category":305},"12209910","Amium",168,"productivity",false,"v2",{"id":309,"name":5,"line":6,"ai":306,"cat":20,"year":13,"points":14,"comments":15,"rec":27,"s":310,"top":18,"kw":311,"maker":11,"domain":10,"tier":19,"attempts":32,"strip":312,"url":9,"mix":313,"praise":73,"objection":87,"sub":21},12218622,0.08,[21,24,25,26],"5500000000000000003303000001003300001155",[30,31,32,33],1793990946138]